@raptortrade/core 0.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/dist/index.cjs ADDED
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ applyFeatures: () => applyFeatures
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+
27
+ // src/features.ts
28
+ function applyFeatures(instance, client, features, registry) {
29
+ for (const f of features) {
30
+ registry[f](instance, client);
31
+ }
32
+ }
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ applyFeatures
36
+ });
37
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/features.ts"],"sourcesContent":["export { applyFeatures } from \"./features.js\";\nexport type { UnionToIntersection, WithFeatures, FeatureRegistry } from \"./features.js\";\n","export type UnionToIntersection<U> =\n (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;\n\nexport type WithFeatures<\n Base,\n Map extends Record<string, object>,\n F extends readonly (keyof Map)[]\n> = Base & UnionToIntersection<Map[F[number]]>;\n\nexport type FeatureRegistry<K extends string> =\n Record<K, (instance: any, client: any) => void>;\n\nexport function applyFeatures<K extends string>(\n instance: any,\n client: any,\n features: readonly K[],\n registry: FeatureRegistry<K>,\n): void {\n for (const f of features) {\n registry[f](instance, client);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACYO,SAAS,cACd,UACA,QACA,UACA,UACM;AACN,aAAW,KAAK,UAAU;AACxB,aAAS,CAAC,EAAE,UAAU,MAAM;AAAA,EAC9B;AACF;","names":[]}
@@ -0,0 +1,6 @@
1
+ type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
2
+ type WithFeatures<Base, Map extends Record<string, object>, F extends readonly (keyof Map)[]> = Base & UnionToIntersection<Map[F[number]]>;
3
+ type FeatureRegistry<K extends string> = Record<K, (instance: any, client: any) => void>;
4
+ declare function applyFeatures<K extends string>(instance: any, client: any, features: readonly K[], registry: FeatureRegistry<K>): void;
5
+
6
+ export { type FeatureRegistry, type UnionToIntersection, type WithFeatures, applyFeatures };
@@ -0,0 +1,6 @@
1
+ type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
2
+ type WithFeatures<Base, Map extends Record<string, object>, F extends readonly (keyof Map)[]> = Base & UnionToIntersection<Map[F[number]]>;
3
+ type FeatureRegistry<K extends string> = Record<K, (instance: any, client: any) => void>;
4
+ declare function applyFeatures<K extends string>(instance: any, client: any, features: readonly K[], registry: FeatureRegistry<K>): void;
5
+
6
+ export { type FeatureRegistry, type UnionToIntersection, type WithFeatures, applyFeatures };
package/dist/index.mjs ADDED
@@ -0,0 +1,10 @@
1
+ // src/features.ts
2
+ function applyFeatures(instance, client, features, registry) {
3
+ for (const f of features) {
4
+ registry[f](instance, client);
5
+ }
6
+ }
7
+ export {
8
+ applyFeatures
9
+ };
10
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/features.ts"],"sourcesContent":["export type UnionToIntersection<U> =\n (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;\n\nexport type WithFeatures<\n Base,\n Map extends Record<string, object>,\n F extends readonly (keyof Map)[]\n> = Base & UnionToIntersection<Map[F[number]]>;\n\nexport type FeatureRegistry<K extends string> =\n Record<K, (instance: any, client: any) => void>;\n\nexport function applyFeatures<K extends string>(\n instance: any,\n client: any,\n features: readonly K[],\n registry: FeatureRegistry<K>,\n): void {\n for (const f of features) {\n registry[f](instance, client);\n }\n}\n"],"mappings":";AAYO,SAAS,cACd,UACA,QACA,UACA,UACM;AACN,aAAW,KAAK,UAAU;AACxB,aAAS,CAAC,EAAE,UAAU,MAAM;AAAA,EAC9B;AACF;","names":[]}
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@raptortrade/core",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/index.d.ts",
8
+ "import": "./dist/index.mjs",
9
+ "require": "./dist/index.cjs"
10
+ }
11
+ },
12
+ "main": "./dist/index.cjs",
13
+ "module": "./dist/index.mjs",
14
+ "types": "./dist/index.d.ts",
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "devDependencies": {
22
+ "tsup": "^8.5.0",
23
+ "typescript": "^5.8.0"
24
+ },
25
+ "scripts": {
26
+ "build": "tsup",
27
+ "typecheck": "tsc --noEmit"
28
+ }
29
+ }