type-crafter 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -4
- package/dist/utils/file-system.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19415,8 +19415,8 @@ async function checkFileNameCase(filePath) {
|
|
|
19415
19415
|
const files = await fs$1.readdir(directory);
|
|
19416
19416
|
return files.includes(fileName);
|
|
19417
19417
|
}
|
|
19418
|
-
async function readFile(filePath, useCurrentWorkingDirectory = true) {
|
|
19419
|
-
if (!(await checkFileNameCase(filePath))) {
|
|
19418
|
+
async function readFile(filePath, useCurrentWorkingDirectory = true, caseSensitive = false) {
|
|
19419
|
+
if (caseSensitive && !(await checkFileNameCase(filePath))) {
|
|
19420
19420
|
throw new Error(`File not found: ${filePath}`);
|
|
19421
19421
|
}
|
|
19422
19422
|
const data = await fs$1.readFile(resolveFilePath(filePath, useCurrentWorkingDirectory), 'utf-8');
|
|
@@ -19463,7 +19463,7 @@ async function writeFile(basePath, fileName, content) {
|
|
|
19463
19463
|
await fs$1.writeFile(filePath, content);
|
|
19464
19464
|
}
|
|
19465
19465
|
async function readYaml(filePath) {
|
|
19466
|
-
const fileData = await readFile(filePath);
|
|
19466
|
+
const fileData = await readFile(filePath, true, true);
|
|
19467
19467
|
return YAML.parse(fileData);
|
|
19468
19468
|
}
|
|
19469
19469
|
|
|
@@ -20508,7 +20508,7 @@ async function runner(language, inputFilePath, outputDirectory, _typesWriterMode
|
|
|
20508
20508
|
}
|
|
20509
20509
|
}
|
|
20510
20510
|
greeting();
|
|
20511
|
-
const program = new Command().version('0.8.
|
|
20511
|
+
const program = new Command().version('0.8.2');
|
|
20512
20512
|
program
|
|
20513
20513
|
.command('generate')
|
|
20514
20514
|
.description('Generate types for your language from a type spec file')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare function resolveFilePath(filePath: string, useCurrentDirectory?: boolean): string;
|
|
2
|
-
export declare function readFile(filePath: string, useCurrentWorkingDirectory?: boolean): Promise<string>;
|
|
2
|
+
export declare function readFile(filePath: string, useCurrentWorkingDirectory?: boolean, caseSensitive?: boolean): Promise<string>;
|
|
3
3
|
export declare function createFolderWithBasePath(basePath: string, folderName: string): Promise<void>;
|
|
4
4
|
export declare function createFolder(folderPath: string): Promise<void>;
|
|
5
5
|
export declare function deleteFolder(folderPath: string): Promise<void>;
|