@web-ts-toolkit/access-router 0.65.1 → 0.67.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/MIGRATION.md +1089 -0
- package/README.md +480 -665
- package/advanced.d.mts +2 -1
- package/advanced.d.ts +2 -1
- package/advanced.js +1873 -816
- package/advanced.mjs +1618 -561
- package/index.d.mts +38 -26
- package/index.d.ts +38 -26
- package/index.js +11981 -11341
- package/index.mjs +11853 -11218
- package/llms.txt +8 -3
- package/package.json +4 -4
- package/{parsers-h_oU4bB0.d.mts → parsers-fSBARZSn.d.mts} +2700 -2946
- package/{parsers-h_oU4bB0.d.ts → parsers-fSBARZSn.d.ts} +2700 -2946
- package/processors.js +13 -1
- package/processors.mjs +13 -1
package/processors.js
CHANGED
|
@@ -31,6 +31,7 @@ var import_utils2 = require("@web-ts-toolkit/utils");
|
|
|
31
31
|
|
|
32
32
|
// src/output/permissions-alias.ts
|
|
33
33
|
var import_utils = require("@web-ts-toolkit/utils");
|
|
34
|
+
var import_node_util = require("util");
|
|
34
35
|
var aliases = /* @__PURE__ */ new WeakMap();
|
|
35
36
|
function attachPermissionsAlias(output, field) {
|
|
36
37
|
if ("permissions" in output) return;
|
|
@@ -47,7 +48,18 @@ function attachPermissionsAlias(output, field) {
|
|
|
47
48
|
function copyPermissionsAlias(source, target) {
|
|
48
49
|
if (source && typeof source === "object" && target && typeof target === "object") {
|
|
49
50
|
const field = aliases.get(source);
|
|
50
|
-
|
|
51
|
+
const readData = (value) => {
|
|
52
|
+
const parts = field?.split(".") ?? [];
|
|
53
|
+
if (parts.length > 100) return void 0;
|
|
54
|
+
for (const key of parts) {
|
|
55
|
+
if (!value || typeof value !== "object" || import_node_util.types.isProxy(value)) return void 0;
|
|
56
|
+
const slot = Object.getOwnPropertyDescriptor(value, key);
|
|
57
|
+
if (!slot || !("value" in slot)) return void 0;
|
|
58
|
+
value = slot.value;
|
|
59
|
+
}
|
|
60
|
+
return value;
|
|
61
|
+
};
|
|
62
|
+
if (field && readData(target) !== void 0 && Object.getOwnPropertyDescriptor(source, "permissions")?.value === readData(source))
|
|
51
63
|
attachPermissionsAlias(target, field);
|
|
52
64
|
}
|
|
53
65
|
return target;
|
package/processors.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { cloneDeep, forEach, get as get2, hasOwn, isArray, isPlainObject, map, s
|
|
|
3
3
|
|
|
4
4
|
// src/output/permissions-alias.ts
|
|
5
5
|
import { get } from "@web-ts-toolkit/utils";
|
|
6
|
+
import { types } from "util";
|
|
6
7
|
var aliases = /* @__PURE__ */ new WeakMap();
|
|
7
8
|
function attachPermissionsAlias(output, field) {
|
|
8
9
|
if ("permissions" in output) return;
|
|
@@ -19,7 +20,18 @@ function attachPermissionsAlias(output, field) {
|
|
|
19
20
|
function copyPermissionsAlias(source, target) {
|
|
20
21
|
if (source && typeof source === "object" && target && typeof target === "object") {
|
|
21
22
|
const field = aliases.get(source);
|
|
22
|
-
|
|
23
|
+
const readData = (value) => {
|
|
24
|
+
const parts = field?.split(".") ?? [];
|
|
25
|
+
if (parts.length > 100) return void 0;
|
|
26
|
+
for (const key of parts) {
|
|
27
|
+
if (!value || typeof value !== "object" || types.isProxy(value)) return void 0;
|
|
28
|
+
const slot = Object.getOwnPropertyDescriptor(value, key);
|
|
29
|
+
if (!slot || !("value" in slot)) return void 0;
|
|
30
|
+
value = slot.value;
|
|
31
|
+
}
|
|
32
|
+
return value;
|
|
33
|
+
};
|
|
34
|
+
if (field && readData(target) !== void 0 && Object.getOwnPropertyDescriptor(source, "permissions")?.value === readData(source))
|
|
23
35
|
attachPermissionsAlias(target, field);
|
|
24
36
|
}
|
|
25
37
|
return target;
|