@autometa/bind-decorator
Advanced tools
Sorry, the diff of this file is not supported yet
| declare function Bind<T extends Function>(_target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void; | ||
| declare function Freeze<T extends Function>(_target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void; | ||
| export { Bind, Freeze }; |
| "use strict"; | ||
| var __defProp = Object.defineProperty; | ||
| var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
| var __getOwnPropNames = Object.getOwnPropertyNames; | ||
| var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
| var __export = (target, all) => { | ||
| for (var name in all) | ||
| __defProp(target, name, { get: all[name], enumerable: true }); | ||
| }; | ||
| var __copyProps = (to, from, except, desc) => { | ||
| if (from && typeof from === "object" || typeof from === "function") { | ||
| for (let key of __getOwnPropNames(from)) | ||
| if (!__hasOwnProp.call(to, key) && key !== except) | ||
| __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
| } | ||
| return to; | ||
| }; | ||
| var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
| // index.ts | ||
| var bind_decorator_exports = {}; | ||
| __export(bind_decorator_exports, { | ||
| Bind: () => Bind, | ||
| Freeze: () => Freeze | ||
| }); | ||
| module.exports = __toCommonJS(bind_decorator_exports); | ||
| function Bind(_target, propertyKey, descriptor) { | ||
| if (!descriptor || typeof descriptor.value !== "function") { | ||
| throw new TypeError( | ||
| `Only methods can be decorated with @bind. <${propertyKey}> is not a method!` | ||
| ); | ||
| } | ||
| return { | ||
| configurable: true, | ||
| get() { | ||
| const bound = descriptor.value?.bind(this); | ||
| Object.defineProperty(this, propertyKey, { | ||
| value: bound, | ||
| configurable: true, | ||
| writable: true | ||
| }); | ||
| return bound; | ||
| }, | ||
| // eslint-disable-next-line @typescript-eslint/ban-types | ||
| set(value) { | ||
| const bound = value.bind(this); | ||
| Object.defineProperty(this, propertyKey, { | ||
| value: bound, | ||
| configurable: true, | ||
| writable: true | ||
| }); | ||
| return bound; | ||
| } | ||
| }; | ||
| } | ||
| function Freeze(_target, propertyKey, descriptor) { | ||
| if (!descriptor || typeof descriptor.value !== "function") { | ||
| throw new TypeError( | ||
| `Only methods can be decorated with @bind. <${propertyKey}> is not a method!` | ||
| ); | ||
| } | ||
| return { | ||
| configurable: false, | ||
| writable: false, | ||
| get() { | ||
| const bound = descriptor.value?.bind(this); | ||
| Object.defineProperty(this, propertyKey, { | ||
| value: bound, | ||
| configurable: true, | ||
| writable: true | ||
| }); | ||
| return bound; | ||
| } | ||
| }; | ||
| } | ||
| // Annotate the CommonJS export names for ESM import in node: | ||
| 0 && (module.exports = { | ||
| Bind, | ||
| Freeze | ||
| }); |
| export declare function Bind<T extends Function>(_target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void; | ||
| export declare function Freeze<T extends Function>(_target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,wBAAgB,IAAI,CAAC,CAAC,SAAS,QAAQ,EACrC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,uBAAuB,CAAC,CAAC,CAAC,GACrC,uBAAuB,CAAC,CAAC,CAAC,GAAG,IAAI,CA6BnC;AAGD,wBAAgB,MAAM,CAAC,CAAC,SAAS,QAAQ,EACvC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,uBAAuB,CAAC,CAAC,CAAC,GACrC,uBAAuB,CAAC,CAAC,CAAC,GAAG,IAAI,CAoBnC"} |
Sorry, the diff of this file is not supported yet
| import type { Options } from "tsup"; | ||
| export const tsup: Options = { | ||
| clean: true, // clean up the dist folder | ||
| format: ["cjs", "esm"], // generate cjs and esm files | ||
| skipNodeModulesBundle: true, | ||
| entryPoints: ["index.ts"], | ||
| target: "es2020", | ||
| outDir: "dist", | ||
| legacyOutput: true, | ||
| external: ["dist"], | ||
| }; |
| > @autometa/bind-decorator@0.4.0 build /home/runner/work/autometa/autometa/libraries/bind-decorator | ||
| > pnpm build:code && pnpm postbuild | ||
| > @autometa/bind-decorator@0.4.1 build /home/runner/work/autometa/autometa/libraries/bind-decorator | ||
| > pnpm build:js && pnpm build:dts | ||
| > @autometa/bind-decorator@0.4.0 build:code /home/runner/work/autometa/autometa/libraries/bind-decorator | ||
| > rimraf dist/ && pnpm run build:libs && ./fixup | ||
| > @autometa/bind-decorator@0.4.1 build:js /home/runner/work/autometa/autometa/libraries/bind-decorator | ||
| > tsup | ||
| [34mCLI[39m Building entry: index.ts | ||
| [34mCLI[39m Using tsconfig: tsconfig.json | ||
| [34mCLI[39m tsup v6.7.0 | ||
| [34mCLI[39m Using tsup config: /home/runner/work/autometa/autometa/libraries/bind-decorator/tsup.config.ts | ||
| [34mCLI[39m Target: es2020 | ||
| [34mCLI[39m Cleaning output folder | ||
| [34mCJS[39m Build start | ||
| [34mESM[39m Build start | ||
| [33mCJS[39m [33mYou have emitDecoratorMetadata enabled but @swc/core was not installed, skipping swc plugin[39m | ||
| [33mESM[39m [33mYou have emitDecoratorMetadata enabled but @swc/core was not installed, skipping swc plugin[39m | ||
| [32mCJS[39m [1mdist/index.js [22m[32m2.32 KB[39m | ||
| [32mCJS[39m ⚡️ Build success in 27ms | ||
| [32mESM[39m [1mdist/esm/index.js [22m[32m1.30 KB[39m | ||
| [32mESM[39m ⚡️ Build success in 27ms | ||
| > @autometa/bind-decorator@0.4.0 build:libs /home/runner/work/autometa/autometa/libraries/bind-decorator | ||
| > tsc -p tsconfig.json && tsc -p tsconfig.cjs.json | ||
| > @autometa/bind-decorator@0.4.1 build:dts /home/runner/work/autometa/autometa/libraries/bind-decorator | ||
| > pnpm build:dts:tsc | ||
| > @autometa/bind-decorator@0.4.0 postbuild /home/runner/work/autometa/autometa/libraries/bind-decorator | ||
| > tsc-alias -p ./tsconfig.cjs.json && tsc-alias -p ./tsconfig.json | ||
| > @autometa/bind-decorator@0.4.1 build:dts:tsc /home/runner/work/autometa/autometa/libraries/bind-decorator | ||
| > tsc --build --clean && tsc && tsup --entry.index out/index.d.ts --dtsOnly | ||
| [34mCLI[39m Building entry: {"index":"out/index.d.ts"} | ||
| [34mCLI[39m Using tsconfig: tsconfig.json | ||
| [34mCLI[39m tsup v6.7.0 | ||
| [34mCLI[39m Using tsup config: /home/runner/work/autometa/autometa/libraries/bind-decorator/tsup.config.ts | ||
| [34mDTS[39m Build start | ||
| [32mDTS[39m ⚡️ Build success in 154ms | ||
| [32mDTS[39m [1mdist/index.d.ts [22m[32m340.00 B[39m |
| > @autometa/bind-decorator@0.4.0 lint /home/runner/work/autometa/autometa/libraries/bind-decorator | ||
| > @autometa/bind-decorator@0.4.1 lint /home/runner/work/autometa/autometa/libraries/bind-decorator | ||
| > eslint . --max-warnings 0 | ||
| > @autometa/bind-decorator@0.4.0 test /home/runner/work/autometa/autometa/libraries/bind-decorator | ||
| > @autometa/bind-decorator@0.4.1 test /home/runner/work/autometa/autometa/libraries/bind-decorator | ||
| > vitest run --passWithNoTests | ||
@@ -4,0 +4,0 @@ |
+6
-0
| # @autometa/dto-builder | ||
| ## 0.4.1 | ||
| ### Patch Changes | ||
| - 6a4a9ac: Swapped project type to "composite", unified build system for most projects | ||
| ## 0.4.0 | ||
@@ -4,0 +10,0 @@ |
+50
-43
@@ -1,47 +0,54 @@ | ||
| // eslint-disable-next-line @typescript-eslint/ban-types | ||
| export function Bind(_target, propertyKey, descriptor) { | ||
| if (!descriptor || typeof descriptor.value !== "function") { | ||
| throw new TypeError(`Only methods can be decorated with @bind. <${propertyKey}> is not a method!`); | ||
| // index.ts | ||
| function Bind(_target, propertyKey, descriptor) { | ||
| if (!descriptor || typeof descriptor.value !== "function") { | ||
| throw new TypeError( | ||
| `Only methods can be decorated with @bind. <${propertyKey}> is not a method!` | ||
| ); | ||
| } | ||
| return { | ||
| configurable: true, | ||
| get() { | ||
| const bound = descriptor.value?.bind(this); | ||
| Object.defineProperty(this, propertyKey, { | ||
| value: bound, | ||
| configurable: true, | ||
| writable: true | ||
| }); | ||
| return bound; | ||
| }, | ||
| // eslint-disable-next-line @typescript-eslint/ban-types | ||
| set(value) { | ||
| const bound = value.bind(this); | ||
| Object.defineProperty(this, propertyKey, { | ||
| value: bound, | ||
| configurable: true, | ||
| writable: true | ||
| }); | ||
| return bound; | ||
| } | ||
| return { | ||
| }; | ||
| } | ||
| function Freeze(_target, propertyKey, descriptor) { | ||
| if (!descriptor || typeof descriptor.value !== "function") { | ||
| throw new TypeError( | ||
| `Only methods can be decorated with @bind. <${propertyKey}> is not a method!` | ||
| ); | ||
| } | ||
| return { | ||
| configurable: false, | ||
| writable: false, | ||
| get() { | ||
| const bound = descriptor.value?.bind(this); | ||
| Object.defineProperty(this, propertyKey, { | ||
| value: bound, | ||
| configurable: true, | ||
| get() { | ||
| const bound = descriptor.value?.bind(this); | ||
| Object.defineProperty(this, propertyKey, { | ||
| value: bound, | ||
| configurable: true, | ||
| writable: true, | ||
| }); | ||
| return bound; | ||
| }, | ||
| // eslint-disable-next-line @typescript-eslint/ban-types | ||
| set(value) { | ||
| const bound = value.bind(this); | ||
| Object.defineProperty(this, propertyKey, { | ||
| value: bound, | ||
| configurable: true, | ||
| writable: true, | ||
| }); | ||
| return bound; | ||
| }, | ||
| }; | ||
| } | ||
| // eslint-disable-next-line @typescript-eslint/ban-types | ||
| export function Freeze(_target, propertyKey, descriptor) { | ||
| if (!descriptor || typeof descriptor.value !== "function") { | ||
| throw new TypeError(`Only methods can be decorated with @bind. <${propertyKey}> is not a method!`); | ||
| writable: true | ||
| }); | ||
| return bound; | ||
| } | ||
| return { | ||
| configurable: false, | ||
| writable: false, | ||
| get() { | ||
| const bound = descriptor.value?.bind(this); | ||
| Object.defineProperty(this, propertyKey, { | ||
| value: bound, | ||
| configurable: true, | ||
| writable: true, | ||
| }); | ||
| return bound; | ||
| }, | ||
| }; | ||
| }; | ||
| } | ||
| export { | ||
| Bind, | ||
| Freeze | ||
| }; |
+15
-16
| { | ||
| "name": "@autometa/bind-decorator", | ||
| "version": "0.4.0", | ||
| "description": "Binds the this keyword of a method", | ||
| "version": "0.4.1", | ||
| "description": "Binds the this keyword of a method. Respectfully a fork of https://www.npmjs.com/package/bind-decorator", | ||
| "type": "module", | ||
@@ -10,8 +10,4 @@ "main": "dist/cjs/index.js", | ||
| "keywords": [ | ||
| "status codes", | ||
| "http", | ||
| "node", | ||
| "http status", | ||
| "status text", | ||
| "reason phrases" | ||
| "bind this keyword", | ||
| "bind decorator" | ||
| ], | ||
@@ -35,3 +31,3 @@ "repository": { | ||
| "eslint": "^7.32.0", | ||
| "eslint-config-custom": "0.5.0", | ||
| "eslint-config-custom": "0.5.1", | ||
| "node": "^19.6.0", | ||
@@ -43,17 +39,20 @@ "prettier": "^2.8.3", | ||
| "ts-node": "^10.9.1", | ||
| "tsc-alias": "^1.8.2", | ||
| "typescript": "^4.9.5", | ||
| "vitest": "^0.28.5" | ||
| }, | ||
| "dependencies": { | ||
| "tsup": "^6.7.0" | ||
| }, | ||
| "scripts": { | ||
| "test": "vitest run --passWithNoTests", | ||
| "prettify": "prettier --config .prettierrc 'src/**/*.ts' --write", | ||
| "prettify": "prettier --config .prettierrc '**/*.ts' --write", | ||
| "lint": "eslint . --max-warnings 0", | ||
| "lint:fix": "eslint . --fix", | ||
| "postbuild": "tsc-alias -p ./tsconfig.cjs.json && tsc-alias -p ./tsconfig.json", | ||
| "build:libs": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json", | ||
| "build:code": "rimraf dist/ && pnpm run build:libs && ./fixup", | ||
| "build": "pnpm build:code && pnpm postbuild" | ||
| "build:js": "tsup", | ||
| "build:dts:tsc": "tsc --build --clean && tsc && tsup --entry.index out/index.d.ts --dtsOnly", | ||
| "build:dts": "pnpm build:dts:tsc", | ||
| "build": "pnpm build:js && pnpm build:dts ", | ||
| "build:watch": "tsup --watch" | ||
| }, | ||
| "readme": "# Introduction\n\nBinds the `this` keyword on a clss method.\n\nThis is a fork of [bind-decorator](https://www.npmjs.com/package/bind-decorator) for use with Autometa.\n\n```\nnpm add @autometa/bind-decorator\n```\n\n# Use\n\n```ts\nimport { Bind } from \"@autometa/bind-decorator\";\n\nclass Foo {\n @Bind\n a() {\n // this.doStuff()\n }\n}\n```\n" | ||
| "readme": "# Introduction\n\nBinds the `this` keyword on a class method.\n\nThis is a fork of [bind-decorator](https://www.npmjs.com/package/bind-decorator) for use with Autometa.\n\n```\nnpm add @autometa/bind-decorator\n```\n\n# Use\n\n```ts\nimport { Bind } from \"@autometa/bind-decorator\";\n\nclass Foo {\n @Bind\n a() {\n // this.doStuff()\n }\n}\n```\n" | ||
| } |
+1
-1
| # Introduction | ||
| Binds the `this` keyword on a clss method. | ||
| Binds the `this` keyword on a class method. | ||
@@ -5,0 +5,0 @@ This is a fork of [bind-decorator](https://www.npmjs.com/package/bind-decorator) for use with Autometa. |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.Freeze = exports.Bind = void 0; | ||
| // eslint-disable-next-line @typescript-eslint/ban-types | ||
| function Bind(_target, propertyKey, descriptor) { | ||
| if (!descriptor || typeof descriptor.value !== "function") { | ||
| throw new TypeError(`Only methods can be decorated with @bind. <${propertyKey}> is not a method!`); | ||
| } | ||
| return { | ||
| configurable: true, | ||
| get() { | ||
| const bound = descriptor.value?.bind(this); | ||
| Object.defineProperty(this, propertyKey, { | ||
| value: bound, | ||
| configurable: true, | ||
| writable: true, | ||
| }); | ||
| return bound; | ||
| }, | ||
| // eslint-disable-next-line @typescript-eslint/ban-types | ||
| set(value) { | ||
| const bound = value.bind(this); | ||
| Object.defineProperty(this, propertyKey, { | ||
| value: bound, | ||
| configurable: true, | ||
| writable: true, | ||
| }); | ||
| return bound; | ||
| }, | ||
| }; | ||
| } | ||
| exports.Bind = Bind; | ||
| // eslint-disable-next-line @typescript-eslint/ban-types | ||
| function Freeze(_target, propertyKey, descriptor) { | ||
| if (!descriptor || typeof descriptor.value !== "function") { | ||
| throw new TypeError(`Only methods can be decorated with @bind. <${propertyKey}> is not a method!`); | ||
| } | ||
| return { | ||
| configurable: false, | ||
| writable: false, | ||
| get() { | ||
| const bound = descriptor.value?.bind(this); | ||
| Object.defineProperty(this, propertyKey, { | ||
| value: bound, | ||
| configurable: true, | ||
| writable: true, | ||
| }); | ||
| return bound; | ||
| }, | ||
| }; | ||
| } | ||
| exports.Freeze = Freeze; |
| { | ||
| "type": "commonjs" | ||
| } |
| { | ||
| "type": "module" | ||
| } |
| export declare function Bind<T extends Function>(_target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void; | ||
| export declare function Freeze<T extends Function>(_target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AACA,wBAAgB,IAAI,CAAC,CAAC,SAAS,QAAQ,EACrC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,uBAAuB,CAAC,CAAC,CAAC,GACrC,uBAAuB,CAAC,CAAC,CAAC,GAAG,IAAI,CA6BnC;AAGD,wBAAgB,MAAM,CAAC,CAAC,SAAS,QAAQ,EACvC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,uBAAuB,CAAC,CAAC,CAAC,GACrC,uBAAuB,CAAC,CAAC,CAAC,GAAG,IAAI,CAoBnC"} |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
103548
825.2%12
-7.69%17
6.25%212
29.27%1
Infinity%1
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added