@tsdotnet/reflection 1.1.12 → 1.1.13

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 CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 electricessence (Oren F.)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2021 electricessence (Oren F.)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,94 +1,93 @@
1
- # ![alt text](https://avatars1.githubusercontent.com/u/64487547?s=30 "tsdotnet") tsdotnet / reflection
2
-
3
- [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/tsdotnet/reflection/blob/master/LICENSE)
4
- ![npm-publish](https://github.com/tsdotnet/reflection/workflows/npm-publish/badge.svg)
5
- [![npm version](https://img.shields.io/npm/v/@tsdotnet/reflection.svg?style=flat-square)](https://www.npmjs.com/package/@tsdotnet/reflection)
6
-
7
- A set of classes and utilities for JavaScript type inspection and validation.
8
-
9
- ## Docs
10
-
11
- [tsdotnet.github.io/reflection](https://tsdotnet.github.io/reflection/)
12
-
13
- ## `TypeValidator<T>`
14
-
15
- ### Benefits
16
-
17
- - Allows for run-time validation and checking of dynamic types as well as integrated **type-guarding**.
18
- - Super easy to use, basically only requires a copy paste.
19
- - Works with literals!
20
-
21
- ### Usage
22
-
23
- #### Step 1: Declare the expected type/interface.
24
-
25
- ```typescript
26
- interface MyType
27
- {
28
- a: object;
29
- b: string;
30
- c: number;
31
- d: boolean;
32
- e: {
33
- f: string;
34
- g: boolean;
35
- h: [
36
- number,
37
- boolean,
38
- string
39
- ];
40
- };
41
- }
42
- ```
43
-
44
- #### Step 2: Copy the interface as an actual object and `<type>` the validator
45
-
46
- The following can be done with pure JavaScript and still work.
47
-
48
- ```typescript
49
- const myTypeValidator = new TypeValidator<MyType>(
50
- {
51
- a: Object,
52
- b: String,
53
- c: Number,
54
- d: Boolean,
55
- e: {
56
- f: String,
57
- g: Boolean,
58
- h: [
59
- Number,
60
- Boolean,
61
- String
62
- ]
63
- }
64
- });
65
- ```
66
-
67
- #### Step 3: validate as many times as you want:
68
-
69
- ```typescript
70
- const myItem = {
71
- a: {},
72
- b: 'hello',
73
- c: 1,
74
- d: true,
75
- e: {
76
- f: 'whatever',
77
- g: false,
78
- h: [
79
- 0,
80
- true,
81
- '2'
82
- ]
83
- },
84
- i: 'noise'
85
- };
86
-
87
- // no compile-time type errors!
88
- if (MyTypeValidator.isSubsetOf(myItem)) {
89
- console.log(myItem.e.h.length); // 3
90
- console.log(myItem.b); // "hello"
91
- } else {
92
- throw new TypeError('Invalid type!');
93
- }
94
- ```
1
+ # ![alt text](https://avatars1.githubusercontent.com/u/64487547?s=30 "tsdotnet") tsdotnet / reflection
2
+
3
+ [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/tsdotnet/reflection/blob/master/LICENSE)
4
+ [![npm version](https://img.shields.io/npm/v/@tsdotnet/reflection.svg?style=flat-square)](https://www.npmjs.com/package/@tsdotnet/reflection)
5
+
6
+ A set of classes and utilities for JavaScript type inspection and validation.
7
+
8
+ ## Docs
9
+
10
+ [tsdotnet.github.io/reflection](https://tsdotnet.github.io/reflection/)
11
+
12
+ ## `TypeValidator<T>`
13
+
14
+ ### Benefits
15
+
16
+ - Allows for run-time validation and checking of dynamic types as well as integrated **type-guarding**.
17
+ - Super easy to use, basically only requires a copy paste.
18
+ - Works with literals!
19
+
20
+ ### Usage
21
+
22
+ #### Step 1: Declare the expected type/interface.
23
+
24
+ ```typescript
25
+ interface MyType
26
+ {
27
+ a: object;
28
+ b: string;
29
+ c: number;
30
+ d: boolean;
31
+ e: {
32
+ f: string;
33
+ g: boolean;
34
+ h: [
35
+ number,
36
+ boolean,
37
+ string
38
+ ];
39
+ };
40
+ }
41
+ ```
42
+
43
+ #### Step 2: Copy the interface as an actual object and `<type>` the validator
44
+
45
+ The following can be done with pure JavaScript and still work.
46
+
47
+ ```typescript
48
+ const myTypeValidator = new TypeValidator<MyType>(
49
+ {
50
+ a: Object,
51
+ b: String,
52
+ c: Number,
53
+ d: Boolean,
54
+ e: {
55
+ f: String,
56
+ g: Boolean,
57
+ h: [
58
+ Number,
59
+ Boolean,
60
+ String
61
+ ]
62
+ }
63
+ });
64
+ ```
65
+
66
+ #### Step 3: validate as many times as you want:
67
+
68
+ ```typescript
69
+ const myItem = {
70
+ a: {},
71
+ b: 'hello',
72
+ c: 1,
73
+ d: true,
74
+ e: {
75
+ f: 'whatever',
76
+ g: false,
77
+ h: [
78
+ 0,
79
+ true,
80
+ '2'
81
+ ]
82
+ },
83
+ i: 'noise'
84
+ };
85
+
86
+ // no compile-time type errors!
87
+ if (MyTypeValidator.isSubsetOf(myItem)) {
88
+ console.log(myItem.e.h.length); // 3
89
+ console.log(myItem.b); // "hello"
90
+ } else {
91
+ throw new TypeError('Invalid type!');
92
+ }
93
+ ```
@@ -6,11 +6,11 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.TypeInfoHelper = exports.TypeInfo = exports.typeInfo = void 0;
8
8
  const tslib_1 = require("tslib");
9
- const TypeInfo_1 = tslib_1.__importStar(require("./TypeInfo"));
10
- exports.typeInfo = TypeInfo_1.default;
11
- Object.defineProperty(exports, "TypeInfo", { enumerable: true, get: function () { return TypeInfo_1.TypeInfo; } });
9
+ const TypeInfo_js_1 = tslib_1.__importStar(require("./TypeInfo.js"));
10
+ exports.typeInfo = TypeInfo_js_1.default;
11
+ Object.defineProperty(exports, "TypeInfo", { enumerable: true, get: function () { return TypeInfo_js_1.TypeInfo; } });
12
12
  const compare_1 = require("@tsdotnet/compare");
13
- class TypeInfoHelper extends TypeInfo_1.TypeInfo {
13
+ class TypeInfoHelper extends TypeInfo_js_1.TypeInfo {
14
14
  contains(descriptor) {
15
15
  const value = this.target;
16
16
  if (value === descriptor)
@@ -1 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C,IAAI,CAAC,eAAe,CAAC,CAAC;IAC7D,CAAC;CACD;AAhBD,gCAgBC;AAGD,SAAS,UAAU,CAAE,CAAM,EAAE,CAAM;IAElC,IAAG,CAAC,IAAA,kBAAQ,EAAC,CAAC,EAAE,CAAC,CAAC,EAClB,CAAC;QACA,MAAM,UAAU,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC;QACzC,IAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;IACzC,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * @author electricessence / https://github.com/electricessence/
3
3
  * @license MIT
4
4
  */
5
- import typeInfo, { TypeInfo } from './TypeInfo';
5
+ import typeInfo, { TypeInfo } from './TypeInfo.js';
6
6
  export { typeInfo, TypeInfo };
7
7
  export declare class TypeInfoHelper extends TypeInfo {
8
8
  contains<TDescriptor>(descriptor: unknown): this is TDescriptor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsdotnet/reflection",
3
- "version": "1.1.12",
3
+ "version": "1.1.13",
4
4
  "description": "",
5
5
  "author": "electricessence",
6
6
  "license": "MIT",
@@ -20,23 +20,6 @@
20
20
  "runtime type",
21
21
  "runtime typechecking"
22
22
  ],
23
- "scripts": {
24
- "clean": "rimraf dist",
25
- "build:types": "cpy \"src/**/*.d.ts\" dist/types --parents && tsc -p tsconfig.types.json",
26
- "build:esm": "rollup -c rollup.config.js",
27
- "build:cjs": "tsc -p tsconfig.cjs.json",
28
- "build": "pnpm clean && pnpm build:types && pnpm build:esm && pnpm build:cjs && pnpm typecheck:tests",
29
- "test": "vitest run",
30
- "typecheck": "tsc --noEmit",
31
- "typecheck:tests": "tsc -p tests/tsconfig.json --noEmit",
32
- "lint": "eslint src/**/*.ts",
33
- "docs": "rimraf docs && typedoc --options typedoc.json --readme none",
34
- "bump": "pnpm run precommit && pnpm version patch",
35
- "precommit": "pnpm build && pnpm test && pnpm lint && git status -s",
36
- "preversion": "pnpm lint && pnpm test",
37
- "postversion": "git push && git push --tags && pnpm run docs && git add -A && git commit -m \"Updated docs.\" docs && git push",
38
- "prepublishOnly": "pnpm build && pnpm test && pnpm lint"
39
- },
40
23
  "repository": {
41
24
  "type": "git",
42
25
  "url": "git+https://github.com/tsdotnet/reflection.git"
@@ -46,41 +29,40 @@
46
29
  },
47
30
  "homepage": "https://github.com/tsdotnet/reflection#readme",
48
31
  "devDependencies": {
49
- "@eslint/js": "^9.34.0",
50
- "@rollup/plugin-node-resolve": "^16.0.1",
51
- "@rollup/plugin-typescript": "^12.1.4",
52
- "@types/node": "^24.3.0",
53
- "@vitest/coverage-v8": "^3.2.4",
54
- "cpy-cli": "^6.0.0",
55
- "eslint": "^9.34.0",
56
- "rimraf": "^6.0.1",
57
- "rollup": "^4.48.1",
58
- "typedoc": "^0.28.11",
59
- "typescript": "^5.9.2",
60
- "typescript-eslint": "^8.41.0",
61
- "vitest": "^3.2.4"
32
+ "@eslint/js": "^10.0.1",
33
+ "@rollup/plugin-node-resolve": "^16.0.3",
34
+ "@rollup/plugin-typescript": "^12.3.0",
35
+ "@types/node": "^25.5.0",
36
+ "@vitest/coverage-v8": "^4.1.0",
37
+ "cpy-cli": "^7.0.0",
38
+ "eslint": "^10.0.3",
39
+ "rimraf": "^6.1.3",
40
+ "rollup": "^4.59.0",
41
+ "typedoc": "^0.28.17",
42
+ "typescript": "^5.9.3",
43
+ "typescript-eslint": "^8.57.1",
44
+ "vitest": "^4.1.0"
62
45
  },
63
46
  "dependencies": {
64
47
  "@tsdotnet/compare": "^1.7.4",
65
48
  "@tsdotnet/type": "^1.2.7",
66
49
  "tslib": "^2.8.1"
67
50
  },
68
- "pnpm": {
69
- "overrides": {
70
- "hosted-git-info@<2.8.9": ">=2.8.9",
71
- "y18n@=4.0.0": ">=4.0.1",
72
- "lodash@<4.17.20": ">=4.17.20",
73
- "shell-quote@<=1.7.2": ">=1.7.3",
74
- "lodash@<4.17.21": ">=4.17.21",
75
- "json5@<1.0.2": ">=1.0.2",
76
- "json5@>=2.0.0 <2.2.2": ">=2.2.2",
77
- "minimatch@<3.0.5": ">=3.0.5",
78
- "semver@<5.7.2": ">=5.7.2",
79
- "semver@>=6.0.0 <6.3.1": ">=6.3.1",
80
- "semver@>=7.0.0 <7.5.2": ">=7.5.2",
81
- "get-func-name@<2.0.1": ">=2.0.1",
82
- "@babel/traverse@<7.23.2": ">=7.23.2",
83
- "braces@<3.0.3": ">=3.0.3"
84
- }
51
+ "scripts": {
52
+ "clean": "rimraf dist",
53
+ "copy:dts": "cpy \"src/**/*.d.ts\" dist/types --parents || echo No .d.ts files to copy",
54
+ "build:types": "pnpm copy:dts && tsc -p tsconfig.types.json",
55
+ "build:esm": "rollup -c rollup.config.js",
56
+ "build:cjs": "tsc -p tsconfig.cjs.json",
57
+ "build": "pnpm clean && pnpm build:types && pnpm build:esm && pnpm build:cjs && pnpm typecheck:tests",
58
+ "test": "vitest run",
59
+ "typecheck": "tsc --noEmit",
60
+ "typecheck:tests": "tsc -p tests/tsconfig.json --noEmit",
61
+ "lint": "eslint src/**/*.ts",
62
+ "docs": "rimraf docs && typedoc --options typedoc.json --readme none",
63
+ "bump": "pnpm run precommit && pnpm version patch",
64
+ "precommit": "pnpm build && pnpm test && pnpm lint && git status -s",
65
+ "preversion": "pnpm lint && pnpm test",
66
+ "postversion": "git push && git push --tags && pnpm run docs && git add -A && git commit -m \"Updated docs.\" docs && git push"
85
67
  }
86
- }
68
+ }