nats-micro
Advanced tools
Comparing version 0.28.2 to 0.28.3
import { Handler, MicroserviceConfig, MicroserviceMethodConfig } from '../types/index.js'; | ||
export type StoredMicroserviceClassMethod<T, R> = { | ||
type StoredMicroserviceClassMethod<T, R> = { | ||
method: Handler<T, R>; | ||
@@ -8,3 +8,3 @@ config: { | ||
}; | ||
export type StoredMicroserviceClass = { | ||
type StoredMicroserviceClass = { | ||
target: unknown; | ||
@@ -14,3 +14,3 @@ config: Omit<MicroserviceConfig, 'methods'>; | ||
}; | ||
export declare class ClassStorage { | ||
declare class ClassStorage { | ||
readonly items: StoredMicroserviceClass[]; | ||
@@ -22,1 +22,2 @@ ensureClassAdded(target: unknown): StoredMicroserviceClass; | ||
export declare const storage: ClassStorage; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.storage = exports.ClassStorage = void 0; | ||
exports.storage = void 0; | ||
const misc_js_1 = require("../utils/misc.js"); | ||
@@ -8,14 +8,2 @@ class ClassStorage { | ||
this.items = []; | ||
// addMethod<T, R>( | ||
// targetClass: unknown, | ||
// targetMethodName: string, | ||
// targetMethod: Handler<T, R>, | ||
// data: Partial<MicroserviceMethodConfig<T, R>>, | ||
// ): void { | ||
// const storedMethod = { | ||
// ...storage.ensureClassMethodAdded<T, R>(targetClass, targetMethodName), | ||
// }; | ||
// storedMethod.config.handler = targetMethod; | ||
// storedMethod.config = { ...storedMethod.config, ...data }; | ||
// } | ||
} | ||
@@ -69,4 +57,3 @@ ensureClassAdded(target) { | ||
} | ||
exports.ClassStorage = ClassStorage; | ||
exports.storage = new ClassStorage(); | ||
//# sourceMappingURL=storage.js.map |
import { Handler, MicroserviceConfig, MicroserviceMethodConfig } from '../types/index.js'; | ||
export type StoredMicroserviceClassMethod<T, R> = { | ||
type StoredMicroserviceClassMethod<T, R> = { | ||
method: Handler<T, R>; | ||
@@ -8,3 +8,3 @@ config: { | ||
}; | ||
export type StoredMicroserviceClass = { | ||
type StoredMicroserviceClass = { | ||
target: unknown; | ||
@@ -14,3 +14,3 @@ config: Omit<MicroserviceConfig, 'methods'>; | ||
}; | ||
export declare class ClassStorage { | ||
declare class ClassStorage { | ||
readonly items: StoredMicroserviceClass[]; | ||
@@ -22,1 +22,2 @@ ensureClassAdded(target: unknown): StoredMicroserviceClass; | ||
export declare const storage: ClassStorage; | ||
export {}; |
import { kebabCase } from '../utils/misc.js'; | ||
export class ClassStorage { | ||
class ClassStorage { | ||
constructor() { | ||
this.items = []; | ||
// addMethod<T, R>( | ||
// targetClass: unknown, | ||
// targetMethodName: string, | ||
// targetMethod: Handler<T, R>, | ||
// data: Partial<MicroserviceMethodConfig<T, R>>, | ||
// ): void { | ||
// const storedMethod = { | ||
// ...storage.ensureClassMethodAdded<T, R>(targetClass, targetMethodName), | ||
// }; | ||
// storedMethod.config.handler = targetMethod; | ||
// storedMethod.config = { ...storedMethod.config, ...data }; | ||
// } | ||
} | ||
@@ -18,0 +6,0 @@ ensureClassAdded(target) { |
{ | ||
"name": "nats-micro", | ||
"version": "0.28.2", | ||
"version": "0.28.3", | ||
"description": "NATS micro compatible extra-lightweight microservice library", | ||
@@ -46,7 +46,3 @@ "main": "lib/cjs/index.js", | ||
"dependencies": { | ||
"chai-like": "^1.1.1", | ||
"chai-things": "^0.2.0", | ||
"debug-threads-ns": "^0.2.3", | ||
"errio": "^1.2.2", | ||
"fast-safe-stringify": "^2.1.1", | ||
"moment": "^2.29.4", | ||
@@ -72,4 +68,5 @@ "nanoid": "^3.3.5", | ||
"chai-as-promised": "^7.1.1", | ||
"chai-like": "^1.1.1", | ||
"chai-subset": "^1.6.0", | ||
"clean-package": "^2.2.0", | ||
"chai-things": "^0.2.0", | ||
"coverage-badge-creator": "^1.0.18", | ||
@@ -92,3 +89,2 @@ "eslint": "^8.34.0", | ||
"mocha-multi-reporters": "^1.5.1", | ||
"nyc": "^15.1.0", | ||
"sinon": "^9.0.2", | ||
@@ -95,0 +91,0 @@ "ts-mocha": "^10.0.0", |
import { Handler, MicroserviceConfig, MicroserviceMethodConfig } from '../types/index.js'; | ||
import { kebabCase } from '../utils/misc.js'; | ||
export type StoredMicroserviceClassMethod<T, R> = { | ||
type StoredMicroserviceClassMethod<T, R> = { | ||
method: Handler<T, R>; | ||
@@ -9,3 +9,3 @@ config: { name?: string; } & Omit<MicroserviceMethodConfig<T, R>, 'handler'>; | ||
export type StoredMicroserviceClass = { | ||
type StoredMicroserviceClass = { | ||
target: unknown; // class constructor | ||
@@ -17,3 +17,3 @@ config: Omit<MicroserviceConfig, 'methods'>; | ||
export class ClassStorage { | ||
class ClassStorage { | ||
public readonly items: StoredMicroserviceClass[] = []; | ||
@@ -80,20 +80,4 @@ | ||
} | ||
// addMethod<T, R>( | ||
// targetClass: unknown, | ||
// targetMethodName: string, | ||
// targetMethod: Handler<T, R>, | ||
// data: Partial<MicroserviceMethodConfig<T, R>>, | ||
// ): void { | ||
// const storedMethod = { | ||
// ...storage.ensureClassMethodAdded<T, R>(targetClass, targetMethodName), | ||
// }; | ||
// storedMethod.config.handler = targetMethod; | ||
// storedMethod.config = { ...storedMethod.config, ...data }; | ||
// } | ||
} | ||
export const storage = new ClassStorage(); |
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
6
409007
7655
- Removedchai-like@^1.1.1
- Removedchai-things@^0.2.0
- Removederrio@^1.2.2
- Removedfast-safe-stringify@^2.1.1
- Removedassertion-error@2.0.1(transitive)
- Removedchai@5.1.1(transitive)
- Removedchai-like@1.1.3(transitive)
- Removedchai-things@0.2.0(transitive)
- Removedcheck-error@2.1.1(transitive)
- Removeddeep-eql@5.0.2(transitive)
- Removederrio@1.2.2(transitive)
- Removedget-func-name@2.0.2(transitive)
- Removedloupe@3.1.1(transitive)
- Removedpathval@2.0.0(transitive)