common-proxy
Advanced tools
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| Object.defineProperty(exports, "commonProxyDecorator", { | ||
| enumerable: true, | ||
| get: function() { | ||
| return commonProxyDecorator; | ||
| } | ||
| }); | ||
| const _commonproxycjs = require("./common-proxy.cjs"); | ||
| const commonProxyDecorator = (promiseOfDecorator)=>(handler, ...handlerArgs)=>async (...args)=>{ | ||
| const proxied = await (0, _commonproxycjs.commonProxy)(promiseOfDecorator)(handler, ...handlerArgs); | ||
| return proxied(...args); | ||
| }; | ||
| //# sourceMappingURL=common-proxy-decorator.cjs.map |
| import type { ImportableHandler } from './lib/types.cjs'; | ||
| type DecoratorReturnType<Decorator extends (handler: (...args: any[]) => any, ...args: any[]) => (...args: any[]) => any, Handler extends (...args: any[]) => any> = ReturnType<Handler> extends Promise<unknown> ? Decorator : (...handlerArgs: Parameters<Decorator>) => (...args: Parameters<Handler>) => Promise<Awaited<ReturnType<Handler>>>; | ||
| export declare const commonProxyDecorator: <Decorator extends (handler: (...args: any[]) => any, ...args: any[]) => (...args: any[]) => any, Handler extends (...args: any[]) => any = ReturnType<Decorator>>(promiseOfDecorator: ImportableHandler<Decorator> | Promise<ImportableHandler<Decorator>>) => DecoratorReturnType<Decorator, Handler>; | ||
| export {}; | ||
| //# sourceMappingURL=common-proxy-decorator.d.cts.map |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| 0 && __export(require("./common-proxy-decorator.cjs")) && __export(require("./common-proxy.cjs")); | ||
| const _export_star = require("@swc/helpers/_/_export_star"); | ||
| _export_star._(require("./common-proxy-decorator.cjs"), exports); | ||
| _export_star._(require("./common-proxy.cjs"), exports); | ||
| //# sourceMappingURL=index.cjs.map |
| export * from './common-proxy-decorator.cjs'; | ||
| export * from './common-proxy.cjs'; | ||
| //# sourceMappingURL=index.d.cts.map |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| //# sourceMappingURL=types.cjs.map |
| export type ImportableHandler<Handler extends (...args: any[]) => any> = Handler | { | ||
| default: { | ||
| default: Handler; | ||
| }; | ||
| } | { | ||
| default: Handler; | ||
| }; | ||
| //# sourceMappingURL=types.d.cts.map |
@@ -23,2 +23,3 @@ "use strict"; | ||
| }; | ||
| //# sourceMappingURL=common-proxy.cjs.map | ||
| //# sourceMappingURL=common-proxy.cjs.map |
@@ -1,10 +0,5 @@ | ||
| type ImportableHandler<Handler extends (...args: any[]) => unknown> = Handler | { | ||
| default: { | ||
| default: Handler; | ||
| }; | ||
| } | { | ||
| default: Handler; | ||
| }; | ||
| export declare const commonProxy: <Handler extends (...args: any[]) => unknown>(promiseOfHandler: ImportableHandler<Handler> | Promise<ImportableHandler<Handler>>) => ((...args: Parameters<Handler>) => Promise<Awaited<ReturnType<Handler>>>); | ||
| import type { ImportableHandler } from './lib/types.cjs'; | ||
| type ProxyReturnType<Handler extends (...args: any[]) => unknown> = ReturnType<Handler> extends Promise<unknown> ? Handler : (...args: Parameters<Handler>) => Promise<Awaited<ReturnType<Handler>>>; | ||
| export declare const commonProxy: <Handler extends (...args: any[]) => unknown>(promiseOfHandler: ImportableHandler<Handler> | Promise<ImportableHandler<Handler>>) => ProxyReturnType<Handler>; | ||
| export {}; | ||
| //# sourceMappingURL=common-proxy.d.cts.map |
+14
-11
| { | ||
| "name": "common-proxy", | ||
| "version": "0.0.7", | ||
| "version": "0.1.0", | ||
| "description": "Utility methods to help manage and expose nx plugins", | ||
@@ -24,5 +24,3 @@ "engines": { | ||
| "exports": { | ||
| ".": { | ||
| "require": "./dist/common-proxy.cjs" | ||
| } | ||
| ".": "./dist/index.cjs" | ||
| }, | ||
@@ -34,15 +32,20 @@ "dependencies": { | ||
| "@biomejs/biome": "^1.9.4", | ||
| "@swc/cli": "^0.5.2", | ||
| "@swc/core": "^1.10.4", | ||
| "@swc/helpers": "^0.5.15", | ||
| "@types/chai": "^5.0.1", | ||
| "@types/mocha": "^10.0.9", | ||
| "@types/node": "^22.8.6", | ||
| "c8": "^10.1.2", | ||
| "@types/mocha": "^10.0.10", | ||
| "@types/node": "^22.10.2", | ||
| "c8": "^10.1.3", | ||
| "chai": "^5.1.2", | ||
| "expect-type": "^1.1.0", | ||
| "mocha": "^10.8.2", | ||
| "npm-nx-tsc": "npm:nx-tsc@latest", | ||
| "mocha": "^11.0.1", | ||
| "npm-barrelify": "npm:barrelify@latest", | ||
| "npm-nx-update-ts-references": "npm:nx-update-ts-references@latest", | ||
| "tslib": "^2.8.1", | ||
| "typescript": "^5.6.3", | ||
| "@leyman/eslint-config": "^0.0.4" | ||
| "typescript": "^5.7.2", | ||
| "mocha-chain": "^0.0.9", | ||
| "@leyman/eslint-config": "^0.0.4", | ||
| "pnpm-dedicated-lockfile": "^0.0.1" | ||
| } | ||
| } |
8102
42.22%11
120%49
113.04%18
38.46%