reflect-utils 0.2.0 → 1.1.0

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 CHANGED
@@ -1,4 +1,4 @@
1
- # Reflect Metadata Utilities
1
+ # Reflect Utilities
2
2
 
3
3
  Helpers for composing decorators that work nicely with class hierarchies.
4
4
 
@@ -1,3 +1,3 @@
1
1
  import 'reflect-metadata';
2
- export declare function addClassMetadata<T>(key: Symbol | string, target: any, datum: T): void;
3
- export declare function getClassMetadata<T>(key: Symbol | string, target: any): T[];
2
+ export declare function addClassMetadata<T>(key: symbol | string, target: any, datum: T): void;
3
+ export declare function getClassMetadata<T>(key: symbol | string, target: any): T[];
package/out/main/index.js CHANGED
@@ -1,15 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getClassMetadata = exports.addClassMetadata = void 0;
4
- require("reflect-metadata");
5
- function addClassMetadata(key, target, datum) {
1
+ import 'reflect-metadata';
2
+ export function addClassMetadata(key, target, datum) {
6
3
  const _target = target instanceof Function ? target.prototype : target;
7
4
  const metadata = Reflect.getOwnMetadata(key, _target) || [];
8
5
  metadata.push(datum);
9
6
  Reflect.defineMetadata(key, metadata, _target);
10
7
  }
11
- exports.addClassMetadata = addClassMetadata;
12
- function getClassMetadata(key, target) {
8
+ export function getClassMetadata(key, target) {
13
9
  const _target = target instanceof Function ? target.prototype : target;
14
10
  let result = [];
15
11
  let proto = _target;
@@ -20,4 +16,4 @@ function getClassMetadata(key, target) {
20
16
  }
21
17
  return result;
22
18
  }
23
- exports.getClassMetadata = getClassMetadata;
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/main/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,MAAM,UAAU,gBAAgB,CAAI,GAAoB,EAAE,MAAW,EAAE,KAAQ;IAC3E,MAAM,OAAO,GAAG,MAAM,YAAY,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IACvE,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;IAC5D,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAI,GAAoB,EAAE,MAAW;IACjE,MAAM,OAAO,GAAG,MAAM,YAAY,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IACvE,IAAI,MAAM,GAAQ,EAAE,CAAC;IACrB,IAAI,KAAK,GAAG,OAAO,CAAC;IACpB,OAAO,KAAK,KAAK,MAAM,CAAC,SAAS,EAAE,CAAC;QAChC,MAAM,WAAW,GAAQ,OAAO,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;QAClE,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACpC,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "reflect-utils",
3
- "version": "0.2.0",
4
- "description": "Reflect Metadata Utilities",
3
+ "version": "1.1.0",
4
+ "description": "Reflection Utilities",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "exports": {
8
+ ".": "./out/main/index.js"
9
+ },
5
10
  "main": "out/main/index.js",
6
11
  "types": "out/main/index.d.ts",
7
12
  "files": [
@@ -9,39 +14,33 @@
9
14
  ],
10
15
  "scripts": {
11
16
  "clean": "rm -rf out *.tsbuildinfo",
12
- "dev": "tsc -b -w",
13
- "compile": "tsc -b",
14
- "lint": "eslint --ext=.js,.ts,.vue --cache .",
17
+ "dev": "npm run clean && tsc -b -w",
18
+ "compile": "npm run clean && tsc -b",
19
+ "lint": "eslint --cache",
15
20
  "test": "NODE_ENV=test mocha",
16
- "preversion": "npm run lint",
17
21
  "version": "npm run compile",
18
- "postversion": "npm publish --access=public"
22
+ "postversion": "npm publish --access=public && git push --tags origin main"
19
23
  },
20
24
  "pre-commit": [
21
25
  "lint"
22
26
  ],
23
27
  "repository": {
24
28
  "type": "git",
25
- "url": "git+ssh://git@github.com/inca/typesafe-event.git"
29
+ "url": "git+ssh://git@github.com/MeshIoC/reflect-utils.git"
26
30
  },
27
- "keywords": [
28
- "reflect",
29
- "metadata",
30
- "oop",
31
- "class"
32
- ],
31
+ "keywords": [],
33
32
  "author": "Boris Okunskiy",
34
33
  "license": "ISC",
35
34
  "devDependencies": {
36
- "@types/mocha": "^8.2.3",
37
- "@types/node": "^16.3.1",
38
- "@ubio/eslint-config": "^1.1.6",
39
- "eslint": "^7.30.0",
40
- "mocha": "^9.0.2",
35
+ "@nodescript/eslint-config": "^2.0.2",
36
+ "@types/mocha": "^10.0.10",
37
+ "@types/node": "^22.10.2",
38
+ "eslint": "^9.17.0",
39
+ "mocha": "^11.0.1",
41
40
  "pre-commit": "^1.2.2",
42
- "typescript": "^4.3.5"
41
+ "typescript": "^5.7.2"
43
42
  },
44
- "dependencies": {
43
+ "peerDependencies": {
45
44
  "reflect-metadata": "^0.1.13"
46
45
  }
47
46
  }