Skip to content

Commit 197524b

Browse files
committed
fix: don't process customKeywordPath
1 parent a96ea02 commit 197524b

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/index.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {writeFileSync} from 'fs';
2-
import {basename, relative, dirname} from 'path';
2+
import {basename} from 'path';
33
import {parseArgs} from './parseArgs';
44
import parse from './parse';
55
import {
@@ -20,11 +20,7 @@ export {
2020
export default function run(args?: string[]) {
2121
const {files, options} = parseArgs(args);
2222
const tsConfig = loadTsConfig();
23-
const parsed = parse(
24-
files.map(f => f.fileName),
25-
tsConfig,
26-
options.schema,
27-
);
23+
const parsed = parse(files.map(f => f.fileName), tsConfig, options.schema);
2824

2925
files.forEach(({fileName, typeName}) => {
3026
const outputFileName = fileName.replace(/\.tsx?$/, '.validator.ts');
@@ -37,12 +33,7 @@ export default function run(args?: string[]) {
3733
normalizeSchema(schema),
3834
`./${basename(fileName, /\.ts$/.test(fileName) ? '.ts' : '.tsx')}`,
3935
options.customKeywordFnName,
40-
options.customKeywordPath
41-
? relative(
42-
dirname(outputFileName),
43-
options.customKeywordPath,
44-
).replace(/.ts/, '')
45-
: '',
36+
options.customKeywordPath,
4637
tsConfig,
4738
options.ajv,
4839
);

0 commit comments

Comments
 (0)