@akanjs/constant 1.0.6 → 1.0.7-canary.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/cjs/src/purify.js CHANGED
@@ -23,8 +23,6 @@ module.exports = __toCommonJS(purify_exports);
23
23
  var import_base = require("@akanjs/base");
24
24
  var import_common = require("@akanjs/common");
25
25
  var import__ = require(".");
26
- class PurifyStorage {
27
- }
28
26
  const scalarPurifyMap = /* @__PURE__ */ new Map([
29
27
  [Date, (value) => (0, import_base.dayjs)(value).toDate()],
30
28
  [String, (value) => value],
package/esm/src/purify.js CHANGED
@@ -9,8 +9,6 @@ import {
9
9
  } from "@akanjs/base";
10
10
  import { Logger } from "@akanjs/common";
11
11
  import { constantInfo } from ".";
12
- class PurifyStorage {
13
- }
14
12
  const scalarPurifyMap = /* @__PURE__ */ new Map([
15
13
  [Date, (value) => dayjs(value).toDate()],
16
14
  [String, (value) => value],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/constant",
3
- "version": "1.0.6",
3
+ "version": "1.0.7-canary.0",
4
4
  "sourceType": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/purify.d.ts CHANGED
@@ -4,7 +4,9 @@ type Purified<O> = O extends BaseObject ? string : O extends BaseObject[] ? stri
4
4
  [key: string]: any;
5
5
  } ? PurifiedModel<O> : O;
6
6
  type PurifiedWithObjectToId<T, StateKeys extends keyof GetStateObject<T> = keyof GetStateObject<T>> = {
7
- [K in StateKeys]: Purified<T[K]>;
7
+ [K in StateKeys as null extends T[K] ? never : K]: Purified<T[K]>;
8
+ } & {
9
+ [K in StateKeys as null extends T[K] ? K : never]?: Purified<T[K]> | undefined;
8
10
  };
9
11
  export type PurifiedModel<T> = T extends Upload[] ? FileList : T extends (infer S)[] ? PurifiedModel<S>[] : T extends string | number | boolean | Dayjs ? T : T extends Map<infer K, infer V> ? Map<K, PurifiedModel<V>> : PurifiedWithObjectToId<T>;
10
12
  export type PurifyFunc<Input, _DefaultInput = DefaultOf<Input>, _PurifiedInput = PurifiedModel<Input>> = (self: _DefaultInput, isChild?: boolean) => _PurifiedInput | null;