@drunkcod/argis 0.0.18 → 0.0.19

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/lib/Json.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AnyFn, IfOptional, Pretty, Tagged, TagCycle, TagCycles } from './TypeUtils.js';
1
+ import { AnyFn, IfOptional, Pretty, Tagged, TagCycle, TagCycles, IsAny } from './TypeUtils.js';
2
2
  export interface Jsonable<Json> {
3
3
  toJSON(): Json;
4
4
  }
@@ -21,7 +21,7 @@ type _JsonObject<T, K extends Keys<T, any>> = {
21
21
  } & {
22
22
  [P in K['optional']]?: Pretty<_Json<T[P]>>;
23
23
  };
24
- type _Json<T, IsRoot = true> = T extends TagCycle<infer X> ? (X extends Jsonable<infer J> ? Json<J, false> : JsonCycleError<X>) : T extends Jsonable<infer J> ? (IsRoot extends true ? Json<J, false> : _Json<Omit<T, 'toJSON'>>) : T extends NeverJson ? never : T extends EmptyJson ? Record<string, never> : T extends bigint ? JsonError<'bigint-not-serializeable'> : T extends readonly any[] ? {
24
+ type _Json<T, IsRoot = true> = IsAny<T> extends true ? any : T extends TagCycle<infer X> ? (X extends Jsonable<infer J> ? Json<J, false> : JsonCycleError<X>) : T extends Jsonable<infer J> ? (IsRoot extends true ? Json<J, false> : _Json<Omit<T, 'toJSON'>>) : T extends NeverJson ? never : T extends EmptyJson ? Record<string, never> : T extends bigint ? JsonError<'bigint-not-serializeable'> : T extends readonly any[] ? {
25
25
  [I in keyof T]: [_Json<T[I]>] extends [never] ? null : Pretty<_Json<T[I]>>;
26
26
  } : T extends object ? JsonObject<T> : T;
27
27
  export type Json<T, IsRoot = true> = Pretty<_Json<TagCycles<T>, IsRoot>>;
package/lib/cjs/Json.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AnyFn, IfOptional, Pretty, Tagged, TagCycle, TagCycles } from './TypeUtils.js';
1
+ import { AnyFn, IfOptional, Pretty, Tagged, TagCycle, TagCycles, IsAny } from './TypeUtils.js';
2
2
  export interface Jsonable<Json> {
3
3
  toJSON(): Json;
4
4
  }
@@ -21,7 +21,7 @@ type _JsonObject<T, K extends Keys<T, any>> = {
21
21
  } & {
22
22
  [P in K['optional']]?: Pretty<_Json<T[P]>>;
23
23
  };
24
- type _Json<T, IsRoot = true> = T extends TagCycle<infer X> ? (X extends Jsonable<infer J> ? Json<J, false> : JsonCycleError<X>) : T extends Jsonable<infer J> ? (IsRoot extends true ? Json<J, false> : _Json<Omit<T, 'toJSON'>>) : T extends NeverJson ? never : T extends EmptyJson ? Record<string, never> : T extends bigint ? JsonError<'bigint-not-serializeable'> : T extends readonly any[] ? {
24
+ type _Json<T, IsRoot = true> = IsAny<T> extends true ? any : T extends TagCycle<infer X> ? (X extends Jsonable<infer J> ? Json<J, false> : JsonCycleError<X>) : T extends Jsonable<infer J> ? (IsRoot extends true ? Json<J, false> : _Json<Omit<T, 'toJSON'>>) : T extends NeverJson ? never : T extends EmptyJson ? Record<string, never> : T extends bigint ? JsonError<'bigint-not-serializeable'> : T extends readonly any[] ? {
25
25
  [I in keyof T]: [_Json<T[I]>] extends [never] ? null : Pretty<_Json<T[I]>>;
26
26
  } : T extends object ? JsonObject<T> : T;
27
27
  export type Json<T, IsRoot = true> = Pretty<_Json<TagCycles<T>, IsRoot>>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@drunkcod/argis",
3
3
  "type": "module",
4
- "version": "0.0.18",
4
+ "version": "0.0.19",
5
5
  "description": "A tiny, type-first toolkit for runtime argument validation and structural object utilities.",
6
6
  "scripts": {
7
7
  "clean": "rimraf lib",