typeomatica 0.3.31 → 0.3.33

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/lib/index.d.ts CHANGED
@@ -6,3 +6,7 @@ export declare const BaseConstructorPrototype: <P extends object, S extends Prot
6
6
  export declare class BaseClass extends BaseConstructorPrototype {
7
7
  }
8
8
  export { FieldConstructor } from './fields';
9
+ type StrictRuntime = {
10
+ <T extends object>(...args: unknown[]): T;
11
+ };
12
+ export declare const Strict: StrictRuntime;
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FieldConstructor = exports.BaseClass = exports.BaseConstructorPrototype = void 0;
3
+ exports.Strict = exports.FieldConstructor = exports.BaseClass = exports.BaseConstructorPrototype = void 0;
4
4
  const errors_1 = require("./errors");
5
5
  const types_1 = require("./types");
6
6
  const fields_1 = require("./fields");
@@ -107,6 +107,9 @@ class BaseClass extends exports.BaseConstructorPrototype {
107
107
  exports.BaseClass = BaseClass;
108
108
  var fields_2 = require("./fields");
109
109
  Object.defineProperty(exports, "FieldConstructor", { enumerable: true, get: function () { return fields_2.FieldConstructor; } });
110
+ exports.Strict = {
111
+ Strict: exports.BaseConstructorPrototype,
112
+ }.Strict;
110
113
  Object.defineProperty(module.exports, 'BaseClass', {
111
114
  get() {
112
115
  return BaseClass;
@@ -119,3 +122,9 @@ Object.defineProperty(module.exports, 'FieldConstructor', {
119
122
  },
120
123
  enumerable: true
121
124
  });
125
+ Object.defineProperty(module.exports, 'Strict', {
126
+ get() {
127
+ return exports.BaseConstructorPrototype;
128
+ },
129
+ enumerable: true
130
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typeomatica",
3
- "version": "0.3.31",
3
+ "version": "0.3.33",
4
4
  "description": "type logic against javascript metaprogramming",
5
5
  "engines": {
6
6
  "node": ">=14"
@@ -30,18 +30,18 @@
30
30
  "url": "git+https://github.com/wentout/typeomatica.git"
31
31
  },
32
32
  "devDependencies": {
33
- "@types/jest": "^29.5.5",
34
- "@types/node": "^18.18.5",
35
- "@typescript-eslint/eslint-plugin": "^6.8.0",
36
- "@typescript-eslint/parser": "^6.8.0",
37
- "eslint": "^8.51.0",
33
+ "@types/jest": "^29.5.12",
34
+ "@types/node": "^18.19.21",
35
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
36
+ "@typescript-eslint/parser": "^6.21.0",
37
+ "eslint": "^8.57.0",
38
38
  "husky": "^8.0.3",
39
39
  "jest": "^29.7.0",
40
40
  "json5": "^2.2.3",
41
41
  "lint-staged": "^13.3.0",
42
42
  "set-value": "^4.1.0",
43
- "ts-jest": "^29.1.1",
44
- "ts-node": "^10.9.1",
45
- "typescript": "^5.2.2"
43
+ "ts-jest": "^29.1.2",
44
+ "ts-node": "^10.9.2",
45
+ "typescript": "^5.3.3"
46
46
  }
47
47
  }
package/src/index.ts CHANGED
@@ -194,6 +194,20 @@ Object.defineProperty(module, 'exports', {
194
194
  export class BaseClass extends BaseConstructorPrototype { }
195
195
  export { FieldConstructor } from './fields';
196
196
 
197
+ type StrictRuntime = {
198
+ // eslint-disable-next-line no-unused-vars
199
+ <T extends object>(...args: unknown[]): T
200
+ }
201
+
202
+ // export const { StrictPrototype, Strict } = {
203
+ export const { Strict } = {
204
+ // StrictPrototype: BaseConstructorPrototype,
205
+ Strict: BaseConstructorPrototype,
206
+ } as {
207
+ // StrictPrototype: StrictRuntime
208
+ Strict: StrictRuntime
209
+ };
210
+
197
211
  Object.defineProperty(module.exports, 'BaseClass', {
198
212
  get() {
199
213
  return BaseClass;
@@ -206,3 +220,15 @@ Object.defineProperty(module.exports, 'FieldConstructor', {
206
220
  },
207
221
  enumerable: true
208
222
  });
223
+ // Object.defineProperty(module.exports, 'StrictPrototype', {
224
+ // get() {
225
+ // return BaseConstructorPrototype;
226
+ // },
227
+ // enumerable: true
228
+ // });
229
+ Object.defineProperty(module.exports, 'Strict', {
230
+ get() {
231
+ return BaseConstructorPrototype;
232
+ },
233
+ enumerable: true
234
+ });
package/test/index.ts CHANGED
@@ -6,7 +6,7 @@ import { describe, expect, test } from '@jest/globals';
6
6
  // go as you want for being meaningfull
7
7
  // or meaningless
8
8
  const BasePrototype = require('..');
9
- import { BaseClass, FieldConstructor } from '..';
9
+ import { BaseClass, FieldConstructor, Strict } from '..';
10
10
 
11
11
  const { SymbolInitialValue } = FieldConstructor;
12
12
 
@@ -26,7 +26,7 @@ let decoratedSomeProp = 0;
26
26
 
27
27
 
28
28
  // eslint-disable-next-line new-cap
29
- @BasePrototype({ someProp: 123 })
29
+ @Strict({ someProp: 123 })
30
30
  class DecoratedByBase {
31
31
  someProp!: number;
32
32
  }