@suseejs/check 0.1.1 → 0.1.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.cjs ADDED
@@ -0,0 +1,203 @@
1
+ "use strict";
2
+ // cSpell:disable
3
+ const path = require("node:path");
4
+ const ts = require("typescript");
5
+ const jsesm_exts = [".js", ".mjs"];
6
+ const jscjs_exts = [".cjs"];
7
+ const tsesm_exts = [".ts", ".mts"];
8
+ const tscjs_exts = [".cts"];
9
+ const jsx_exts = [".jsx", ".tsx"];
10
+ const all_exts = [
11
+ ...jscjs_exts,
12
+ ...jsesm_exts,
13
+ ...tscjs_exts,
14
+ ...tsesm_exts,
15
+ ...jsx_exts,
16
+ ];
17
+ /**
18
+ * Check types of given files and exit process if any errors are found.
19
+ * @param deps List of files to check, where each file is an object with
20
+ * `file` and `content` properties.
21
+ * @param compilerOptions TypeScript compiler options.
22
+ * @returns True if no errors are found, false otherwise.
23
+ */
24
+ function checkTypes(deps, compilerOptions) {
25
+ if (!compilerOptions.noCheck) {
26
+ console.time("types checked");
27
+ const filePaths = deps.map((i) => i.file);
28
+ let _err = false;
29
+ // Create program
30
+ const program = ts.createProgram(filePaths, compilerOptions);
31
+ // Check each file individually for immediate feedback
32
+ for (const filePath of filePaths) {
33
+ const sourceFile = program.getSourceFile(filePath);
34
+ if (!sourceFile) {
35
+ console.error(`File not found: ${path.relative(process.cwd(), filePath)}`);
36
+ process.exit(1);
37
+ }
38
+ const diagnostics = [
39
+ ...program.getSyntacticDiagnostics(sourceFile),
40
+ ...program.getSemanticDiagnostics(sourceFile),
41
+ ...program.getDeclarationDiagnostics(sourceFile),
42
+ ];
43
+ if (diagnostics.length > 0) {
44
+ const formatHost = {
45
+ getCurrentDirectory: () => process.cwd(),
46
+ getCanonicalFileName: (fileName) => fileName,
47
+ getNewLine: () => ts.sys.newLine,
48
+ };
49
+ console.error(ts.formatDiagnosticsWithColorAndContext(diagnostics, formatHost));
50
+ _err = true;
51
+ }
52
+ }
53
+ if (_err) {
54
+ process.exit(1);
55
+ }
56
+ else {
57
+ console.timeEnd("types checked");
58
+ return true;
59
+ }
60
+ }
61
+ }
62
+ /**
63
+ * Check the file extensions of given dependencies.
64
+ * @param deps List of files to check, where each file is an object with
65
+ * `file` and `content` properties.
66
+ * @returns True if no unsupported file extensions are found, false otherwise.
67
+ * @throws If unsupported file extensions are found, the function will throw an error and exit the process.
68
+ */
69
+ function checkExtGroup(deps) {
70
+ const exts = deps.map((dep) => {
71
+ return path.extname(dep.file);
72
+ });
73
+ const jsesmSet = new Set(jsesm_exts);
74
+ const jscjsSet = new Set(jscjs_exts);
75
+ const tsesmSet = new Set(tsesm_exts);
76
+ const tscjsSet = new Set(tscjs_exts);
77
+ const jsxSet = new Set(jsx_exts);
78
+ const allSet = new Set(all_exts);
79
+ const isCjs = exts.every((i) => jscjsSet.has(i)) || exts.every((i) => tscjsSet.has(i));
80
+ const isJsx = exts.every((i) => jsxSet.has(i));
81
+ const isJs = exts.every((i) => jsesmSet.has(i));
82
+ const isTs = exts.every((i) => tsesmSet.has(i));
83
+ const isBoth = isJs && isTs;
84
+ const isNone = !exts.every((i) => allSet.has(i));
85
+ if (isNone) {
86
+ console.warn("Bundler detects none Javascript or Typescript extensions in the dependencies tree.");
87
+ process.exit(1);
88
+ }
89
+ if (isJsx) {
90
+ console.warn("The package detects JSX extensions (.jsx or .tsx) in the dependencies tree, which is currently unsupported.");
91
+ process.exit(1);
92
+ }
93
+ if (isCjs) {
94
+ console.warn("The package detects commonjs extensions (.cjd or .cts) in the dependencies tree, which is currently unsupported.");
95
+ process.exit(1);
96
+ }
97
+ if (isBoth) {
98
+ console.warn("The package detects both Javascript or Typescript extensions in the dependencies tree, currently unsupported.");
99
+ process.exit(1);
100
+ }
101
+ return true;
102
+ }
103
+ /**
104
+ * Check the module format of all the given files.
105
+ * @param deps List of files to check, where each file is an object with
106
+ * `file` and `content` properties.
107
+ * @returns True if the function finishes without errors, false otherwise.
108
+ */
109
+ function checkModuleFormat(deps) {
110
+ let _esmCount = 0;
111
+ let cjsCount = 0;
112
+ let unknowCount = 0;
113
+ for (const dep of deps) {
114
+ try {
115
+ // Create a TypeScript source file
116
+ const sourceFile = ts.createSourceFile(dep.file, dep.content, ts.ScriptTarget.Latest, true);
117
+ let hasESMImports = false;
118
+ let hasCommonJS = false;
119
+ // Walk through the AST to detect module syntax
120
+ function walk(node) {
121
+ // Check for ESM import/export syntax
122
+ if (ts.isImportDeclaration(node) ||
123
+ ts.isImportEqualsDeclaration(node) ||
124
+ ts.isExportDeclaration(node) ||
125
+ ts.isExportSpecifier(node) ||
126
+ ts.isExportAssignment(node)) {
127
+ hasESMImports = true;
128
+ }
129
+ // Check for export modifier on declarations
130
+ if ((ts.isVariableStatement(node) ||
131
+ ts.isFunctionDeclaration(node) ||
132
+ ts.isInterfaceDeclaration(node) ||
133
+ ts.isTypeAliasDeclaration(node) ||
134
+ ts.isEnumDeclaration(node) ||
135
+ ts.isClassDeclaration(node)) &&
136
+ node.modifiers?.some((mod) => mod.kind === ts.SyntaxKind.ExportKeyword)) {
137
+ hasESMImports = true;
138
+ }
139
+ // Check for CommonJS require/exports
140
+ if (ts.isCallExpression(node)) {
141
+ if (ts.isIdentifier(node.expression) &&
142
+ node.expression.text === "require" &&
143
+ node.arguments.length > 0) {
144
+ hasCommonJS = true;
145
+ }
146
+ }
147
+ // Check for module.exports or exports.xxx
148
+ if (ts.isPropertyAccessExpression(node)) {
149
+ const text = node.getText(sourceFile);
150
+ if (text.startsWith("module.exports") ||
151
+ text.startsWith("exports.")) {
152
+ hasCommonJS = true;
153
+ }
154
+ }
155
+ // Continue walking the AST
156
+ ts.forEachChild(node, walk);
157
+ }
158
+ walk(sourceFile);
159
+ // Determine the module format based on what we found
160
+ if (hasESMImports && !hasCommonJS) {
161
+ _esmCount++;
162
+ }
163
+ else if (hasCommonJS && !hasESMImports) {
164
+ cjsCount++;
165
+ }
166
+ else if (hasESMImports && hasCommonJS) {
167
+ // Mixed - probably ESM with dynamic imports or similar
168
+ _esmCount++;
169
+ }
170
+ }
171
+ catch (error) {
172
+ console.error(`Error checking module format for ${dep.file} : \n ${error}`);
173
+ unknowCount++;
174
+ }
175
+ } // loop
176
+ if (unknowCount) {
177
+ console.warn("Unknown error when checking module types in the dependencies tree.");
178
+ process.exit(1);
179
+ }
180
+ if (cjsCount) {
181
+ console.warn("The package detects CommonJs format in the dependencies tree, currently unsupported.");
182
+ process.exit(1);
183
+ }
184
+ return true;
185
+ }
186
+ /**
187
+ * Check if all files in the given list have the same file extension and
188
+ * the same module format.
189
+ * @param deps List of files to check, where each file is an object with
190
+ * `file` and `content` properties.
191
+ * @returns True if all files have the same file extension and module format,
192
+ * false otherwise.
193
+ */
194
+ function fileExtensionAndFormat(deps) {
195
+ console.time("checked extension and module");
196
+ const ce = checkExtGroup(deps);
197
+ const cm = checkModuleFormat(deps);
198
+ console.timeEnd("checked extension and module");
199
+ return ce && cm;
200
+ }
201
+ const check = { checkTypes, fileExtensionAndFormat };
202
+ module.exports = check;
203
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.cts"],"names":[],"mappings":";AAAA,iBAAiB;AACjB,kCAAmC;AACnC,iCAAkC;AAOlC,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACnC,MAAM,UAAU,GAAG,CAAC,MAAM,CAAC,CAAC;AAC5B,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACnC,MAAM,UAAU,GAAG,CAAC,MAAM,CAAC,CAAC;AAC5B,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAClC,MAAM,QAAQ,GAAG;IACf,GAAG,UAAU;IACb,GAAG,UAAU;IACb,GAAG,UAAU;IACb,GAAG,UAAU;IACb,GAAG,QAAQ;CACZ,CAAC;AAEF;;;;;;GAMG;AACH,SA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,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CACV,uFAAuF,CACxF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,sBAAsB,CAAC,IAAgB;IAC9C,OAAO,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;IAC7C,MAAM,EAAE,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,EAAE,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACnC,OAAO,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAChD,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC;AAED,MAAM,KAAK,GAAG,EAAE,UAAU,EAAE,sBAAsB,EAAE,CAAC;AAErD,iBAAS,KAAK,CAAC"}
@@ -0,0 +1,28 @@
1
+ import ts = require("typescript");
2
+ interface DepsFile {
3
+ file: string;
4
+ content: string;
5
+ }
6
+ /**
7
+ * Check types of given files and exit process if any errors are found.
8
+ * @param deps List of files to check, where each file is an object with
9
+ * `file` and `content` properties.
10
+ * @param compilerOptions TypeScript compiler options.
11
+ * @returns True if no errors are found, false otherwise.
12
+ */
13
+ declare function checkTypes(deps: DepsFile[], compilerOptions: ts.CompilerOptions): true | undefined;
14
+ /**
15
+ * Check if all files in the given list have the same file extension and
16
+ * the same module format.
17
+ * @param deps List of files to check, where each file is an object with
18
+ * `file` and `content` properties.
19
+ * @returns True if all files have the same file extension and module format,
20
+ * false otherwise.
21
+ */
22
+ declare function fileExtensionAndFormat(deps: DepsFile[]): boolean;
23
+ declare const check: {
24
+ checkTypes: typeof checkTypes;
25
+ fileExtensionAndFormat: typeof fileExtensionAndFormat;
26
+ };
27
+ export = check;
28
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.cts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,QAAQ,YAAY,CAAC,CAAC;AAElC,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAeD;;;;;;GAMG;AACH,iBAAS,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,eAAe,EAAE,EAAE,CAAC,eAAe,oBA0CxE;AAkKD;;;;;;;GAOG;AACH,iBAAS,sBAAsB,CAAC,IAAI,EAAE,QAAQ,EAAE,WAM/C;AAED,QAAA,MAAM,KAAK;;;CAAyC,CAAC;AAErD,SAAS,KAAK,CAAC"}
@@ -0,0 +1,28 @@
1
+ import ts from "typescript";
2
+ interface DepsFile {
3
+ file: string;
4
+ content: string;
5
+ }
6
+ /**
7
+ * Check types of given files and exit process if any errors are found.
8
+ * @param deps List of files to check, where each file is an object with
9
+ * `file` and `content` properties.
10
+ * @param compilerOptions TypeScript compiler options.
11
+ * @returns True if no errors are found, false otherwise.
12
+ */
13
+ declare function checkTypes(deps: DepsFile[], compilerOptions: ts.CompilerOptions): true | undefined;
14
+ /**
15
+ * Check if all files in the given list have the same file extension and
16
+ * the same module format.
17
+ * @param deps List of files to check, where each file is an object with
18
+ * `file` and `content` properties.
19
+ * @returns True if all files have the same file extension and module format,
20
+ * false otherwise.
21
+ */
22
+ declare function fileExtensionAndFormat(deps: DepsFile[]): boolean;
23
+ declare const check: {
24
+ checkTypes: typeof checkTypes;
25
+ fileExtensionAndFormat: typeof fileExtensionAndFormat;
26
+ };
27
+ export default check;
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAeD;;;;;;GAMG;AACH,iBAAS,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,eAAe,EAAE,EAAE,CAAC,eAAe,oBA0CxE;AAkKD;;;;;;;GAOG;AACH,iBAAS,sBAAsB,CAAC,IAAI,EAAE,QAAQ,EAAE,WAM/C;AAED,QAAA,MAAM,KAAK;;;CAAyC,CAAC;AAErD,eAAe,KAAK,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,202 @@
1
+ // cSpell:disable
2
+ import path from "node:path";
3
+ import ts from "typescript";
4
+ const jsesm_exts = [".js", ".mjs"];
5
+ const jscjs_exts = [".cjs"];
6
+ const tsesm_exts = [".ts", ".mts"];
7
+ const tscjs_exts = [".cts"];
8
+ const jsx_exts = [".jsx", ".tsx"];
9
+ const all_exts = [
10
+ ...jscjs_exts,
11
+ ...jsesm_exts,
12
+ ...tscjs_exts,
13
+ ...tsesm_exts,
14
+ ...jsx_exts,
15
+ ];
16
+ /**
17
+ * Check types of given files and exit process if any errors are found.
18
+ * @param deps List of files to check, where each file is an object with
19
+ * `file` and `content` properties.
20
+ * @param compilerOptions TypeScript compiler options.
21
+ * @returns True if no errors are found, false otherwise.
22
+ */
23
+ function checkTypes(deps, compilerOptions) {
24
+ if (!compilerOptions.noCheck) {
25
+ console.time("types checked");
26
+ const filePaths = deps.map((i) => i.file);
27
+ let _err = false;
28
+ // Create program
29
+ const program = ts.createProgram(filePaths, compilerOptions);
30
+ // Check each file individually for immediate feedback
31
+ for (const filePath of filePaths) {
32
+ const sourceFile = program.getSourceFile(filePath);
33
+ if (!sourceFile) {
34
+ console.error(`File not found: ${path.relative(process.cwd(), filePath)}`);
35
+ process.exit(1);
36
+ }
37
+ const diagnostics = [
38
+ ...program.getSyntacticDiagnostics(sourceFile),
39
+ ...program.getSemanticDiagnostics(sourceFile),
40
+ ...program.getDeclarationDiagnostics(sourceFile),
41
+ ];
42
+ if (diagnostics.length > 0) {
43
+ const formatHost = {
44
+ getCurrentDirectory: () => process.cwd(),
45
+ getCanonicalFileName: (fileName) => fileName,
46
+ getNewLine: () => ts.sys.newLine,
47
+ };
48
+ console.error(ts.formatDiagnosticsWithColorAndContext(diagnostics, formatHost));
49
+ _err = true;
50
+ }
51
+ }
52
+ if (_err) {
53
+ process.exit(1);
54
+ }
55
+ else {
56
+ console.timeEnd("types checked");
57
+ return true;
58
+ }
59
+ }
60
+ }
61
+ /**
62
+ * Check the file extensions of given dependencies.
63
+ * @param deps List of files to check, where each file is an object with
64
+ * `file` and `content` properties.
65
+ * @returns True if no unsupported file extensions are found, false otherwise.
66
+ * @throws If unsupported file extensions are found, the function will throw an error and exit the process.
67
+ */
68
+ function checkExtGroup(deps) {
69
+ const exts = deps.map((dep) => {
70
+ return path.extname(dep.file);
71
+ });
72
+ const jsesmSet = new Set(jsesm_exts);
73
+ const jscjsSet = new Set(jscjs_exts);
74
+ const tsesmSet = new Set(tsesm_exts);
75
+ const tscjsSet = new Set(tscjs_exts);
76
+ const jsxSet = new Set(jsx_exts);
77
+ const allSet = new Set(all_exts);
78
+ const isCjs = exts.every((i) => jscjsSet.has(i)) || exts.every((i) => tscjsSet.has(i));
79
+ const isJsx = exts.every((i) => jsxSet.has(i));
80
+ const isJs = exts.every((i) => jsesmSet.has(i));
81
+ const isTs = exts.every((i) => tsesmSet.has(i));
82
+ const isBoth = isJs && isTs;
83
+ const isNone = !exts.every((i) => allSet.has(i));
84
+ if (isNone) {
85
+ console.warn("Bundler detects none Javascript or Typescript extensions in the dependencies tree.");
86
+ process.exit(1);
87
+ }
88
+ if (isJsx) {
89
+ console.warn("The package detects JSX extensions (.jsx or .tsx) in the dependencies tree, which is currently unsupported.");
90
+ process.exit(1);
91
+ }
92
+ if (isCjs) {
93
+ console.warn("The package detects commonjs extensions (.cjd or .cts) in the dependencies tree, which is currently unsupported.");
94
+ process.exit(1);
95
+ }
96
+ if (isBoth) {
97
+ console.warn("The package detects both Javascript or Typescript extensions in the dependencies tree, currently unsupported.");
98
+ process.exit(1);
99
+ }
100
+ return true;
101
+ }
102
+ /**
103
+ * Check the module format of all the given files.
104
+ * @param deps List of files to check, where each file is an object with
105
+ * `file` and `content` properties.
106
+ * @returns True if the function finishes without errors, false otherwise.
107
+ */
108
+ function checkModuleFormat(deps) {
109
+ let _esmCount = 0;
110
+ let cjsCount = 0;
111
+ let unknowCount = 0;
112
+ for (const dep of deps) {
113
+ try {
114
+ // Create a TypeScript source file
115
+ const sourceFile = ts.createSourceFile(dep.file, dep.content, ts.ScriptTarget.Latest, true);
116
+ let hasESMImports = false;
117
+ let hasCommonJS = false;
118
+ // Walk through the AST to detect module syntax
119
+ function walk(node) {
120
+ // Check for ESM import/export syntax
121
+ if (ts.isImportDeclaration(node) ||
122
+ ts.isImportEqualsDeclaration(node) ||
123
+ ts.isExportDeclaration(node) ||
124
+ ts.isExportSpecifier(node) ||
125
+ ts.isExportAssignment(node)) {
126
+ hasESMImports = true;
127
+ }
128
+ // Check for export modifier on declarations
129
+ if ((ts.isVariableStatement(node) ||
130
+ ts.isFunctionDeclaration(node) ||
131
+ ts.isInterfaceDeclaration(node) ||
132
+ ts.isTypeAliasDeclaration(node) ||
133
+ ts.isEnumDeclaration(node) ||
134
+ ts.isClassDeclaration(node)) &&
135
+ node.modifiers?.some((mod) => mod.kind === ts.SyntaxKind.ExportKeyword)) {
136
+ hasESMImports = true;
137
+ }
138
+ // Check for CommonJS require/exports
139
+ if (ts.isCallExpression(node)) {
140
+ if (ts.isIdentifier(node.expression) &&
141
+ node.expression.text === "require" &&
142
+ node.arguments.length > 0) {
143
+ hasCommonJS = true;
144
+ }
145
+ }
146
+ // Check for module.exports or exports.xxx
147
+ if (ts.isPropertyAccessExpression(node)) {
148
+ const text = node.getText(sourceFile);
149
+ if (text.startsWith("module.exports") ||
150
+ text.startsWith("exports.")) {
151
+ hasCommonJS = true;
152
+ }
153
+ }
154
+ // Continue walking the AST
155
+ ts.forEachChild(node, walk);
156
+ }
157
+ walk(sourceFile);
158
+ // Determine the module format based on what we found
159
+ if (hasESMImports && !hasCommonJS) {
160
+ _esmCount++;
161
+ }
162
+ else if (hasCommonJS && !hasESMImports) {
163
+ cjsCount++;
164
+ }
165
+ else if (hasESMImports && hasCommonJS) {
166
+ // Mixed - probably ESM with dynamic imports or similar
167
+ _esmCount++;
168
+ }
169
+ }
170
+ catch (error) {
171
+ console.error(`Error checking module format for ${dep.file} : \n ${error}`);
172
+ unknowCount++;
173
+ }
174
+ } // loop
175
+ if (unknowCount) {
176
+ console.warn("Unknown error when checking module types in the dependencies tree.");
177
+ process.exit(1);
178
+ }
179
+ if (cjsCount) {
180
+ console.warn("The package detects CommonJs format in the dependencies tree, currently unsupported.");
181
+ process.exit(1);
182
+ }
183
+ return true;
184
+ }
185
+ /**
186
+ * Check if all files in the given list have the same file extension and
187
+ * the same module format.
188
+ * @param deps List of files to check, where each file is an object with
189
+ * `file` and `content` properties.
190
+ * @returns True if all files have the same file extension and module format,
191
+ * false otherwise.
192
+ */
193
+ function fileExtensionAndFormat(deps) {
194
+ console.time("checked extension and module");
195
+ const ce = checkExtGroup(deps);
196
+ const cm = checkModuleFormat(deps);
197
+ console.timeEnd("checked extension and module");
198
+ return ce && cm;
199
+ }
200
+ const check = { checkTypes, fileExtensionAndFormat };
201
+ export default check;
202
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iBAAiB;AACjB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,YAAY,CAAC;AAO5B,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACnC,MAAM,UAAU,GAAG,CAAC,MAAM,CAAC,CAAC;AAC5B,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACnC,MAAM,UAAU,GAAG,CAAC,MAAM,CAAC,CAAC;AAC5B,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAA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H,CAAC,CAAC,OAAO;IACT,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,CAAC,IAAI,CACV,oEAAoE,CACrE,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CACV,uFAAuF,CACxF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,sBAAsB,CAAC,IAAgB;IAC9C,OAAO,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;IAC7C,MAAM,EAAE,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,EAAE,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACnC,OAAO,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAChD,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC;AAED,MAAM,KAAK,GAAG,EAAE,UAAU,EAAE,sBAAsB,EAAE,CAAC;AAErD,eAAe,KAAK,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suseejs/check",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Types check",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",