@inversifyjs/reflect-metadata-utils
Advanced tools
Comparing version 0.2.4 to 1.0.0
# @inversifyjs/reflect-metadata-utils | ||
## 1.0.0 | ||
### Major Changes | ||
- a4276ba: Updated `updateReflectMetadata` to receive a default value builder. | ||
### Minor Changes | ||
- a4276ba: Added `setReflectMetadata`. | ||
### Patch Changes | ||
- 6b52b45: Updated rollup config to provide right source map file paths. | ||
## 0.2.4 | ||
@@ -4,0 +18,0 @@ |
import { getReflectMetadata } from './reflectMetadata/utils/getReflectMetadata'; | ||
import { setReflectMetadata } from './reflectMetadata/utils/setReflectMetadata'; | ||
import { updateReflectMetadata } from './reflectMetadata/utils/updateReflectMetadata'; | ||
export { getReflectMetadata, updateReflectMetadata }; | ||
export { getReflectMetadata, setReflectMetadata, updateReflectMetadata }; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.updateReflectMetadata = exports.getReflectMetadata = void 0; | ||
exports.updateReflectMetadata = exports.setReflectMetadata = exports.getReflectMetadata = void 0; | ||
const getReflectMetadata_1 = require("./reflectMetadata/utils/getReflectMetadata"); | ||
Object.defineProperty(exports, "getReflectMetadata", { enumerable: true, get: function () { return getReflectMetadata_1.getReflectMetadata; } }); | ||
const setReflectMetadata_1 = require("./reflectMetadata/utils/setReflectMetadata"); | ||
Object.defineProperty(exports, "setReflectMetadata", { enumerable: true, get: function () { return setReflectMetadata_1.setReflectMetadata; } }); | ||
const updateReflectMetadata_1 = require("./reflectMetadata/utils/updateReflectMetadata"); | ||
Object.defineProperty(exports, "updateReflectMetadata", { enumerable: true, get: function () { return updateReflectMetadata_1.updateReflectMetadata; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
export declare function updateReflectMetadata<TMetadata>(target: object, metadataKey: unknown, defaultValue: TMetadata, callback: (metadata: TMetadata) => TMetadata): void; | ||
export declare function updateReflectMetadata<TMetadata>(target: object, metadataKey: unknown, buildDefaultValue: () => TMetadata, callback: (metadata: TMetadata) => TMetadata): void; | ||
//# sourceMappingURL=updateReflectMetadata.d.ts.map |
@@ -5,4 +5,4 @@ "use strict"; | ||
const getReflectMetadata_1 = require("./getReflectMetadata"); | ||
function updateReflectMetadata(target, metadataKey, defaultValue, callback) { | ||
const metadata = (0, getReflectMetadata_1.getReflectMetadata)(target, metadataKey) ?? defaultValue; | ||
function updateReflectMetadata(target, metadataKey, buildDefaultValue, callback) { | ||
const metadata = (0, getReflectMetadata_1.getReflectMetadata)(target, metadataKey) ?? buildDefaultValue(); | ||
const updatedMetadata = callback(metadata); | ||
@@ -9,0 +9,0 @@ Reflect.defineMetadata(metadataKey, updatedMetadata, target); |
declare function getReflectMetadata<TMetadata>(target: object, metadataKey: unknown): TMetadata | undefined; | ||
declare function updateReflectMetadata<TMetadata>(target: object, metadataKey: unknown, defaultValue: TMetadata, callback: (metadata: TMetadata) => TMetadata): void; | ||
declare function setReflectMetadata(target: object, metadataKey: unknown, metadata: unknown): void; | ||
export { getReflectMetadata, updateReflectMetadata }; | ||
declare function updateReflectMetadata<TMetadata>(target: object, metadataKey: unknown, buildDefaultValue: () => TMetadata, callback: (metadata: TMetadata) => TMetadata): void; | ||
export { getReflectMetadata, setReflectMetadata, updateReflectMetadata }; |
@@ -1,2 +0,2 @@ | ||
function t(t,e){return Reflect.getMetadata(e,t)}function e(e,n,a,c){const f=c(t(e,n)??a);Reflect.defineMetadata(n,f,e)}export{t as getReflectMetadata,e as updateReflectMetadata}; | ||
function e(e,t){return Reflect.getMetadata(t,e)}function t(e,t,n){Reflect.defineMetadata(t,n,e)}function n(t,n,a,f){const c=f(e(t,n)??a());Reflect.defineMetadata(n,c,t)}export{e as getReflectMetadata,t as setReflectMetadata,n as updateReflectMetadata}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@inversifyjs/reflect-metadata-utils", | ||
"version": "0.2.4", | ||
"version": "1.0.0", | ||
"description": "Reflect metadata utils", | ||
@@ -34,15 +34,15 @@ "main": "lib/cjs/index.js", | ||
"devDependencies": { | ||
"@eslint/js": "9.15.0", | ||
"@eslint/js": "9.17.0", | ||
"@jest/globals": "29.7.0", | ||
"@stryker-mutator/core": "8.6.0", | ||
"@stryker-mutator/jest-runner": "8.6.0", | ||
"@stryker-mutator/typescript-checker": "8.6.0", | ||
"@types/node": "22.10.1", | ||
"@typescript-eslint/eslint-plugin": "8.16.0", | ||
"@typescript-eslint/parser": "8.16.0", | ||
"eslint": "9.15.0", | ||
"@stryker-mutator/core": "8.7.1", | ||
"@stryker-mutator/jest-runner": "8.7.1", | ||
"@stryker-mutator/typescript-checker": "8.7.1", | ||
"@types/node": "22.10.5", | ||
"@typescript-eslint/eslint-plugin": "8.19.1", | ||
"@typescript-eslint/parser": "8.19.1", | ||
"eslint": "9.17.0", | ||
"jest": "29.7.0", | ||
"prettier": "3.4.1", | ||
"prettier": "3.4.2", | ||
"rimraf": "6.0.1", | ||
"rollup": "4.27.4", | ||
"rollup": "4.30.1", | ||
"ts-loader": "9.5.1", | ||
@@ -52,6 +52,6 @@ "ts-jest": "29.2.5", | ||
"tslib": "2.8.1", | ||
"typescript": "5.7.2" | ||
"typescript": "5.7.3" | ||
}, | ||
"devEngines": { | ||
"node": "^20.18.0", | ||
"node": "^22.10.2", | ||
"pnpm": "^9.12.1" | ||
@@ -66,3 +66,2 @@ }, | ||
}, | ||
"sideEffects": false, | ||
"scripts": { | ||
@@ -69,0 +68,0 @@ "build": "pnpm run build:cjs && pnpm run build:esm", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
12900
32
47
0