@webergency-utils/typechecker 0.1.9 → 0.2.1
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/LICENSE +1 -1
- package/README.md +307 -277
- package/dist/engine/generators.d.ts +2 -1
- package/dist/engine/generators.js +37 -11
- package/dist/engine/resolver.js +279 -68
- package/dist/engine/staticAsserts.js +3 -2
- package/dist/index.d.ts +12 -6
- package/dist/index.js +19 -0
- package/dist/plugin.d.ts +7 -0
- package/dist/plugin.js +30 -0
- package/dist/runtime/casing.d.ts +3 -3
- package/dist/runtime/casing.js +4 -4
- package/dist/runtime/tags/format.d.ts +7 -0
- package/dist/runtime/tags/tag.d.ts +1 -1
- package/dist/runtime/tags.d.ts +1 -1
- package/dist/runtime/validators.d.ts +34 -10
- package/dist/runtime/validators.js +915 -212
- package/dist/transformer.js +5 -1
- package/package.json +21 -6
package/dist/transformer.js
CHANGED
|
@@ -87,10 +87,14 @@ export default function transformer(program) {
|
|
|
87
87
|
const mdStoreAccess = ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier('MetadataStore'), 'is');
|
|
88
88
|
return ts.factory.createCallExpression(mdStoreAccess, undefined, [getCall, arg0, arg1]);
|
|
89
89
|
}
|
|
90
|
-
else if (fnName === 'assert'
|
|
90
|
+
else if (fnName === 'assert') {
|
|
91
91
|
const mdStoreAccess = ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier('MetadataStore'), 'assert');
|
|
92
92
|
return ts.factory.createCallExpression(mdStoreAccess, undefined, [getCall, arg0, arg1]);
|
|
93
93
|
}
|
|
94
|
+
else if (fnName === 'assertGuard') {
|
|
95
|
+
const mdStoreAccess = ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier('MetadataStore'), 'assertGuard');
|
|
96
|
+
return ts.factory.createCallExpression(mdStoreAccess, undefined, [getCall, arg0, arg1]);
|
|
97
|
+
}
|
|
94
98
|
}
|
|
95
99
|
}
|
|
96
100
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webergency-utils/typechecker",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "TypeScript compiler plugin for runtime validation",
|
|
6
6
|
"author": "radixxko",
|
|
7
|
+
"license": "MIT",
|
|
7
8
|
"main": "dist/index.js",
|
|
8
9
|
"types": "dist/index.d.ts",
|
|
9
10
|
"exports": {
|
|
@@ -24,18 +25,30 @@
|
|
|
24
25
|
"import": "./dist/transformer.js",
|
|
25
26
|
"require": "./dist/transformer.js",
|
|
26
27
|
"default": "./dist/transformer.js"
|
|
28
|
+
},
|
|
29
|
+
"./plugin": {
|
|
30
|
+
"types": "./dist/plugin.d.ts",
|
|
31
|
+
"import": "./dist/plugin.js",
|
|
32
|
+
"require": "./dist/plugin.js",
|
|
33
|
+
"default": "./dist/plugin.js"
|
|
27
34
|
}
|
|
28
35
|
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
29
39
|
"files": [
|
|
30
40
|
"dist/**/*"
|
|
31
41
|
],
|
|
32
42
|
"scripts": {
|
|
33
43
|
"lint": "eslint .",
|
|
34
|
-
"clean": "rm -rf ./dist/* node_modules package-lock.json && npm i",
|
|
35
|
-
"commit": "node -e \"const version = require('./package.json').version.trim(); require('child_process').execSync('git add . && git commit -m \\\"Version ' + version + '\\\"');\"",
|
|
36
|
-
"build": "npm run clean && tsc && node update_imports.js",
|
|
37
44
|
"test": "vitest run",
|
|
38
|
-
"
|
|
45
|
+
"fuzz": "npm run build:fuzz && jazzer fuzz_typechecker.cjs",
|
|
46
|
+
"coverage": "vitest run --coverage",
|
|
47
|
+
"clean": "rm -rf ./dist ./dist-fuzz",
|
|
48
|
+
"reset": "npm run clean && rm -rf node_modules package-lock.json && npm i",
|
|
49
|
+
"build": "npm run clean && tsc && node update_imports.js",
|
|
50
|
+
"build:fuzz": "esbuild src/fuzz-runtime.ts --bundle --platform=node --format=cjs --outfile=dist-fuzz/runtime.cjs",
|
|
51
|
+
"commit": "node -e \"const version = require('./package.json').version.trim(); require('child_process').execSync('git add . && git commit -m \\\"Version ' + version + '\\\"');\"",
|
|
39
52
|
"version": "npm run build && npm publish --access public && npm run commit && git push"
|
|
40
53
|
},
|
|
41
54
|
"repository": {
|
|
@@ -51,10 +64,12 @@
|
|
|
51
64
|
},
|
|
52
65
|
"devDependencies": {
|
|
53
66
|
"@eslint/js": "^10.0.1",
|
|
67
|
+
"@jazzer.js/core": "^4.0.0",
|
|
54
68
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
55
|
-
"@types/node": "^
|
|
69
|
+
"@types/node": "^26.1.1",
|
|
56
70
|
"@typescript/typescript6": "^6.0.2",
|
|
57
71
|
"@vitest/coverage-v8": "^4.1.6",
|
|
72
|
+
"esbuild": "^0.28.1",
|
|
58
73
|
"eslint": "^10.4.1",
|
|
59
74
|
"typescript": "^6.0.3 || ^7.0.0",
|
|
60
75
|
"typescript-eslint": "^8.60.0",
|