mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 10:21:55 +00:00
chore: Remove the unused dependencies
This commit is contained in:
@@ -1,11 +1,19 @@
|
||||
import camelCase from "lodash/camelCase"
|
||||
import * as fs from "fs"
|
||||
import { string } from "ts-matches"
|
||||
|
||||
export async function writeConvertedFileFromOld(
|
||||
export function camelCase(value: string) {
|
||||
return value.replace(
|
||||
/^([A-Z])|[\s-_](\w)/g,
|
||||
function (match, p1, p2, offset) {
|
||||
if (p2) return p2.toUpperCase()
|
||||
return p1.toLowerCase()
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
export async function oldSpecToBuilder(
|
||||
file: string,
|
||||
inputData: Promise<any> | any,
|
||||
options: Parameters<typeof makeFileContentFromOld>[1],
|
||||
options?: Parameters<typeof makeFileContentFromOld>[1],
|
||||
) {
|
||||
await fs.writeFile(
|
||||
file,
|
||||
@@ -14,6 +22,10 @@ export async function writeConvertedFileFromOld(
|
||||
)
|
||||
}
|
||||
|
||||
function isString(x: unknown): x is string {
|
||||
return typeof x === "string"
|
||||
}
|
||||
|
||||
export default async function makeFileContentFromOld(
|
||||
inputData: Promise<any> | any,
|
||||
{ startSdk = "start-sdk", nested = true } = {},
|
||||
@@ -145,7 +157,7 @@ export default async function makeFileContentFromOld(
|
||||
])
|
||||
const values = Object.fromEntries(
|
||||
Array.from(allValueNames)
|
||||
.filter(string.test)
|
||||
.filter(isString)
|
||||
.map((key) => [key, value?.spec?.["value-names"]?.[key] || key]),
|
||||
)
|
||||
return `Value.select(${JSON.stringify(
|
||||
@@ -264,7 +276,7 @@ export default async function makeFileContentFromOld(
|
||||
)
|
||||
const values = Object.fromEntries(
|
||||
Array.from(allValueNames)
|
||||
.filter(string.test)
|
||||
.filter(isString)
|
||||
.map((key: string) => [
|
||||
key,
|
||||
value?.spec?.["value-names"]?.[key] || key,
|
||||
@@ -383,3 +395,9 @@ function rangeToTodoComment(range: string | undefined) {
|
||||
if (!range) return ""
|
||||
return `/* TODO: Convert range for this value (${range})*/`
|
||||
}
|
||||
|
||||
// oldSpecToBuilder(
|
||||
// "./config.ts",
|
||||
// // Put config here
|
||||
// {},
|
||||
// )
|
||||
|
||||
Reference in New Issue
Block a user