diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-08-09 19:35:26 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-08-09 19:35:26 -0700 |
commit | f38c8fb8b33a705ed4eb4d2e0974060ebb88afd3 (patch) | |
tree | 892762e409389de60726ae5105caca46d2643401 /extension/scripts | |
parent | dc0622848b648ba27e7110b9b900673bb668ab4c (diff) | |
download | sncontinue-f38c8fb8b33a705ed4eb4d2e0974060ebb88afd3.tar.gz sncontinue-f38c8fb8b33a705ed4eb4d2e0974060ebb88afd3.tar.bz2 sncontinue-f38c8fb8b33a705ed4eb4d2e0974060ebb88afd3.zip |
fix: :bug: another windows fix in typegen.js
Diffstat (limited to 'extension/scripts')
-rw-r--r-- | extension/scripts/typegen.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/extension/scripts/typegen.js b/extension/scripts/typegen.js index ada39d47..8fec3888 100644 --- a/extension/scripts/typegen.js +++ b/extension/scripts/typegen.js @@ -4,7 +4,7 @@ const { compile } = require("json-schema-to-typescript"); function generateTypesForFile(inputPath, outputPath) { let schema = JSON.parse(fs.readFileSync(inputPath, "utf8")); - let name = (inputPath.split("/").pop() || inputPath).split(".")[0]; + let name = path.parse(path.basename(inputPath)).name; // This is to solve the issue of json-schema-to-typescript not supporting $ref at the top-level, which is what Pydantic generates for recursive types if ("$ref" in schema) { let temp = schema["$ref"]; |