moost 0.6.33 → 0.6.35
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 +36 -21
- package/dist/index.d.ts +13 -2
- package/dist/index.mjs +36 -21
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -48,7 +48,7 @@ let stamped = false;
|
|
|
48
48
|
if (stamped) return;
|
|
49
49
|
stamped = true;
|
|
50
50
|
stampModuleIdentity({
|
|
51
|
-
version: "0.6.
|
|
51
|
+
version: "0.6.35",
|
|
52
52
|
path: typeof __filename === "string" ? __filename : require("url").pathToFileURL(__filename).href
|
|
53
53
|
});
|
|
54
54
|
}
|
|
@@ -593,21 +593,41 @@ function nextScopeId() {
|
|
|
593
593
|
|
|
594
594
|
//#endregion
|
|
595
595
|
//#region packages/moost/src/binding/utils.ts
|
|
596
|
-
/**
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
596
|
+
/**
|
|
597
|
+
* Returns the own method names of an instance, including inherited methods
|
|
598
|
+
* from parent classes.
|
|
599
|
+
*
|
|
600
|
+
* Classification is descriptor-based and NEVER invokes accessors: a property
|
|
601
|
+
* is a method only when its nearest descriptor is a DATA property holding a
|
|
602
|
+
* function. Accessor properties (get/set) are classified as props, not
|
|
603
|
+
* methods — evaluating `instance[name]` to test them would fire the getter,
|
|
604
|
+
* and getters are allowed to throw (e.g. moost-db's `.table` throws for
|
|
605
|
+
* view-bound controllers), which used to turn a mere method scan into a
|
|
606
|
+
* crash.
|
|
607
|
+
*/ function getInstanceOwnMethods(instance) {
|
|
608
|
+
return collectByDescriptor(instance, true);
|
|
609
|
+
}
|
|
610
|
+
/** Returns the own non-method property names of an instance, including inherited properties. Accessor properties are always included (their getters are never invoked — see {@link getInstanceOwnMethods}). */ function getInstanceOwnProps(instance) {
|
|
611
|
+
return collectByDescriptor(instance, false);
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Walks the prototype chain (instance own names first, then each prototype up
|
|
615
|
+
* to but excluding `Object.prototype`) and classifies every name by its
|
|
616
|
+
* NEAREST descriptor — matching JS property-resolution order, so an instance
|
|
617
|
+
* field shadowing a prototype method is classified by the instance field.
|
|
618
|
+
*/ function collectByDescriptor(instance, wantMethods) {
|
|
619
|
+
const seen = /* @__PURE__ */ new Set();
|
|
620
|
+
const out = [];
|
|
621
|
+
let obj = instance;
|
|
622
|
+
while (obj && obj !== Object.prototype) {
|
|
623
|
+
for (const name of Object.getOwnPropertyNames(obj)) {
|
|
624
|
+
if (seen.has(name)) continue;
|
|
625
|
+
seen.add(name);
|
|
626
|
+
if (typeof Object.getOwnPropertyDescriptor(obj, name).value === "function" === wantMethods) out.push(name);
|
|
627
|
+
}
|
|
628
|
+
obj = Object.getPrototypeOf(obj);
|
|
629
|
+
}
|
|
630
|
+
return out;
|
|
611
631
|
}
|
|
612
632
|
/**
|
|
613
633
|
* Walks the user-defined ancestor classes of a constructor, closest first.
|
|
@@ -619,11 +639,6 @@ function nextScopeId() {
|
|
|
619
639
|
parent = Object.getPrototypeOf(parent);
|
|
620
640
|
}
|
|
621
641
|
}
|
|
622
|
-
function getParentProps(constructor) {
|
|
623
|
-
const props = [];
|
|
624
|
-
for (const parent of ancestorsOf(constructor)) props.unshift(...Object.getOwnPropertyNames(parent.prototype));
|
|
625
|
-
return props;
|
|
626
|
-
}
|
|
627
642
|
|
|
628
643
|
//#endregion
|
|
629
644
|
//#region packages/moost/src/decorators/circular.decorator.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -1114,9 +1114,20 @@ declare function registerEventScope(scopeId: string): () => void;
|
|
|
1114
1114
|
*/
|
|
1115
1115
|
declare function defineMoostEventHandler<T>(options: TMoostEventHandlerOptions<T>): () => unknown;
|
|
1116
1116
|
|
|
1117
|
-
/**
|
|
1117
|
+
/**
|
|
1118
|
+
* Returns the own method names of an instance, including inherited methods
|
|
1119
|
+
* from parent classes.
|
|
1120
|
+
*
|
|
1121
|
+
* Classification is descriptor-based and NEVER invokes accessors: a property
|
|
1122
|
+
* is a method only when its nearest descriptor is a DATA property holding a
|
|
1123
|
+
* function. Accessor properties (get/set) are classified as props, not
|
|
1124
|
+
* methods — evaluating `instance[name]` to test them would fire the getter,
|
|
1125
|
+
* and getters are allowed to throw (e.g. moost-db's `.table` throws for
|
|
1126
|
+
* view-bound controllers), which used to turn a mere method scan into a
|
|
1127
|
+
* crash.
|
|
1128
|
+
*/
|
|
1118
1129
|
declare function getInstanceOwnMethods<T = TAny>(instance: T): (keyof T)[];
|
|
1119
|
-
/** Returns the own non-method property names of an instance, including inherited properties. */
|
|
1130
|
+
/** Returns the own non-method property names of an instance, including inherited properties. Accessor properties are always included (their getters are never invoked — see {@link getInstanceOwnMethods}). */
|
|
1120
1131
|
declare function getInstanceOwnProps<T = TAny>(instance: T): (keyof T)[];
|
|
1121
1132
|
|
|
1122
1133
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -47,7 +47,7 @@ let stamped = false;
|
|
|
47
47
|
if (stamped) return;
|
|
48
48
|
stamped = true;
|
|
49
49
|
stampModuleIdentity({
|
|
50
|
-
version: "0.6.
|
|
50
|
+
version: "0.6.35",
|
|
51
51
|
path: typeof __filename === "string" ? __filename : import.meta.url
|
|
52
52
|
});
|
|
53
53
|
}
|
|
@@ -592,21 +592,41 @@ function nextScopeId() {
|
|
|
592
592
|
|
|
593
593
|
//#endregion
|
|
594
594
|
//#region packages/moost/src/binding/utils.ts
|
|
595
|
-
/**
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
595
|
+
/**
|
|
596
|
+
* Returns the own method names of an instance, including inherited methods
|
|
597
|
+
* from parent classes.
|
|
598
|
+
*
|
|
599
|
+
* Classification is descriptor-based and NEVER invokes accessors: a property
|
|
600
|
+
* is a method only when its nearest descriptor is a DATA property holding a
|
|
601
|
+
* function. Accessor properties (get/set) are classified as props, not
|
|
602
|
+
* methods — evaluating `instance[name]` to test them would fire the getter,
|
|
603
|
+
* and getters are allowed to throw (e.g. moost-db's `.table` throws for
|
|
604
|
+
* view-bound controllers), which used to turn a mere method scan into a
|
|
605
|
+
* crash.
|
|
606
|
+
*/ function getInstanceOwnMethods(instance) {
|
|
607
|
+
return collectByDescriptor(instance, true);
|
|
608
|
+
}
|
|
609
|
+
/** Returns the own non-method property names of an instance, including inherited properties. Accessor properties are always included (their getters are never invoked — see {@link getInstanceOwnMethods}). */ function getInstanceOwnProps(instance) {
|
|
610
|
+
return collectByDescriptor(instance, false);
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Walks the prototype chain (instance own names first, then each prototype up
|
|
614
|
+
* to but excluding `Object.prototype`) and classifies every name by its
|
|
615
|
+
* NEAREST descriptor — matching JS property-resolution order, so an instance
|
|
616
|
+
* field shadowing a prototype method is classified by the instance field.
|
|
617
|
+
*/ function collectByDescriptor(instance, wantMethods) {
|
|
618
|
+
const seen = /* @__PURE__ */ new Set();
|
|
619
|
+
const out = [];
|
|
620
|
+
let obj = instance;
|
|
621
|
+
while (obj && obj !== Object.prototype) {
|
|
622
|
+
for (const name of Object.getOwnPropertyNames(obj)) {
|
|
623
|
+
if (seen.has(name)) continue;
|
|
624
|
+
seen.add(name);
|
|
625
|
+
if (typeof Object.getOwnPropertyDescriptor(obj, name).value === "function" === wantMethods) out.push(name);
|
|
626
|
+
}
|
|
627
|
+
obj = Object.getPrototypeOf(obj);
|
|
628
|
+
}
|
|
629
|
+
return out;
|
|
610
630
|
}
|
|
611
631
|
/**
|
|
612
632
|
* Walks the user-defined ancestor classes of a constructor, closest first.
|
|
@@ -618,11 +638,6 @@ function nextScopeId() {
|
|
|
618
638
|
parent = Object.getPrototypeOf(parent);
|
|
619
639
|
}
|
|
620
640
|
}
|
|
621
|
-
function getParentProps(constructor) {
|
|
622
|
-
const props = [];
|
|
623
|
-
for (const parent of ancestorsOf(constructor)) props.unshift(...Object.getOwnPropertyNames(parent.prototype));
|
|
624
|
-
return props;
|
|
625
|
-
}
|
|
626
641
|
|
|
627
642
|
//#endregion
|
|
628
643
|
//#region packages/moost/src/decorators/circular.decorator.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "moost",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.35",
|
|
4
4
|
"description": "moost",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"composables",
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
"@prostojs/infact": "^0.5.0",
|
|
42
42
|
"@prostojs/logger": "^0.4.3",
|
|
43
43
|
"@prostojs/mate": "^0.5.0",
|
|
44
|
-
"@wooksjs/event-core": "^0.7.
|
|
44
|
+
"@wooksjs/event-core": "^0.7.22",
|
|
45
45
|
"hookable": "^5.5.3",
|
|
46
|
-
"wooks": "^0.7.
|
|
46
|
+
"wooks": "^0.7.22"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@wooksjs/event-http": "^0.7.
|
|
50
|
-
"@wooksjs/http-body": "^0.7.
|
|
51
|
-
"vitest": "3.2.
|
|
52
|
-
"@moostjs/event-http": "^0.6.
|
|
49
|
+
"@wooksjs/event-http": "^0.7.22",
|
|
50
|
+
"@wooksjs/http-body": "^0.7.22",
|
|
51
|
+
"vitest": "3.2.7",
|
|
52
|
+
"@moostjs/event-http": "^0.6.35"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"pub": "pnpm publish --access public",
|