jurist 0.0.10 → 0.0.11
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/LICENSE +5 -0
- package/dist/jurist.d.ts +8 -10
- package/dist/jurist.d.ts.map +1 -1
- package/dist/jurist.js.map +1 -1
- package/package.json +11 -11
- package/src/jurist.ts +1 -1
package/LICENSE
ADDED
package/dist/jurist.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { Join, Tree, TreePathName } from "treetrunks";
|
|
2
2
|
export * from "treetrunks";
|
|
3
|
-
|
|
4
3
|
//#region src/jurist.d.ts
|
|
5
|
-
type Roles<L extends Laws<any, any, any, any>> = L extends Laws<infer Role, any, any, any> ? Role : never;
|
|
6
|
-
type Permissions<L extends Laws<any, any, any, any>> = L extends Laws<any, any, infer Permission, any> ? Permission : never;
|
|
7
|
-
type PermissionData<L extends Laws<any, any, any, any>, D> = Entries<Permissions<L>, D>;
|
|
8
|
-
declare class Laws<Role extends string, PermissionTree extends Tree, Permission extends Join<TreePathName<PermissionTree>, `_`>, RolePermissions extends { [r in Role]: ReadonlySet<Permission
|
|
4
|
+
export type Roles<L extends Laws<any, any, any, any>> = L extends Laws<infer Role, any, any, any> ? Role : never;
|
|
5
|
+
export type Permissions<L extends Laws<any, any, any, any>> = L extends Laws<any, any, infer Permission, any> ? Permission : never;
|
|
6
|
+
export type PermissionData<L extends Laws<any, any, any, any>, D> = Entries<Permissions<L>, D>;
|
|
7
|
+
export declare class Laws<Role extends string, PermissionTree extends Tree, Permission extends Join<TreePathName<PermissionTree>, `_`>, RolePermissions extends { [r in Role]: ReadonlySet<Permission>; }> {
|
|
9
8
|
readonly roles: Role[];
|
|
10
9
|
readonly permissionTree: PermissionTree;
|
|
11
10
|
readonly rolePermissions: RolePermissions;
|
|
12
|
-
protected readonly decompressedRolePermissions: { [r in Role]: ReadonlySet<string
|
|
11
|
+
protected readonly decompressedRolePermissions: { [r in Role]: ReadonlySet<string>; };
|
|
13
12
|
constructor(options: {
|
|
14
13
|
roles: Role[];
|
|
15
14
|
permissions: PermissionTree;
|
|
@@ -17,8 +16,8 @@ declare class Laws<Role extends string, PermissionTree extends Tree, Permission
|
|
|
17
16
|
});
|
|
18
17
|
check(role: Role, permission: Permission): boolean;
|
|
19
18
|
}
|
|
20
|
-
type EscalatorStyle = `firstFound` | `lastFound` | `untilMiss`;
|
|
21
|
-
declare class Escalator<S extends EscalatorStyle, L extends Laws<any, any, any, any>, P extends PermissionData<L, any>, D extends (P extends PermissionData<L, infer d> ? d : never), F> {
|
|
19
|
+
export type EscalatorStyle = `firstFound` | `lastFound` | `untilMiss`;
|
|
20
|
+
export declare class Escalator<S extends EscalatorStyle, L extends Laws<any, any, any, any>, P extends PermissionData<L, any>, D extends (P extends PermissionData<L, infer d> ? d : never), F> {
|
|
22
21
|
readonly style: S;
|
|
23
22
|
readonly laws: L;
|
|
24
23
|
readonly permissionData: P;
|
|
@@ -31,8 +30,7 @@ declare class Escalator<S extends EscalatorStyle, L extends Laws<any, any, any,
|
|
|
31
30
|
}>);
|
|
32
31
|
get(role: Roles<L>): D | F;
|
|
33
32
|
}
|
|
34
|
-
type Count<N extends number, A extends any[] = []> = [...A, any][`length`] extends N ? A[`length`] : A[`length`] | Count<N, [...A, any]>;
|
|
33
|
+
export type Count<N extends number, A extends any[] = []> = [...A, any][`length`] extends N ? A[`length`] : A[`length`] | Count<N, [...A, any]>;
|
|
35
34
|
type Entries<K extends PropertyKey = PropertyKey, V = any> = [K, V][];
|
|
36
35
|
//#endregion
|
|
37
|
-
export { Count, Escalator, EscalatorStyle, Laws, PermissionData, Permissions, Roles };
|
|
38
36
|
//# sourceMappingURL=jurist.d.ts.map
|
package/dist/jurist.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jurist.d.ts","names":[],"sources":["../src/jurist.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"jurist.d.ts","names":[],"sources":["../src/jurist.ts"],"mappings":";;;YAIY,MAAM,UAAU,4BAC3B,UAAU,WAAW,uBAAuB;YAEjC,YAAY,UAAU,4BACjC,UAAU,qBAAqB,mBAAmB;YAEvC,eAAe,UAAU,0BAA0B,KAAK,QACnE,YAAY,IACZ;qBAGY,KACZ,qBACA,uBAAuB,MACvB,mBAAmB,KAAK,aAAa,uBACrC,2BAA2B,KAAK,OAAO,YAAY;WAEnC,OAAO;WACP,gBAAgB;WAChB,iBAAiB;qBACd,gCACjB,KAAK,OAAO;EAGd,YAAmB;IAClB,OAAO;IACP,aAAa;IACb,iBAAiB;;EAgBlB,MAAa,MAAM,MAAM,YAAY;;YAmB1B;qBACC,UACZ,UAAU,gBACV,UAAU,0BACV,UAAU,eAAe,SACzB,WAAW,UAAU,eAAe,SAAS,KAAK,YAClD;WAEgB,OAAO;WACP,MAAM;WACN,gBAAgB;WAChB,UAAU;EAC1B,YACC,SAAS;IACR,OAAO;IACP,MAAM;IACN,gBAAgB;IAChB,UAAU;;EAUZ,IAAW,MAAM,MAAM,KAAK,IAAI;;YAwBrB,MAAM,kBAAkB,4BAChC,0BAEgB,IACjB,cACA,cAAc,MAAM,OAAO;KAEzB,QAAQ,UAAU,cAAc,aAAa,YAAY,GAAG"}
|
package/dist/jurist.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jurist.js","names":[],"sources":["../src/jurist.ts"],"sourcesContent":["import type { Join, Tree, TreePathName } from \"treetrunks\"\n\nexport * from \"treetrunks\"\n\nexport type Roles<L extends Laws<any, any, any, any>> =\n\tL extends Laws<infer Role, any, any, any> ? Role : never\n\nexport type Permissions<L extends Laws<any, any, any, any>> =\n\tL extends Laws<any, any, infer Permission, any> ? Permission : never\n\nexport type PermissionData<L extends Laws<any, any, any, any>, D> = Entries<\n\tPermissions<L>,\n\tD\n>\n\nexport class Laws<\n\tRole extends string,\n\tPermissionTree extends Tree,\n\tPermission extends Join<TreePathName<PermissionTree>, `_`>,\n\tRolePermissions extends { [r in Role]: ReadonlySet<Permission> },\n> {\n\tpublic readonly roles: Role[]\n\tpublic readonly permissionTree: PermissionTree\n\tpublic readonly rolePermissions: RolePermissions\n\tprotected readonly decompressedRolePermissions: {\n\t\t[r in Role]: ReadonlySet<string>\n\t}\n\n\tpublic constructor(options: {\n\t\troles: Role[]\n\t\tpermissions: PermissionTree\n\t\trolePermissions: RolePermissions\n\t}) {\n\t\tconst { roles, permissions, rolePermissions } = options\n\t\tthis.roles = roles\n\t\tthis.permissionTree = permissions\n\t\tthis.rolePermissions = rolePermissions\n\t\tthis.decompressedRolePermissions = fromEntries(\n\t\t\ttoEntries<RolePermissions>(rolePermissions).map(\n\t\t\t\t([role, permissionsOfRole]) => [\n\t\t\t\t\trole,\n\t\t\t\t\tdecompressRolePermissions(permissionsOfRole),\n\t\t\t\t],\n\t\t\t),\n\t\t)\n\t}\n\n\tpublic check(role: Role, permission: Permission): boolean {\n\t\treturn this.decompressedRolePermissions[role].has(permission)\n\t}\n}\n\nfunction decompressRolePermissions(\n\tpermissionSet: ReadonlySet<string>,\n): ReadonlySet<string> {\n\tconst decompressed = new Set<string>(permissionSet)\n\tfor (const permission of permissionSet) {\n\t\tconst preconditions = permission.split(`_`)\n\t\tfor (let i = 0; i < preconditions.length - 1; i++) {\n\t\t\tconst subPermission = preconditions.slice(0, i + 1).join(`_`)\n\t\t\tdecompressed.add(subPermission)\n\t\t}\n\t}\n\treturn decompressed\n}\n\nexport type EscalatorStyle = `firstFound` | `lastFound` | `untilMiss`\nexport class Escalator<\n\tS extends EscalatorStyle,\n\tL extends Laws<any, any, any, any>,\n\tP extends PermissionData<L, any>,\n\tD extends P extends PermissionData<L, infer d> ? d : never,\n\tF,\n> {\n\tpublic readonly style: S\n\tpublic readonly laws: L\n\tpublic readonly permissionData: P\n\tpublic readonly fallback: F\n\tpublic constructor(\n\t\toptions: Readonly<{\n\t\t\tstyle: S\n\t\t\tlaws: L\n\t\t\tpermissionData: P\n\t\t\tfallback: F\n\t\t}>,\n\t) {\n\t\tconst { style, laws, permissionData, fallback } = options\n\t\tthis.style = style\n\t\tthis.laws = laws\n\t\tthis.permissionData = permissionData\n\t\tthis.fallback = fallback\n\t}\n\n\tpublic get(role: Roles<L>): D | F {\n\t\tlet result: D | F = this.fallback\n\t\tfor (const [permission, data] of this.permissionData) {\n\t\t\tconst hasPermission = this.laws.check(role, permission)\n\t\t\tswitch (this.style) {\n\t\t\t\tcase `firstFound`:\n\t\t\t\t\tif (hasPermission) return data\n\t\t\t\t\tbreak\n\t\t\t\tcase `lastFound`:\n\t\t\t\t\tif (hasPermission) result = data\n\t\t\t\t\tbreak\n\t\t\t\tcase `untilMiss`:\n\t\t\t\t\tif (hasPermission) result = data\n\t\t\t\t\telse return result\n\t\t\t}\n\t\t}\n\t\treturn result\n\t}\n}\n\ntype Flat<R extends { [K in PropertyKey]: any }> = {\n\t[K in keyof R]: R[K]\n}\n\nexport type Count<N extends number, A extends any[] = []> = [\n\t...A,\n\tany,\n][`length`] extends N\n\t? A[`length`]\n\t: A[`length`] | Count<N, [...A, any]>\n\ntype Entries<K extends PropertyKey = PropertyKey, V = any> = [K, V][]\n\ntype KeyOfEntries<E extends Entries> = E extends [infer K, any][] ? K : never\n\ntype ValueOfEntry<E extends Entries, K extends KeyOfEntries<E>> = {\n\t[P in Count<E[`length`]>]: E[P] extends [K, infer V] ? V : never\n}[Count<E[`length`]>]\n\ntype FromEntries<E extends Entries> = Flat<{\n\t[K in KeyOfEntries<E>]: ValueOfEntry<E, K>\n}>\n\nfunction fromEntries<E extends Entries>(entries: E): FromEntries<E> {\n\treturn Object.fromEntries(entries) as FromEntries<E>\n}\n\nfunction toEntries<T extends object>(obj: T): Entries<keyof T, T[keyof T]> {\n\treturn Object.entries(obj) as Entries<keyof T, T[keyof T]>\n}\n"],"mappings":";;AAeA,IAAa,OAAb,MAKE;CACD;CACA;CACA;CACA;CAIA,YAAmB,SAIhB;EACF,MAAM,EAAE,OAAO,aAAa,oBAAoB;EAChD,KAAK,QAAQ;EACb,KAAK,iBAAiB;EACtB,KAAK,kBAAkB;EACvB,KAAK,8BAA8B,YAClC,UAA2B,eAAe,CAAC,CAAC,KAC1C,CAAC,MAAM,uBAAuB,CAC9B,MACA,0BAA0B,iBAAiB,CAC5C,CACD,CACD;CACD;CAEA,MAAa,MAAY,YAAiC;EACzD,OAAO,KAAK,4BAA4B,KAAK,CAAC,IAAI,UAAU;CAC7D;AACD;AAEA,SAAS,0BACR,eACsB;CACtB,MAAM,eAAe,IAAI,IAAY,aAAa;CAClD,KAAK,MAAM,cAAc,eAAe;EACvC,MAAM,gBAAgB,WAAW,MAAM,GAAG;EAC1C,KAAK,IAAI,IAAI,GAAG,IAAI,cAAc,SAAS,GAAG,KAAK;GAClD,MAAM,gBAAgB,cAAc,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG;GAC5D,aAAa,IAAI,aAAa;EAC/B;CACD;CACA,OAAO;AACR;AAGA,IAAa,YAAb,MAME;CACD;CACA;CACA;CACA;CACA,YACC,SAMC;EACD,MAAM,EAAE,OAAO,MAAM,gBAAgB,aAAa;EAClD,KAAK,QAAQ;EACb,KAAK,OAAO;EACZ,KAAK,iBAAiB;EACtB,KAAK,WAAW;CACjB;CAEA,IAAW,MAAuB;EACjC,IAAI,SAAgB,KAAK;EACzB,KAAK,MAAM,CAAC,YAAY,SAAS,KAAK,gBAAgB;GACrD,MAAM,gBAAgB,KAAK,KAAK,MAAM,MAAM,UAAU;GACtD,QAAQ,KAAK,OAAb;IACC,KAAK;KACJ,IAAI,eAAe,OAAO;KAC1B;IACD,KAAK;KACJ,IAAI,eAAe,SAAS;KAC5B;IACD,KAAK,aACJ,IAAI,eAAe,SAAS;SACvB,OAAO;GACd;EACD;EACA,OAAO;CACR;AACD;AAyBA,SAAS,YAA+B,SAA4B;CACnE,OAAO,OAAO,YAAY,OAAO;AAClC;AAEA,SAAS,UAA4B,KAAsC;CAC1E,OAAO,OAAO,QAAQ,GAAG;AAC1B"}
|
|
1
|
+
{"version":3,"file":"jurist.js","names":[],"sources":["../src/jurist.ts"],"sourcesContent":["import type { Join, Tree, TreePathName } from \"treetrunks\"\n\nexport * from \"treetrunks\"\n\nexport type Roles<L extends Laws<any, any, any, any>> =\n\tL extends Laws<infer Role, any, any, any> ? Role : never\n\nexport type Permissions<L extends Laws<any, any, any, any>> =\n\tL extends Laws<any, any, infer Permission, any> ? Permission : never\n\nexport type PermissionData<L extends Laws<any, any, any, any>, D> = Entries<\n\tPermissions<L>,\n\tD\n>\n\nexport class Laws<\n\tRole extends string,\n\tPermissionTree extends Tree,\n\tPermission extends Join<TreePathName<PermissionTree>, `_`>,\n\tRolePermissions extends { [r in Role]: ReadonlySet<Permission> },\n> {\n\tpublic readonly roles: Role[]\n\tpublic readonly permissionTree: PermissionTree\n\tpublic readonly rolePermissions: RolePermissions\n\tprotected readonly decompressedRolePermissions: {\n\t\t[r in Role]: ReadonlySet<string>\n\t}\n\n\tpublic constructor(options: {\n\t\troles: Role[]\n\t\tpermissions: PermissionTree\n\t\trolePermissions: RolePermissions\n\t}) {\n\t\tconst { roles, permissions, rolePermissions } = options\n\t\tthis.roles = roles\n\t\tthis.permissionTree = permissions\n\t\tthis.rolePermissions = rolePermissions\n\t\tthis.decompressedRolePermissions = fromEntries(\n\t\t\ttoEntries<RolePermissions>(rolePermissions).map(\n\t\t\t\t([role, permissionsOfRole]) => [\n\t\t\t\t\trole,\n\t\t\t\t\tdecompressRolePermissions(permissionsOfRole),\n\t\t\t\t],\n\t\t\t),\n\t\t)\n\t}\n\n\tpublic check(role: Role, permission: Permission): boolean {\n\t\treturn this.decompressedRolePermissions[role].has(permission)\n\t}\n}\n\nfunction decompressRolePermissions(\n\tpermissionSet: ReadonlySet<string>,\n): ReadonlySet<string> {\n\tconst decompressed = new Set<string>(permissionSet)\n\tfor (const permission of permissionSet) {\n\t\tconst preconditions = permission.split(`_`)\n\t\tfor (let i = 0; i < preconditions.length - 1; i++) {\n\t\t\tconst subPermission = preconditions.slice(0, i + 1).join(`_`)\n\t\t\tdecompressed.add(subPermission)\n\t\t}\n\t}\n\treturn decompressed\n}\n\nexport type EscalatorStyle = `firstFound` | `lastFound` | `untilMiss`\nexport class Escalator<\n\tS extends EscalatorStyle,\n\tL extends Laws<any, any, any, any>,\n\tP extends PermissionData<L, any>,\n\tD extends (P extends PermissionData<L, infer d> ? d : never),\n\tF,\n> {\n\tpublic readonly style: S\n\tpublic readonly laws: L\n\tpublic readonly permissionData: P\n\tpublic readonly fallback: F\n\tpublic constructor(\n\t\toptions: Readonly<{\n\t\t\tstyle: S\n\t\t\tlaws: L\n\t\t\tpermissionData: P\n\t\t\tfallback: F\n\t\t}>,\n\t) {\n\t\tconst { style, laws, permissionData, fallback } = options\n\t\tthis.style = style\n\t\tthis.laws = laws\n\t\tthis.permissionData = permissionData\n\t\tthis.fallback = fallback\n\t}\n\n\tpublic get(role: Roles<L>): D | F {\n\t\tlet result: D | F = this.fallback\n\t\tfor (const [permission, data] of this.permissionData) {\n\t\t\tconst hasPermission = this.laws.check(role, permission)\n\t\t\tswitch (this.style) {\n\t\t\t\tcase `firstFound`:\n\t\t\t\t\tif (hasPermission) return data\n\t\t\t\t\tbreak\n\t\t\t\tcase `lastFound`:\n\t\t\t\t\tif (hasPermission) result = data\n\t\t\t\t\tbreak\n\t\t\t\tcase `untilMiss`:\n\t\t\t\t\tif (hasPermission) result = data\n\t\t\t\t\telse return result\n\t\t\t}\n\t\t}\n\t\treturn result\n\t}\n}\n\ntype Flat<R extends { [K in PropertyKey]: any }> = {\n\t[K in keyof R]: R[K]\n}\n\nexport type Count<N extends number, A extends any[] = []> = [\n\t...A,\n\tany,\n][`length`] extends N\n\t? A[`length`]\n\t: A[`length`] | Count<N, [...A, any]>\n\ntype Entries<K extends PropertyKey = PropertyKey, V = any> = [K, V][]\n\ntype KeyOfEntries<E extends Entries> = E extends [infer K, any][] ? K : never\n\ntype ValueOfEntry<E extends Entries, K extends KeyOfEntries<E>> = {\n\t[P in Count<E[`length`]>]: E[P] extends [K, infer V] ? V : never\n}[Count<E[`length`]>]\n\ntype FromEntries<E extends Entries> = Flat<{\n\t[K in KeyOfEntries<E>]: ValueOfEntry<E, K>\n}>\n\nfunction fromEntries<E extends Entries>(entries: E): FromEntries<E> {\n\treturn Object.fromEntries(entries) as FromEntries<E>\n}\n\nfunction toEntries<T extends object>(obj: T): Entries<keyof T, T[keyof T]> {\n\treturn Object.entries(obj) as Entries<keyof T, T[keyof T]>\n}\n"],"mappings":";;AAeA,IAAa,OAAb,MAKE;CACD;CACA;CACA;CACA;CAIA,YAAmB,SAIhB;EACF,MAAM,EAAE,OAAO,aAAa,oBAAoB;EAChD,KAAK,QAAQ;EACb,KAAK,iBAAiB;EACtB,KAAK,kBAAkB;EACvB,KAAK,8BAA8B,YAClC,UAA2B,eAAe,CAAC,CAAC,KAC1C,CAAC,MAAM,uBAAuB,CAC9B,MACA,0BAA0B,iBAAiB,CAC5C,CACD,CACD;CACD;CAEA,MAAa,MAAY,YAAiC;EACzD,OAAO,KAAK,4BAA4B,KAAK,CAAC,IAAI,UAAU;CAC7D;AACD;AAEA,SAAS,0BACR,eACsB;CACtB,MAAM,eAAe,IAAI,IAAY,aAAa;CAClD,KAAK,MAAM,cAAc,eAAe;EACvC,MAAM,gBAAgB,WAAW,MAAM,GAAG;EAC1C,KAAK,IAAI,IAAI,GAAG,IAAI,cAAc,SAAS,GAAG,KAAK;GAClD,MAAM,gBAAgB,cAAc,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG;GAC5D,aAAa,IAAI,aAAa;EAC/B;CACD;CACA,OAAO;AACR;AAGA,IAAa,YAAb,MAME;CACD;CACA;CACA;CACA;CACA,YACC,SAMC;EACD,MAAM,EAAE,OAAO,MAAM,gBAAgB,aAAa;EAClD,KAAK,QAAQ;EACb,KAAK,OAAO;EACZ,KAAK,iBAAiB;EACtB,KAAK,WAAW;CACjB;CAEA,IAAW,MAAuB;EACjC,IAAI,SAAgB,KAAK;EACzB,KAAK,MAAM,CAAC,YAAY,SAAS,KAAK,gBAAgB;GACrD,MAAM,gBAAgB,KAAK,KAAK,MAAM,MAAM,UAAU;GACtD,QAAQ,KAAK,OAAb;IACC,KAAK;KACJ,IAAI,eAAe,OAAO;KAC1B;IACD,KAAK;KACJ,IAAI,eAAe,SAAS;KAC5B;IACD,KAAK,aACJ,IAAI,eAAe,SAAS;SACvB,OAAO;GACd;EACD;EACA,OAAO;CACR;AACD;AAyBA,SAAS,YAA+B,SAA4B;CACnE,OAAO,OAAO,YAAY,OAAO;AAClC;AAEA,SAAS,UAA4B,KAAsC;CAC1E,OAAO,OAAO,QAAQ,GAAG;AAC1B"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jurist",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"license": "
|
|
3
|
+
"version": "0.0.11",
|
|
4
|
+
"license": "MPL-2.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jeremy Banka",
|
|
7
7
|
"email": "hello@jeremybanka.com"
|
|
@@ -21,22 +21,22 @@
|
|
|
21
21
|
],
|
|
22
22
|
"main": "dist/jurist.js",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"treetrunks": "0.1.
|
|
24
|
+
"treetrunks": "0.1.9"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"
|
|
28
|
-
"concurrently": "10.0.
|
|
29
|
-
"eslint": "10.
|
|
30
|
-
"tsdown": "0.22.
|
|
31
|
-
"vite": "8.
|
|
32
|
-
"vitest": "4.1.
|
|
27
|
+
"typescript": "7.0.2",
|
|
28
|
+
"concurrently": "10.0.5",
|
|
29
|
+
"eslint": "10.9.0",
|
|
30
|
+
"tsdown": "0.22.14",
|
|
31
|
+
"vite": "8.2.2",
|
|
32
|
+
"vitest": "4.1.11"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "tsdown",
|
|
36
36
|
"lint:eslint": "eslint -- .",
|
|
37
37
|
"lint:oxlint": "oxlint --type-aware -c ../../.oxlintrc.jsonc .",
|
|
38
|
-
"lint:types": "
|
|
39
|
-
"watch:types": "
|
|
38
|
+
"lint:types": "tsc --noEmit",
|
|
39
|
+
"watch:types": "tsc --watch --noEmit",
|
|
40
40
|
"lint": "concurrently \"bun:lint:*\"",
|
|
41
41
|
"test": "vitest",
|
|
42
42
|
"test:once": "vitest run",
|
package/src/jurist.ts
CHANGED
|
@@ -69,7 +69,7 @@ export class Escalator<
|
|
|
69
69
|
S extends EscalatorStyle,
|
|
70
70
|
L extends Laws<any, any, any, any>,
|
|
71
71
|
P extends PermissionData<L, any>,
|
|
72
|
-
D extends P extends PermissionData<L, infer d> ? d : never,
|
|
72
|
+
D extends (P extends PermissionData<L, infer d> ? d : never),
|
|
73
73
|
F,
|
|
74
74
|
> {
|
|
75
75
|
public readonly style: S
|