typeomatica 0.3.39 → 0.3.57
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/README.md +365 -19
- package/lib/errors.js +7 -7
- package/lib/fields.d.ts +5 -5
- package/lib/fields.js +21 -20
- package/lib/index.d.ts +10 -8
- package/lib/index.js +224 -130
- package/lib/types/functions.js +4 -4
- package/lib/types/index.js +16 -16
- package/lib/types/nullish.js +12 -12
- package/lib/types/objects.js +16 -16
- package/lib/types/primitives.js +45 -45
- package/lib/types/special.js +16 -16
- package/package.json +33 -15
- package/.editorconfig +0 -11
- package/.eslintignore +0 -0
- package/.eslintrc.js +0 -72
- package/.gitattributes +0 -22
- package/.github/workflows/node.js.yml +0 -62
- package/.husky/pre-commit +0 -4
- package/jest.config.js +0 -12
- package/src/errors.ts +0 -9
- package/src/fields.ts +0 -76
- package/src/index.ts +0 -301
- package/src/types/functions.ts +0 -7
- package/src/types/index.ts +0 -17
- package/src/types/nullish.ts +0 -15
- package/src/types/objects.ts +0 -19
- package/src/types/primitives.ts +0 -69
- package/src/types/special.ts +0 -19
- package/test/__snapshots__/index.ts.snap +0 -3
- package/test/index.ts +0 -676
- package/test/noJest.ts +0 -105
- package/tsconfig.jest.json +0 -34
- package/tsconfig.json +0 -31
package/test/noJest.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// BasePrototype & BaseClass are the same function
|
|
3
|
-
// go as you want for being meaningfull
|
|
4
|
-
// or meaningless
|
|
5
|
-
const BasePrototype = require('..');
|
|
6
|
-
import { BaseClass, Strict } from '..';
|
|
7
|
-
|
|
8
|
-
interface IBase {
|
|
9
|
-
get getterField(): string
|
|
10
|
-
// eslint-disable-next-line no-unused-vars
|
|
11
|
-
set setterField(value: string)
|
|
12
|
-
numberValue: number
|
|
13
|
-
stringValue: string
|
|
14
|
-
booleanValue: boolean
|
|
15
|
-
objectValue: object
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
// eslint-disable-next-line new-cap
|
|
21
|
-
@Strict({ someProp: 123 })
|
|
22
|
-
class DecoratedByBase {
|
|
23
|
-
someProp!: number;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
class ExtendedDecoratedByBase extends DecoratedByBase {
|
|
27
|
-
someProp: number;
|
|
28
|
-
constructor() {
|
|
29
|
-
super();
|
|
30
|
-
this.someProp = 321;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// eslint-disable-next-line new-cap
|
|
35
|
-
class Base extends BasePrototype({
|
|
36
|
-
additionalProp: 321,
|
|
37
|
-
someMethod() {
|
|
38
|
-
return this.numberValue.valueOf();
|
|
39
|
-
},
|
|
40
|
-
}) implements IBase {
|
|
41
|
-
numberValue = 123;
|
|
42
|
-
stringValue: string;
|
|
43
|
-
booleanValue: boolean;
|
|
44
|
-
objectValue: object;
|
|
45
|
-
|
|
46
|
-
get getterField() {
|
|
47
|
-
const answer = `${this.stringValue}`;
|
|
48
|
-
return answer;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
set setterField(value: string) {
|
|
52
|
-
this.stringValue = value;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
constructor() {
|
|
56
|
-
super();
|
|
57
|
-
debugger;
|
|
58
|
-
this.stringValue = '123';
|
|
59
|
-
this.booleanValue = true;
|
|
60
|
-
this.objectValue = {};
|
|
61
|
-
// ES2022
|
|
62
|
-
// Object.defineProperty(this, 'getterField', {
|
|
63
|
-
// get() {
|
|
64
|
-
// const answer = `${this.stringValue}`;
|
|
65
|
-
// return answer;
|
|
66
|
-
// }
|
|
67
|
-
// });
|
|
68
|
-
// Object.defineProperty(this, 'setterField', {
|
|
69
|
-
// set(value: string) {
|
|
70
|
-
// this.stringValue = value;
|
|
71
|
-
// }
|
|
72
|
-
// });
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
debugger;
|
|
76
|
-
const baseInstance = new Base;
|
|
77
|
-
console.log(baseInstance);
|
|
78
|
-
debugger;
|
|
79
|
-
|
|
80
|
-
const upperInstance = Object.create(baseInstance);
|
|
81
|
-
console.log(upperInstance);
|
|
82
|
-
|
|
83
|
-
class SimpleBase extends BaseClass {
|
|
84
|
-
stringProp = '123';
|
|
85
|
-
// ES2022
|
|
86
|
-
// stringProp: string;
|
|
87
|
-
// constructor() {
|
|
88
|
-
// super();
|
|
89
|
-
// this.stringProp = '123';
|
|
90
|
-
// }
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
debugger;
|
|
94
|
-
const simpleInstance = new SimpleBase;
|
|
95
|
-
console.log(simpleInstance);
|
|
96
|
-
|
|
97
|
-
debugger;
|
|
98
|
-
const decorated = new DecoratedByBase;
|
|
99
|
-
console.log(decorated);
|
|
100
|
-
|
|
101
|
-
debugger;
|
|
102
|
-
const exdecorated = new ExtendedDecoratedByBase;
|
|
103
|
-
console.log(exdecorated);
|
|
104
|
-
|
|
105
|
-
debugger;
|
package/tsconfig.jest.json
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"target": "es2023",
|
|
5
|
-
"strict": true,
|
|
6
|
-
"alwaysStrict": true,
|
|
7
|
-
"strictFunctionTypes": true,
|
|
8
|
-
"diagnostics": true,
|
|
9
|
-
"noImplicitThis": true,
|
|
10
|
-
"extendedDiagnostics": true,
|
|
11
|
-
"noImplicitReturns": true,
|
|
12
|
-
"noFallthroughCasesInSwitch": true,
|
|
13
|
-
"noUnusedLocals": true,
|
|
14
|
-
"noUnusedParameters": true,
|
|
15
|
-
"declaration": true,
|
|
16
|
-
"inlineSourceMap": true,
|
|
17
|
-
"traceResolution": false,
|
|
18
|
-
"removeComments": true,
|
|
19
|
-
"experimentalDecorators": true,
|
|
20
|
-
"forceConsistentCasingInFileNames": true,
|
|
21
|
-
"types": [
|
|
22
|
-
"jest",
|
|
23
|
-
"node"
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
|
-
"include": [
|
|
27
|
-
"./test/**/*.ts"
|
|
28
|
-
],
|
|
29
|
-
"exclude": [
|
|
30
|
-
"./lib/**/*",
|
|
31
|
-
"./coverage/**/*",
|
|
32
|
-
"./node_modules/**/*",
|
|
33
|
-
]
|
|
34
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"target": "es6",
|
|
5
|
-
"strict": true,
|
|
6
|
-
"alwaysStrict": true,
|
|
7
|
-
"strictFunctionTypes": true,
|
|
8
|
-
"diagnostics": true,
|
|
9
|
-
"noImplicitThis": true,
|
|
10
|
-
"extendedDiagnostics": true,
|
|
11
|
-
"noImplicitReturns": true,
|
|
12
|
-
"noFallthroughCasesInSwitch": true,
|
|
13
|
-
"noUnusedLocals": true,
|
|
14
|
-
"noUnusedParameters": true,
|
|
15
|
-
"declaration": true,
|
|
16
|
-
"inlineSourceMap": true,
|
|
17
|
-
"outDir": "lib",
|
|
18
|
-
"traceResolution": false,
|
|
19
|
-
"removeComments": true,
|
|
20
|
-
"experimentalDecorators": true,
|
|
21
|
-
"forceConsistentCasingInFileNames": true,
|
|
22
|
-
"types": ["node"]
|
|
23
|
-
},
|
|
24
|
-
"include": [
|
|
25
|
-
"./src/**/*.ts",
|
|
26
|
-
],
|
|
27
|
-
"exclude": [
|
|
28
|
-
"./lib/**/*",
|
|
29
|
-
"./coverage/**/*",
|
|
30
|
-
]
|
|
31
|
-
}
|