@servicetitan/folder-lint 30.3.0 → 31.0.0
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/failures.js +58 -24
- package/dist/failures.js.map +1 -1
- package/dist/file.js +18 -3
- package/dist/file.js.map +1 -1
- package/dist/folderSchema.js +136 -69
- package/dist/folderSchema.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -8
- package/dist/index.js.map +1 -1
- package/dist/lazy.js +23 -6
- package/dist/lazy.js.map +1 -1
- package/dist/namingConvention.js +18 -11
- package/dist/namingConvention.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +4 -2
package/dist/failures.js
CHANGED
|
@@ -1,14 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get allowedExtensionsFailure () {
|
|
13
|
+
return allowedExtensionsFailure;
|
|
14
|
+
},
|
|
15
|
+
get allowedFilesFailure () {
|
|
16
|
+
return allowedFilesFailure;
|
|
17
|
+
},
|
|
18
|
+
get allowedFolderNameFailure () {
|
|
19
|
+
return allowedFolderNameFailure;
|
|
20
|
+
},
|
|
21
|
+
get fileNamingConventionFailure () {
|
|
22
|
+
return fileNamingConventionFailure;
|
|
23
|
+
},
|
|
24
|
+
get folderNamingConventionFailure () {
|
|
25
|
+
return folderNamingConventionFailure;
|
|
26
|
+
},
|
|
27
|
+
get printAllowedExtensionsFailure () {
|
|
28
|
+
return printAllowedExtensionsFailure;
|
|
29
|
+
},
|
|
30
|
+
get printAllowedFilesFailure () {
|
|
31
|
+
return printAllowedFilesFailure;
|
|
32
|
+
},
|
|
33
|
+
get printFailure () {
|
|
34
|
+
return printFailure;
|
|
35
|
+
},
|
|
36
|
+
get printFileNamingConventionFailure () {
|
|
37
|
+
return printFileNamingConventionFailure;
|
|
38
|
+
},
|
|
39
|
+
get printFolderNameFailure () {
|
|
40
|
+
return printFolderNameFailure;
|
|
41
|
+
},
|
|
42
|
+
get printFolderNamingConventionFailure () {
|
|
43
|
+
return printFolderNamingConventionFailure;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
10
46
|
function printFailure(f) {
|
|
11
|
-
switch
|
|
47
|
+
switch(f.type){
|
|
12
48
|
case 'allowedFolderNameFailure':
|
|
13
49
|
return printFolderNameFailure(f);
|
|
14
50
|
case 'folderNamingConventionFailure':
|
|
@@ -21,34 +57,32 @@ function printFailure(f) {
|
|
|
21
57
|
return printAllowedExtensionsFailure(f);
|
|
22
58
|
}
|
|
23
59
|
}
|
|
24
|
-
|
|
60
|
+
const allowedFolderNameFailure = failure('allowedFolderNameFailure');
|
|
25
61
|
function printFolderNameFailure(f) {
|
|
26
|
-
return
|
|
27
|
-
` (allowed: ${JSON.stringify(f.allowedNames)})`);
|
|
62
|
+
return `'${f.folderName}' is not allowed in '${f.parentName}'` + ` (allowed: ${JSON.stringify(f.allowedNames)})`;
|
|
28
63
|
}
|
|
29
|
-
|
|
64
|
+
const folderNamingConventionFailure = failure('folderNamingConventionFailure');
|
|
30
65
|
function printFolderNamingConventionFailure(f) {
|
|
31
66
|
return `folder '${f.folderName}' mismatches 'namingConvention' for '${f.parentName}' (${f.namingConvention})`;
|
|
32
67
|
}
|
|
33
|
-
|
|
68
|
+
const allowedFilesFailure = failure('allowedFilesFailure');
|
|
34
69
|
function printAllowedFilesFailure(f) {
|
|
35
|
-
return
|
|
36
|
-
` (allowed: ${JSON.stringify(f.allowedFiles)})`);
|
|
70
|
+
return `'${f.fileName}' mismatches 'allowedFiles' for '${f.folderName}'` + ` (allowed: ${JSON.stringify(f.allowedFiles)})`;
|
|
37
71
|
}
|
|
38
|
-
|
|
72
|
+
const fileNamingConventionFailure = failure('fileNamingConventionFailure');
|
|
39
73
|
function printFileNamingConventionFailure(f) {
|
|
40
74
|
return `'${f.fileName}' mismatches 'namingConvention' for '${f.folderName}' (${f.namingConvention})`;
|
|
41
75
|
}
|
|
42
|
-
|
|
76
|
+
const allowedExtensionsFailure = failure('allowedExtensionsFailure');
|
|
43
77
|
function printAllowedExtensionsFailure(f) {
|
|
44
|
-
return
|
|
45
|
-
` (allowed: ${JSON.stringify(f.allowedExtensions)})`);
|
|
78
|
+
return `'${f.fileName}' mismatches 'allowedExtensions' for '${f.folderName}'` + ` (allowed: ${JSON.stringify(f.allowedExtensions)})`;
|
|
46
79
|
}
|
|
47
80
|
// ------------------------------------
|
|
48
81
|
function failure(type) {
|
|
49
|
-
return (params)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
82
|
+
return (params)=>({
|
|
83
|
+
...params,
|
|
84
|
+
type
|
|
85
|
+
});
|
|
53
86
|
}
|
|
87
|
+
|
|
54
88
|
//# sourceMappingURL=failures.js.map
|
package/dist/failures.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/failures.ts"],"sourcesContent":["export type Failure =\n | AllowedFolderNameFailure\n | FolderNamingConventionFailure\n | AllowedFilesFailure\n | FileNamingConventionFailure\n | AllowedExtensionsFailure;\n\nexport function printFailure(f: Failure): string {\n switch (f.type) {\n case 'allowedFolderNameFailure':\n return printFolderNameFailure(f);\n case 'folderNamingConventionFailure':\n return printFolderNamingConventionFailure(f);\n case 'allowedFilesFailure':\n return printAllowedFilesFailure(f);\n case 'fileNamingConventionFailure':\n return printFileNamingConventionFailure(f);\n case 'allowedExtensionsFailure':\n return printAllowedExtensionsFailure(f);\n }\n}\n\n// ------------------------------------\n\nexport interface AllowedFolderNameFailure {\n type: 'allowedFolderNameFailure';\n folderName: string;\n parentName: string;\n allowedNames: string[];\n}\n\nexport const allowedFolderNameFailure = failure<AllowedFolderNameFailure>(\n 'allowedFolderNameFailure'\n);\n\nexport function printFolderNameFailure(f: AllowedFolderNameFailure): string {\n return (\n `'${f.folderName}' is not allowed in '${f.parentName}'` +\n ` (allowed: ${JSON.stringify(f.allowedNames)})`\n );\n}\n\n// ------------------------------------\n\nexport interface FolderNamingConventionFailure {\n type: 'folderNamingConventionFailure';\n folderName: string;\n parentName: string;\n namingConvention: string;\n}\n\nexport const folderNamingConventionFailure = failure<FolderNamingConventionFailure>(\n 'folderNamingConventionFailure'\n);\n\nexport function printFolderNamingConventionFailure(f: FolderNamingConventionFailure): string {\n return `folder '${f.folderName}' mismatches 'namingConvention' for '${f.parentName}' (${f.namingConvention})`;\n}\n\n// ------------------------------------\n\nexport interface AllowedFilesFailure {\n type: 'allowedFilesFailure';\n fileName: string;\n folderName: string;\n allowedFiles: string[];\n}\n\nexport const allowedFilesFailure = failure<AllowedFilesFailure>('allowedFilesFailure');\n\nexport function printAllowedFilesFailure(f: AllowedFilesFailure): string {\n return (\n `'${f.fileName}' mismatches 'allowedFiles' for '${f.folderName}'` +\n ` (allowed: ${JSON.stringify(f.allowedFiles)})`\n );\n}\n\n// ------------------------------------\n\nexport interface FileNamingConventionFailure {\n type: 'fileNamingConventionFailure';\n fileName: string;\n folderName: string;\n namingConvention: string;\n}\n\nexport const fileNamingConventionFailure = failure<FileNamingConventionFailure>(\n 'fileNamingConventionFailure'\n);\n\nexport function printFileNamingConventionFailure(f: FileNamingConventionFailure): string {\n return `'${f.fileName}' mismatches 'namingConvention' for '${f.folderName}' (${f.namingConvention})`;\n}\n\n// ------------------------------------\n\nexport interface AllowedExtensionsFailure {\n type: 'allowedExtensionsFailure';\n fileName: string;\n folderName: string;\n allowedExtensions: string[];\n}\n\nexport const allowedExtensionsFailure = failure<AllowedExtensionsFailure>(\n 'allowedExtensionsFailure'\n);\n\nexport function printAllowedExtensionsFailure(f: AllowedExtensionsFailure): string {\n return (\n `'${f.fileName}' mismatches 'allowedExtensions' for '${f.folderName}'` +\n ` (allowed: ${JSON.stringify(f.allowedExtensions)})`\n );\n}\n\n// ------------------------------------\n\nfunction failure<F extends { type: T }, T extends string = any>(type: T) {\n return (params: Omit<F, 'type'>): F => ({\n ...(params as any),\n type,\n });\n}\n"],"names":["allowedExtensionsFailure","allowedFilesFailure","allowedFolderNameFailure","fileNamingConventionFailure","folderNamingConventionFailure","printAllowedExtensionsFailure","printAllowedFilesFailure","printFailure","printFileNamingConventionFailure","printFolderNameFailure","printFolderNamingConventionFailure","f","type","failure","folderName","parentName","JSON","stringify","allowedNames","namingConvention","fileName","allowedFiles","allowedExtensions","params"],"mappings":";;;;;;;;;;;QAuGaA;eAAAA;;QAnCAC;eAAAA;;QArCAC;eAAAA;;QAuDAC;eAAAA;;QAnCAC;eAAAA;;QAwDGC;eAAAA;;QArCAC;eAAAA;;QA/DAC;eAAAA;;QAmFAC;eAAAA;;QAvDAC;eAAAA;;QAoBAC;eAAAA;;;AAhDT,SAASH,aAAaI,CAAU;IACnC,OAAQA,EAAEC,IAAI;QACV,KAAK;YACD,OAAOH,uBAAuBE;QAClC,KAAK;YACD,OAAOD,mCAAmCC;QAC9C,KAAK;YACD,OAAOL,yBAAyBK;QACpC,KAAK;YACD,OAAOH,iCAAiCG;QAC5C,KAAK;YACD,OAAON,8BAA8BM;IAC7C;AACJ;AAWO,MAAMT,2BAA2BW,QACpC;AAGG,SAASJ,uBAAuBE,CAA2B;IAC9D,OACI,CAAC,CAAC,EAAEA,EAAEG,UAAU,CAAC,qBAAqB,EAAEH,EAAEI,UAAU,CAAC,CAAC,CAAC,GACvD,CAAC,WAAW,EAAEC,KAAKC,SAAS,CAACN,EAAEO,YAAY,EAAE,CAAC,CAAC;AAEvD;AAWO,MAAMd,gCAAgCS,QACzC;AAGG,SAASH,mCAAmCC,CAAgC;IAC/E,OAAO,CAAC,QAAQ,EAAEA,EAAEG,UAAU,CAAC,qCAAqC,EAAEH,EAAEI,UAAU,CAAC,GAAG,EAAEJ,EAAEQ,gBAAgB,CAAC,CAAC,CAAC;AACjH;AAWO,MAAMlB,sBAAsBY,QAA6B;AAEzD,SAASP,yBAAyBK,CAAsB;IAC3D,OACI,CAAC,CAAC,EAAEA,EAAES,QAAQ,CAAC,iCAAiC,EAAET,EAAEG,UAAU,CAAC,CAAC,CAAC,GACjE,CAAC,WAAW,EAAEE,KAAKC,SAAS,CAACN,EAAEU,YAAY,EAAE,CAAC,CAAC;AAEvD;AAWO,MAAMlB,8BAA8BU,QACvC;AAGG,SAASL,iCAAiCG,CAA8B;IAC3E,OAAO,CAAC,CAAC,EAAEA,EAAES,QAAQ,CAAC,qCAAqC,EAAET,EAAEG,UAAU,CAAC,GAAG,EAAEH,EAAEQ,gBAAgB,CAAC,CAAC,CAAC;AACxG;AAWO,MAAMnB,2BAA2Ba,QACpC;AAGG,SAASR,8BAA8BM,CAA2B;IACrE,OACI,CAAC,CAAC,EAAEA,EAAES,QAAQ,CAAC,sCAAsC,EAAET,EAAEG,UAAU,CAAC,CAAC,CAAC,GACtE,CAAC,WAAW,EAAEE,KAAKC,SAAS,CAACN,EAAEW,iBAAiB,EAAE,CAAC,CAAC;AAE5D;AAEA,uCAAuC;AAEvC,SAAST,QAAuDD,IAAO;IACnE,OAAO,CAACW,SAAgC,CAAA;YACpC,GAAIA,MAAM;YACVX;QACJ,CAAA;AACJ"}
|
package/dist/file.js
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get getFileBasename () {
|
|
13
|
+
return getFileBasename;
|
|
14
|
+
},
|
|
15
|
+
get getFileExtension () {
|
|
16
|
+
return getFileExtension;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
5
19
|
function getFileBasename(fileName) {
|
|
6
20
|
const firstPointIndex = fileName.indexOf('.');
|
|
7
21
|
return firstPointIndex < 0 ? fileName : fileName.substring(0, firstPointIndex);
|
|
@@ -10,4 +24,5 @@ function getFileExtension(fileName) {
|
|
|
10
24
|
const firstPointIndex = fileName.indexOf('.');
|
|
11
25
|
return firstPointIndex < 0 ? '' : fileName.substring(firstPointIndex);
|
|
12
26
|
}
|
|
27
|
+
|
|
13
28
|
//# sourceMappingURL=file.js.map
|
package/dist/file.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/file.ts"],"sourcesContent":["export function getFileBasename(fileName: string): string {\n const firstPointIndex = fileName.indexOf('.');\n return firstPointIndex < 0 ? fileName : fileName.substring(0, firstPointIndex);\n}\n\nexport function getFileExtension(fileName: string): string {\n const firstPointIndex = fileName.indexOf('.');\n return firstPointIndex < 0 ? '' : fileName.substring(firstPointIndex);\n}\n"],"names":["getFileBasename","getFileExtension","fileName","firstPointIndex","indexOf","substring"],"mappings":";;;;;;;;;;;QAAgBA;eAAAA;;QAKAC;eAAAA;;;AALT,SAASD,gBAAgBE,QAAgB;IAC5C,MAAMC,kBAAkBD,SAASE,OAAO,CAAC;IACzC,OAAOD,kBAAkB,IAAID,WAAWA,SAASG,SAAS,CAAC,GAAGF;AAClE;AAEO,SAASF,iBAAiBC,QAAgB;IAC7C,MAAMC,kBAAkBD,SAASE,OAAO,CAAC;IACzC,OAAOD,kBAAkB,IAAI,KAAKD,SAASG,SAAS,CAACF;AACzD"}
|
package/dist/folderSchema.js
CHANGED
|
@@ -1,101 +1,143 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
exports
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get alwaysArray () {
|
|
13
|
+
return alwaysArray;
|
|
14
|
+
},
|
|
15
|
+
get canonicalizeAllowedFiles () {
|
|
16
|
+
return canonicalizeAllowedFiles;
|
|
17
|
+
},
|
|
18
|
+
get canonicalizeConfig () {
|
|
19
|
+
return canonicalizeConfig;
|
|
20
|
+
},
|
|
21
|
+
get checkFileExt () {
|
|
22
|
+
return checkFileExt;
|
|
23
|
+
},
|
|
24
|
+
get checkFileName () {
|
|
25
|
+
return checkFileName;
|
|
26
|
+
},
|
|
27
|
+
get checkFileNamingConvention () {
|
|
28
|
+
return checkFileNamingConvention;
|
|
29
|
+
},
|
|
30
|
+
get checkFolder () {
|
|
31
|
+
return checkFolder;
|
|
32
|
+
},
|
|
33
|
+
get checkFolderNamingConvention () {
|
|
34
|
+
return checkFolderNamingConvention;
|
|
35
|
+
},
|
|
36
|
+
get checkPath () {
|
|
37
|
+
return checkPath;
|
|
38
|
+
},
|
|
39
|
+
get compareByMagicInName () {
|
|
40
|
+
return compareByMagicInName;
|
|
41
|
+
},
|
|
42
|
+
get inheritAllowedExtensions () {
|
|
43
|
+
return inheritAllowedExtensions;
|
|
44
|
+
},
|
|
45
|
+
get inheritNamingConvention () {
|
|
46
|
+
return inheritNamingConvention;
|
|
47
|
+
},
|
|
48
|
+
get isAllowedFolderName () {
|
|
49
|
+
return isAllowedFolderName;
|
|
50
|
+
},
|
|
51
|
+
get memoizeConfig () {
|
|
52
|
+
return memoizeConfig;
|
|
53
|
+
},
|
|
54
|
+
get splitFilename () {
|
|
55
|
+
return splitFilename;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const _glob = require("glob");
|
|
59
|
+
const _minimatch = /*#__PURE__*/ _interop_require_default(require("minimatch"));
|
|
60
|
+
const _failures = require("./failures");
|
|
61
|
+
const _file = require("./file");
|
|
62
|
+
const _lazy = require("./lazy");
|
|
63
|
+
const _namingConvention = require("./namingConvention");
|
|
64
|
+
function _interop_require_default(obj) {
|
|
65
|
+
return obj && obj.__esModule ? obj : {
|
|
66
|
+
default: obj
|
|
67
|
+
};
|
|
68
|
+
}
|
|
27
69
|
function checkPath(rawCfg) {
|
|
28
|
-
const cfg = canonicalizeConfig((0,
|
|
70
|
+
const cfg = canonicalizeConfig((0, _lazy.alwaysLazy)(rawCfg));
|
|
29
71
|
const memoCfg = memoizeConfig(cfg)();
|
|
30
|
-
return (filename)
|
|
72
|
+
return (filename)=>{
|
|
31
73
|
const pathParts = splitFilename(filename);
|
|
32
74
|
return checkFolder(memoCfg, pathParts, '<root>');
|
|
33
75
|
};
|
|
34
76
|
}
|
|
35
77
|
function canonicalizeConfig(lazyFolder) {
|
|
36
|
-
return ()
|
|
78
|
+
return ()=>{
|
|
37
79
|
const folder = lazyFolder();
|
|
38
80
|
const allowedExtensions = alwaysArray(folder.allowedExtensions);
|
|
39
|
-
const children = alwaysArray(folder.children)
|
|
40
|
-
.map(lazy_1.alwaysLazy)
|
|
41
|
-
.map(lazyChild => () => inheritNamingConvention(folder.namingConvention, lazyChild()))
|
|
42
|
-
.map(lazyChild => () => inheritAllowedExtensions(allowedExtensions, lazyChild()))
|
|
43
|
-
.map(canonicalizeConfig);
|
|
81
|
+
const children = alwaysArray(folder.children).map(_lazy.alwaysLazy).map((lazyChild)=>()=>inheritNamingConvention(folder.namingConvention, lazyChild())).map((lazyChild)=>()=>inheritAllowedExtensions(allowedExtensions, lazyChild())).map(canonicalizeConfig);
|
|
44
82
|
return {
|
|
45
83
|
...folder,
|
|
46
84
|
allowedExtensions,
|
|
47
85
|
children,
|
|
48
86
|
ignore: !!folder.ignore,
|
|
49
|
-
allowedFiles: canonicalizeAllowedFiles(folder.allowedFiles)
|
|
87
|
+
allowedFiles: canonicalizeAllowedFiles(folder.allowedFiles)
|
|
50
88
|
};
|
|
51
89
|
};
|
|
52
90
|
}
|
|
53
91
|
function memoizeConfig(lazyFolder) {
|
|
54
|
-
return (0,
|
|
92
|
+
return (0, _lazy.memoizeConst)(()=>{
|
|
55
93
|
const folder = lazyFolder();
|
|
56
94
|
const children = folder.children.map(memoizeConfig);
|
|
57
95
|
return {
|
|
58
96
|
...folder,
|
|
59
|
-
children
|
|
97
|
+
children
|
|
60
98
|
};
|
|
61
99
|
});
|
|
62
100
|
}
|
|
63
|
-
function canonicalizeAllowedFiles(files = [
|
|
101
|
+
function canonicalizeAllowedFiles(files = [
|
|
102
|
+
'*'
|
|
103
|
+
]) {
|
|
64
104
|
return alwaysArray(files);
|
|
65
105
|
}
|
|
66
106
|
function alwaysArray(es = []) {
|
|
67
|
-
return Array.isArray(es) ? es : [
|
|
107
|
+
return Array.isArray(es) ? es : [
|
|
108
|
+
es
|
|
109
|
+
];
|
|
68
110
|
}
|
|
69
111
|
function inheritNamingConvention(parentNamingConvention, child) {
|
|
70
|
-
var
|
|
112
|
+
var _child_namingConvention;
|
|
71
113
|
return {
|
|
72
114
|
...child,
|
|
73
|
-
namingConvention: (
|
|
115
|
+
namingConvention: (_child_namingConvention = child.namingConvention) !== null && _child_namingConvention !== void 0 ? _child_namingConvention : parentNamingConvention
|
|
74
116
|
};
|
|
75
117
|
}
|
|
76
118
|
function inheritAllowedExtensions(parentAllowedExtensions, child) {
|
|
77
119
|
const overrideExtensions = child.overrideExtensions !== false && child.allowedExtensions !== undefined;
|
|
78
120
|
const childAllowedExtensions = alwaysArray(child.allowedExtensions);
|
|
79
|
-
const allowedExtensions = overrideExtensions
|
|
80
|
-
|
|
81
|
-
|
|
121
|
+
const allowedExtensions = overrideExtensions ? childAllowedExtensions : [
|
|
122
|
+
...parentAllowedExtensions,
|
|
123
|
+
...childAllowedExtensions
|
|
124
|
+
];
|
|
82
125
|
return {
|
|
83
126
|
...child,
|
|
84
|
-
allowedExtensions
|
|
127
|
+
allowedExtensions
|
|
85
128
|
};
|
|
86
129
|
}
|
|
87
130
|
function splitFilename(filename) {
|
|
88
|
-
const path = filename
|
|
89
|
-
.replace(/\\/g, '/')
|
|
90
|
-
.split('/')
|
|
91
|
-
.filter(s => s.length > 0);
|
|
131
|
+
const path = filename.replace(/\\/g, '/').split('/').filter((s)=>s.length > 0);
|
|
92
132
|
if (path.length < 1) {
|
|
93
|
-
return [
|
|
133
|
+
return [
|
|
134
|
+
''
|
|
135
|
+
];
|
|
94
136
|
}
|
|
95
137
|
return path;
|
|
96
138
|
}
|
|
97
139
|
function isAllowedFolderName(pattern, folderName) {
|
|
98
|
-
return (0,
|
|
140
|
+
return (0, _minimatch.default)(folderName, pattern);
|
|
99
141
|
}
|
|
100
142
|
function checkFolder(cfg, subPath, folderName) {
|
|
101
143
|
if (cfg.ignore) {
|
|
@@ -107,56 +149,81 @@ function checkFolder(cfg, subPath, folderName) {
|
|
|
107
149
|
return [
|
|
108
150
|
...checkFileNamingConvention(cfg.namingConvention, fileName, folderName),
|
|
109
151
|
...checkFileName(cfg.allowedFiles, fileName, folderName),
|
|
110
|
-
...checkFileExt(cfg.allowedExtensions, fileName, folderName)
|
|
152
|
+
...checkFileExt(cfg.allowedExtensions, fileName, folderName)
|
|
111
153
|
];
|
|
112
154
|
}
|
|
113
155
|
const [childFolderName, ...restPath] = subPath;
|
|
114
|
-
const children = cfg.children
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const allowedChild = children.find(childCfg => isAllowedFolderName(childCfg.name, childFolderName));
|
|
156
|
+
const children = cfg.children.map((c)=>c()) // load children
|
|
157
|
+
.sort(compareByMagicInName);
|
|
158
|
+
const allowedChild = children.find((childCfg)=>isAllowedFolderName(childCfg.name, childFolderName));
|
|
118
159
|
if (!allowedChild) {
|
|
119
160
|
return [
|
|
120
|
-
(0,
|
|
161
|
+
(0, _failures.allowedFolderNameFailure)({
|
|
121
162
|
folderName: childFolderName,
|
|
122
163
|
parentName: folderName,
|
|
123
|
-
allowedNames: children.map(c
|
|
124
|
-
})
|
|
164
|
+
allowedNames: children.map((c)=>c.name)
|
|
165
|
+
})
|
|
125
166
|
];
|
|
126
167
|
}
|
|
127
168
|
return [
|
|
128
169
|
...checkFolderNamingConvention(cfg.namingConvention, childFolderName, folderName),
|
|
129
|
-
...checkFolder(allowedChild, restPath, childFolderName)
|
|
170
|
+
...checkFolder(allowedChild, restPath, childFolderName)
|
|
130
171
|
];
|
|
131
172
|
}
|
|
132
173
|
function checkFolderNamingConvention(namingConvention, folderName, parentName) {
|
|
133
|
-
if (!
|
|
134
|
-
return [
|
|
174
|
+
if (!_namingConvention.NamingConvention.check(namingConvention, folderName)) {
|
|
175
|
+
return [
|
|
176
|
+
(0, _failures.folderNamingConventionFailure)({
|
|
177
|
+
folderName,
|
|
178
|
+
parentName,
|
|
179
|
+
namingConvention
|
|
180
|
+
})
|
|
181
|
+
];
|
|
135
182
|
}
|
|
136
183
|
return [];
|
|
137
184
|
}
|
|
138
185
|
function checkFileName(allowedFiles, fileName, folderName) {
|
|
139
|
-
const isMatch = allowedFiles.some(af
|
|
186
|
+
const isMatch = allowedFiles.some((af)=>(0, _minimatch.default)(fileName, af));
|
|
140
187
|
if (!isMatch) {
|
|
141
|
-
return [
|
|
188
|
+
return [
|
|
189
|
+
(0, _failures.allowedFilesFailure)({
|
|
190
|
+
fileName,
|
|
191
|
+
folderName,
|
|
192
|
+
allowedFiles
|
|
193
|
+
})
|
|
194
|
+
];
|
|
142
195
|
}
|
|
143
196
|
return [];
|
|
144
197
|
}
|
|
145
198
|
function checkFileNamingConvention(namingConvention, fileName, folderName) {
|
|
146
|
-
if (!
|
|
147
|
-
return [
|
|
199
|
+
if (!_namingConvention.NamingConvention.check(namingConvention, (0, _file.getFileBasename)(fileName))) {
|
|
200
|
+
return [
|
|
201
|
+
(0, _failures.fileNamingConventionFailure)({
|
|
202
|
+
fileName,
|
|
203
|
+
folderName,
|
|
204
|
+
namingConvention
|
|
205
|
+
})
|
|
206
|
+
];
|
|
148
207
|
}
|
|
149
208
|
return [];
|
|
150
209
|
}
|
|
151
210
|
function checkFileExt(allowedExtensions, fileName, folderName) {
|
|
152
|
-
const fileExt = (0,
|
|
153
|
-
const isMatch = allowedExtensions.some(ae
|
|
211
|
+
const fileExt = (0, _file.getFileExtension)(fileName);
|
|
212
|
+
const isMatch = allowedExtensions.some((ae)=>(0, _minimatch.default)(fileExt, ae));
|
|
154
213
|
if (!isMatch) {
|
|
155
|
-
return [
|
|
214
|
+
return [
|
|
215
|
+
(0, _failures.allowedExtensionsFailure)({
|
|
216
|
+
fileName,
|
|
217
|
+
folderName,
|
|
218
|
+
allowedExtensions
|
|
219
|
+
})
|
|
220
|
+
];
|
|
156
221
|
}
|
|
157
222
|
return [];
|
|
158
223
|
}
|
|
159
224
|
function compareByMagicInName(a, b) {
|
|
160
|
-
return +
|
|
225
|
+
return +_glob.glob.hasMagic(a.name) - +_glob.glob.hasMagic(b.name);
|
|
161
226
|
}
|
|
227
|
+
// = T & { [P in K]-?: T[P]; };
|
|
228
|
+
|
|
162
229
|
//# sourceMappingURL=folderSchema.js.map
|
package/dist/folderSchema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
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AC;QACX,OAAO,CAAC,IAAA,8BAAmB,EAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,EAAE,CAAC;AACd,CAAC;AAED,SAAgB,yBAAyB,CACrC,gBAAkC,EAClC,QAAgB,EAChB,UAAkB;IAElB,IAAI,CAAC,mCAAgB,CAAC,KAAK,CAAC,gBAAgB,EAAE,IAAA,sBAAe,EAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;QACvE,OAAO,CAAC,IAAA,sCAA2B,EAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;IACrF,CAAC;IAED,OAAO,EAAE,CAAC;AACd,CAAC;AAED,SAAgB,YAAY,CACxB,iBAA2B,EAC3B,QAAgB,EAChB,UAAkB;IAElB,MAAM,OAAO,GAAG,IAAA,uBAAgB,EAAC,QAAQ,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,IAAA,mBAAS,EAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAErE,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,OAAO,CAAC,IAAA,mCAAwB,EAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC;IACnF,CAAC;IAED,OAAO,EAAE,CAAC;AACd,CAAC;AAED,SAAgB,oBAAoB,CAA6B,CAAI,EAAE,CAAI;IACvE,OAAO,CAAC,WAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,WAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAC3D,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../src/folderSchema.ts"],"sourcesContent":["import { glob } from 'glob';\nimport minimatch from 'minimatch';\n\nimport {\n allowedFolderNameFailure,\n allowedExtensionsFailure,\n allowedFilesFailure,\n folderNamingConventionFailure,\n Failure,\n fileNamingConventionFailure,\n} from './failures';\nimport { getFileBasename, getFileExtension } from './file';\nimport { alwaysLazy, MaybeLazy, memoizeConst } from './lazy';\nimport { NamingConvention } from './namingConvention';\n\n/**\n * `Folder` represents tree-like folder schema\n */\nexport interface Folder {\n /**\n * folder name, it is ignored for the root Folder\n * supports Glob\n * https://github.com/isaacs/node-glob#glob-primer\n */\n name: string;\n\n /**\n * defaults to undefined\n * has to be set at least on the root Folder\n */\n namingConvention?: NamingConvention;\n\n /**\n * defaults to []\n */\n children?: MaybeLazy<Folder> | MaybeLazy<Folder>[];\n\n /**\n * defaults to ['*']\n * used to check full file name with extension\n * no path before filename is captured\n * supports Glob\n * https://github.com/isaacs/node-glob#glob-primer\n */\n allowedFiles?: string | string[];\n\n /**\n * defaults to value in previous node or empty array if no previous value\n * used to check only the part that starts after first dot\n * supports Glob\n * https://github.com/isaacs/node-glob#glob-primer\n */\n allowedExtensions?: string | string[];\n\n /**\n * defaults to true, but takes effect only if allowedExtensions is not undefined\n * if false parent extensions are getting concatenated with current ones\n */\n overrideExtensions?: boolean;\n\n /**\n * defaults to false\n * if true then all content will be considered valid.\n */\n ignore?: boolean;\n}\n\nexport interface ParentFolder extends Folder {\n namingConvention: NamingConvention;\n}\n\nexport type RootFolder = MaybeLazy<ParentFolder>;\n\nexport function checkPath(rawCfg: RootFolder) {\n const cfg = canonicalizeConfig(alwaysLazy(rawCfg));\n const memoCfg = memoizeConfig(cfg)();\n\n return (filename: string): Failure[] => {\n const pathParts = splitFilename(filename);\n return checkFolder(memoCfg, pathParts, '<root>');\n };\n}\n\nexport function canonicalizeConfig(lazyFolder: () => ParentFolder): LazyCanonicalFolder {\n return (): CanonicalFolder => {\n const folder = lazyFolder();\n\n const allowedExtensions = alwaysArray(folder.allowedExtensions);\n\n const children = alwaysArray(folder.children)\n .map(alwaysLazy)\n .map(lazyChild => () => inheritNamingConvention(folder.namingConvention, lazyChild()))\n .map(lazyChild => () => inheritAllowedExtensions(allowedExtensions, lazyChild()))\n .map(canonicalizeConfig);\n\n return {\n ...folder,\n\n allowedExtensions,\n children,\n\n ignore: !!folder.ignore,\n allowedFiles: canonicalizeAllowedFiles(folder.allowedFiles),\n };\n };\n}\n\nexport function memoizeConfig(lazyFolder: LazyCanonicalFolder): LazyCanonicalFolder {\n return memoizeConst(() => {\n const folder = lazyFolder();\n const children = folder.children.map(memoizeConfig);\n\n return {\n ...folder,\n children,\n };\n });\n}\n\nexport function canonicalizeAllowedFiles(files: string | string[] = ['*']): string[] {\n return alwaysArray(files);\n}\n\nexport function alwaysArray<T>(es: T | T[] = []): T[] {\n return Array.isArray(es) ? es : [es];\n}\n\nexport interface CanonicalFolder extends ParentFolder {\n children: LazyCanonicalFolder[];\n allowedFiles: string[];\n allowedExtensions: string[];\n ignore: boolean;\n}\n\nexport type LazyCanonicalFolder = () => CanonicalFolder;\n\nexport function inheritNamingConvention<T extends Folder>(\n parentNamingConvention: NamingConvention,\n child: T\n): RequiredProp<T, 'namingConvention'> {\n return {\n ...(child as any),\n namingConvention: child.namingConvention ?? parentNamingConvention,\n };\n}\n\nexport function inheritAllowedExtensions<T extends Folder>(\n parentAllowedExtensions: string[],\n child: T\n): RequiredProp<T, 'allowedExtensions'> {\n const overrideExtensions =\n child.overrideExtensions !== false && child.allowedExtensions !== undefined;\n\n const childAllowedExtensions = alwaysArray(child.allowedExtensions);\n\n const allowedExtensions = overrideExtensions\n ? childAllowedExtensions\n : [...parentAllowedExtensions, ...childAllowedExtensions];\n\n return {\n ...(child as any),\n allowedExtensions,\n };\n}\n\nexport function splitFilename(filename: string): string[] {\n const path = filename\n .replace(/\\\\/g, '/')\n .split('/')\n .filter(s => s.length > 0);\n\n if (path.length < 1) {\n return [''];\n }\n\n return path;\n}\n\nexport function isAllowedFolderName(pattern: string, folderName: string): boolean {\n return minimatch(folderName, pattern);\n}\n\nexport function checkFolder(\n cfg: CanonicalFolder,\n subPath: string[],\n folderName: string\n): Failure[] {\n if (cfg.ignore) {\n return [];\n }\n\n const isLastFolderInPath = subPath.length === 1;\n\n if (isLastFolderInPath) {\n const [fileName] = subPath;\n return [\n ...checkFileNamingConvention(cfg.namingConvention, fileName, folderName),\n ...checkFileName(cfg.allowedFiles, fileName, folderName),\n ...checkFileExt(cfg.allowedExtensions, fileName, folderName),\n ];\n }\n\n const [childFolderName, ...restPath] = subPath;\n\n const children = cfg.children\n .map(c => c()) // load children\n .sort(compareByMagicInName);\n\n const allowedChild = children.find(childCfg =>\n isAllowedFolderName(childCfg.name, childFolderName)\n );\n\n if (!allowedChild) {\n return [\n allowedFolderNameFailure({\n folderName: childFolderName,\n parentName: folderName,\n allowedNames: children.map(c => c.name),\n }),\n ];\n }\n\n return [\n ...checkFolderNamingConvention(cfg.namingConvention, childFolderName, folderName),\n ...checkFolder(allowedChild, restPath, childFolderName),\n ];\n}\n\nexport function checkFolderNamingConvention(\n namingConvention: NamingConvention,\n folderName: string,\n parentName: string\n): Failure[] {\n if (!NamingConvention.check(namingConvention, folderName)) {\n return [folderNamingConventionFailure({ folderName, parentName, namingConvention })];\n }\n\n return [];\n}\n\nexport function checkFileName(\n allowedFiles: string[],\n fileName: string,\n folderName: string\n): Failure[] {\n const isMatch = allowedFiles.some(af => minimatch(fileName, af));\n\n if (!isMatch) {\n return [allowedFilesFailure({ fileName, folderName, allowedFiles })];\n }\n\n return [];\n}\n\nexport function checkFileNamingConvention(\n namingConvention: NamingConvention,\n fileName: string,\n folderName: string\n): Failure[] {\n if (!NamingConvention.check(namingConvention, getFileBasename(fileName))) {\n return [fileNamingConventionFailure({ fileName, folderName, namingConvention })];\n }\n\n return [];\n}\n\nexport function checkFileExt(\n allowedExtensions: string[],\n fileName: string,\n folderName: string\n): Failure[] {\n const fileExt = getFileExtension(fileName);\n const isMatch = allowedExtensions.some(ae => minimatch(fileExt, ae));\n\n if (!isMatch) {\n return [allowedExtensionsFailure({ fileName, folderName, allowedExtensions })];\n }\n\n return [];\n}\n\nexport function compareByMagicInName<T extends { name: string }>(a: T, b: T) {\n return +glob.hasMagic(a.name) - +glob.hasMagic(b.name);\n}\n\n/**\n * Make K properties in T required\n */\ntype RequiredProp<T, K extends keyof T> = T & Required<Pick<T, K>>; // = T & { [P in K]-?: T[P]; };\n"],"names":["alwaysArray","canonicalizeAllowedFiles","canonicalizeConfig","checkFileExt","checkFileName","checkFileNamingConvention","checkFolder","checkFolderNamingConvention","checkPath","compareByMagicInName","inheritAllowedExtensions","inheritNamingConvention","isAllowedFolderName","memoizeConfig","splitFilename","rawCfg","cfg","alwaysLazy","memoCfg","filename","pathParts","lazyFolder","folder","allowedExtensions","children","map","lazyChild","namingConvention","ignore","allowedFiles","memoizeConst","files","es","Array","isArray","parentNamingConvention","child","parentAllowedExtensions","overrideExtensions","undefined","childAllowedExtensions","path","replace","split","filter","s","length","pattern","folderName","minimatch","subPath","isLastFolderInPath","fileName","childFolderName","restPath","c","sort","allowedChild","find","childCfg","name","allowedFolderNameFailure","parentName","allowedNames","NamingConvention","check","folderNamingConventionFailure","isMatch","some","af","allowedFilesFailure","getFileBasename","fileNamingConventionFailure","fileExt","getFileExtension","ae","allowedExtensionsFailure","a","b","glob","hasMagic"],"mappings":";;;;;;;;;;;QA2HgBA;eAAAA;;QAJAC;eAAAA;;QApCAC;eAAAA;;QAuLAC;eAAAA;;QA1BAC;eAAAA;;QAcAC;eAAAA;;QAxEAC;eAAAA;;QA8CAC;eAAAA;;QA3JAC;eAAAA;;QAgNAC;eAAAA;;QAvIAC;eAAAA;;QAVAC;eAAAA;;QA0CAC;eAAAA;;QAvEAC;eAAAA;;QA0DAC;eAAAA;;;sBArKK;kEACC;0BASf;sBAC2C;sBACE;kCACnB;;;;;;AA4D1B,SAASN,UAAUO,MAAkB;IACxC,MAAMC,MAAMd,mBAAmBe,IAAAA,gBAAU,EAACF;IAC1C,MAAMG,UAAUL,cAAcG;IAE9B,OAAO,CAACG;QACJ,MAAMC,YAAYN,cAAcK;QAChC,OAAOb,YAAYY,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AACC,QAAQ,CAACH,EAAEjB,IAAI,IAAI,CAACmB,UAAI,CAACC,QAAQ,CAACF,EAAElB,IAAI;AACzD;CAKoE,+BAA+B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export type { Folder, RootFolder } from './folderSchema';
|
|
2
|
+
export { checkPath } from './folderSchema';
|
|
2
3
|
export { NamingConvention } from './namingConvention';
|
|
3
|
-
export { Failure
|
|
4
|
+
export type { Failure } from './failures';
|
|
5
|
+
export { printFailure } from './failures';
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get NamingConvention () {
|
|
13
|
+
return _namingConvention.NamingConvention;
|
|
14
|
+
},
|
|
15
|
+
get checkPath () {
|
|
16
|
+
return _folderSchema.checkPath;
|
|
17
|
+
},
|
|
18
|
+
get printFailure () {
|
|
19
|
+
return _failures.printFailure;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const _folderSchema = require("./folderSchema");
|
|
23
|
+
const _namingConvention = require("./namingConvention");
|
|
24
|
+
const _failures = require("./failures");
|
|
25
|
+
|
|
10
26
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export type { Folder, RootFolder } from './folderSchema';\nexport { checkPath } from './folderSchema';\n\nexport { NamingConvention } from './namingConvention';\n\nexport type { Failure } from './failures';\nexport { printFailure } from './failures';\n"],"names":["NamingConvention","checkPath","printFailure"],"mappings":";;;;;;;;;;;QAGSA;eAAAA,kCAAgB;;QAFhBC;eAAAA,uBAAS;;QAKTC;eAAAA,sBAAY;;;8BALK;kCAEO;0BAGJ"}
|
package/dist/lazy.js
CHANGED
|
@@ -1,18 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get alwaysLazy () {
|
|
13
|
+
return alwaysLazy;
|
|
14
|
+
},
|
|
15
|
+
get isLazy () {
|
|
16
|
+
return isLazy;
|
|
17
|
+
},
|
|
18
|
+
get memoizeConst () {
|
|
19
|
+
return memoizeConst;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
6
22
|
function isLazy(v) {
|
|
7
23
|
return typeof v === 'function';
|
|
8
24
|
}
|
|
9
25
|
function alwaysLazy(v) {
|
|
10
|
-
return isLazy(v) ? v : ()
|
|
26
|
+
return isLazy(v) ? v : ()=>v;
|
|
11
27
|
}
|
|
12
28
|
function memoizeConst(lazy) {
|
|
13
29
|
let result;
|
|
14
30
|
let evaluated = false;
|
|
15
|
-
return ()
|
|
31
|
+
return ()=>{
|
|
16
32
|
if (!evaluated) {
|
|
17
33
|
result = lazy();
|
|
18
34
|
evaluated = true;
|
|
@@ -20,4 +36,5 @@ function memoizeConst(lazy) {
|
|
|
20
36
|
return result;
|
|
21
37
|
};
|
|
22
38
|
}
|
|
39
|
+
|
|
23
40
|
//# sourceMappingURL=lazy.js.map
|
package/dist/lazy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/lazy.ts"],"sourcesContent":["export type MaybeLazy<T> = (() => NonFunction<T>) | NonFunction<T>;\n\nexport type NonFunction<T> = T extends Function ? never : T;\n\nexport function isLazy<T>(v: MaybeLazy<T>): v is () => NonFunction<T> {\n return typeof v === 'function';\n}\n\nexport function alwaysLazy<T>(v: MaybeLazy<T>): () => T {\n return isLazy(v) ? v : () => v;\n}\n\nexport function memoizeConst<T>(lazy: () => T): () => T {\n let result: T;\n let evaluated = false;\n\n return () => {\n if (!evaluated) {\n result = lazy();\n evaluated = true;\n }\n\n return result;\n };\n}\n"],"names":["alwaysLazy","isLazy","memoizeConst","v","lazy","result","evaluated"],"mappings":";;;;;;;;;;;QAQgBA;eAAAA;;QAJAC;eAAAA;;QAQAC;eAAAA;;;AART,SAASD,OAAUE,CAAe;IACrC,OAAO,OAAOA,MAAM;AACxB;AAEO,SAASH,WAAcG,CAAe;IACzC,OAAOF,OAAOE,KAAKA,IAAI,IAAMA;AACjC;AAEO,SAASD,aAAgBE,IAAa;IACzC,IAAIC;IACJ,IAAIC,YAAY;IAEhB,OAAO;QACH,IAAI,CAACA,WAAW;YACZD,SAASD;YACTE,YAAY;QAChB;QAEA,OAAOD;IACX;AACJ"}
|
package/dist/namingConvention.js
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
(
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "NamingConvention", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return NamingConvention;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var NamingConvention = /*#__PURE__*/ function(NamingConvention) {
|
|
6
12
|
NamingConvention["DashDelimitedLowercase"] = "dash-delimited-lowercase";
|
|
7
13
|
NamingConvention["CamelCase"] = "camelCase";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
(function
|
|
14
|
+
return NamingConvention;
|
|
15
|
+
}({});
|
|
16
|
+
(function(NamingConvention) {
|
|
11
17
|
function check(conv, name) {
|
|
12
18
|
if (name === '') {
|
|
13
19
|
return true;
|
|
14
20
|
}
|
|
15
|
-
switch
|
|
16
|
-
case
|
|
21
|
+
switch(conv){
|
|
22
|
+
case "dash-delimited-lowercase":
|
|
17
23
|
return /^[a-z0-9_]+(-[a-z0-9_]+)*$/.test(name);
|
|
18
|
-
case
|
|
24
|
+
case "camelCase":
|
|
19
25
|
return /^[a-z_][a-zA-Z0-9_]*$/.test(name);
|
|
20
26
|
}
|
|
21
27
|
}
|
|
22
28
|
NamingConvention.check = check;
|
|
23
|
-
})(NamingConvention || (
|
|
29
|
+
})(NamingConvention || (NamingConvention = {}));
|
|
30
|
+
|
|
24
31
|
//# sourceMappingURL=namingConvention.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/namingConvention.ts"],"sourcesContent":["export enum NamingConvention {\n DashDelimitedLowercase = 'dash-delimited-lowercase',\n CamelCase = 'camelCase',\n}\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace NamingConvention {\n export function check(conv: NamingConvention, name: string): boolean {\n if (name === '') {\n return true;\n }\n switch (conv) {\n case NamingConvention.DashDelimitedLowercase:\n return /^[a-z0-9_]+(-[a-z0-9_]+)*$/.test(name);\n case NamingConvention.CamelCase:\n return /^[a-z_][a-zA-Z0-9_]*$/.test(name);\n }\n }\n}\n"],"names":["NamingConvention","check","conv","name","test"],"mappings":";;;;+BAAYA;;;eAAAA;;;AAAL,IAAA,AAAKA,0CAAAA;;;WAAAA;;UAMKA;IACN,SAASC,MAAMC,IAAsB,EAAEC,IAAY;QACtD,IAAIA,SAAS,IAAI;YACb,OAAO;QACX;QACA,OAAQD;YACJ;gBACI,OAAO,6BAA6BE,IAAI,CAACD;YAC7C;gBACI,OAAO,wBAAwBC,IAAI,CAACD;QAC5C;IACJ;qBAVgBF,QAAAA;AAWpB,GAZiBD,qBAAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/folder-lint",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "31.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://docs.st.dev/docs/frontend/folder-schema",
|
|
6
6
|
"repository": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"src"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"glob": "~11.0.
|
|
18
|
+
"glob": "~11.0.3",
|
|
19
19
|
"minimatch": "~3.0.5"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"cli": {
|
|
29
29
|
"webpack": false
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "c52e188a1217df74052774a2eea6a5126089e3d5"
|
|
32
32
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export type { Folder, RootFolder } from './folderSchema';
|
|
2
|
+
export { checkPath } from './folderSchema';
|
|
2
3
|
|
|
3
4
|
export { NamingConvention } from './namingConvention';
|
|
4
5
|
|
|
5
|
-
export { Failure
|
|
6
|
+
export type { Failure } from './failures';
|
|
7
|
+
export { printFailure } from './failures';
|