@makeswift/runtime 0.20.4-canary.0 → 0.20.4-canary.1

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.
@@ -36,7 +36,7 @@ async function handler(...args) {
36
36
  const supportsPreviewMode = (0, import_ts_pattern.match)(args).with(routeHandlerPattern, () => false).with(apiRoutePattern, () => true).exhaustive();
37
37
  const supportsDraftMode = (0, import_ts_pattern.match)(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
38
38
  const body = {
39
- version: "0.20.4-canary.0",
39
+ version: "0.20.4-canary.1",
40
40
  previewMode: supportsPreviewMode,
41
41
  draftMode: supportsDraftMode,
42
42
  interactionMode: true,
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,37 +15,12 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
  var deepEqual_exports = {};
30
20
  __export(deepEqual_exports, {
31
21
  default: () => deepEqual_default
32
22
  });
33
23
  module.exports = __toCommonJS(deepEqual_exports);
34
- var import_shallowEqual = __toESM(require("./shallowEqual"));
35
- const { hasOwnProperty } = Object.prototype;
36
- const deepEqual = (a, b) => {
37
- if ((0, import_shallowEqual.default)(a, b))
38
- return true;
39
- if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
40
- return false;
41
- const keysA = Object.keys(a);
42
- const keysB = Object.keys(b);
43
- if (keysA.length !== keysB.length)
44
- return false;
45
- for (let i = 0; i < keysA.length; i += 1) {
46
- if (!hasOwnProperty.call(b, keysA[i]) || // @ts-expect-error: {}[string] is OK.
47
- !deepEqual(a[keysA[i]], b[keysA[i]]))
48
- return false;
49
- }
50
- return true;
51
- };
52
- var deepEqual_default = deepEqual;
24
+ var import_controls = require("@makeswift/controls");
25
+ var deepEqual_default = import_controls.deepEqual;
53
26
  //# sourceMappingURL=deepEqual.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/deepEqual.ts"],"sourcesContent":["import shallowEqual from './shallowEqual'\n\nconst { hasOwnProperty } = Object.prototype\n\nconst deepEqual = (a: unknown, b: unknown): boolean => {\n if (shallowEqual(a, b)) return true\n\n if (typeof a !== 'object' || a === null || typeof b !== 'object' || b === null) return false\n\n const keysA = Object.keys(a)\n const keysB = Object.keys(b)\n\n if (keysA.length !== keysB.length) return false\n\n for (let i = 0; i < keysA.length; i += 1) {\n if (\n !hasOwnProperty.call(b, keysA[i]) ||\n // @ts-expect-error: {}[string] is OK.\n !deepEqual(a[keysA[i]], b[keysA[i]])\n )\n return false\n }\n\n return true\n}\n\nexport default deepEqual\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAyB;AAEzB,MAAM,EAAE,eAAe,IAAI,OAAO;AAElC,MAAM,YAAY,CAAC,GAAY,MAAwB;AACrD,UAAI,oBAAAA,SAAa,GAAG,CAAC;AAAG,WAAO;AAE/B,MAAI,OAAO,MAAM,YAAY,MAAM,QAAQ,OAAO,MAAM,YAAY,MAAM;AAAM,WAAO;AAEvF,QAAM,QAAQ,OAAO,KAAK,CAAC;AAC3B,QAAM,QAAQ,OAAO,KAAK,CAAC;AAE3B,MAAI,MAAM,WAAW,MAAM;AAAQ,WAAO;AAE1C,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,GAAG;AACxC,QACE,CAAC,eAAe,KAAK,GAAG,MAAM,CAAC,CAAC;AAAA,IAEhC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;AAEnC,aAAO;AAAA,EACX;AAEA,SAAO;AACT;AAEA,IAAO,oBAAQ;","names":["shallowEqual"]}
1
+ {"version":3,"sources":["../../../src/utils/deepEqual.ts"],"sourcesContent":["import { deepEqual } from '@makeswift/controls'\n\nexport default deepEqual\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA0B;AAE1B,IAAO,oBAAQ;","names":[]}
@@ -18,12 +18,9 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var is_exports = {};
20
20
  __export(is_exports, {
21
- default: () => is
21
+ default: () => is_default
22
22
  });
23
23
  module.exports = __toCommonJS(is_exports);
24
- function is(x, y) {
25
- if (x === y)
26
- return x !== 0 || y !== 0 || 1 / x === 1 / y;
27
- return x !== x && y !== y;
28
- }
24
+ var import_controls = require("@makeswift/controls");
25
+ var is_default = import_controls.is;
29
26
  //# sourceMappingURL=is.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/is.ts"],"sourcesContent":["export default function is(x: unknown, y: unknown): boolean {\n if (x === y) return x !== 0 || y !== 0 || 1 / x === 1 / y\n\n return x !== x && y !== y\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAe,SAAR,GAAoB,GAAY,GAAqB;AAC1D,MAAI,MAAM;AAAG,WAAO,MAAM,KAAK,MAAM,KAAK,IAAI,MAAM,IAAI;AAExD,SAAO,MAAM,KAAK,MAAM;AAC1B;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/is.ts"],"sourcesContent":["import { is } from '@makeswift/controls'\n\nexport default is\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAmB;AAEnB,IAAO,aAAQ;","names":[]}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var partition_exports = {};
20
+ __export(partition_exports, {
21
+ partition: () => partition,
22
+ partitionRecord: () => partitionRecord
23
+ });
24
+ module.exports = __toCommonJS(partition_exports);
25
+ function partition(array, predicate) {
26
+ return array.reduce(
27
+ (result, value) => {
28
+ result[predicate(value) ? 0 : 1].push(value);
29
+ return result;
30
+ },
31
+ [[], []]
32
+ );
33
+ }
34
+ function partitionRecord(obj, predicate) {
35
+ return Object.entries(obj).reduce(
36
+ (result, [key, value]) => {
37
+ result[predicate(value) ? 0 : 1][key] = value;
38
+ return result;
39
+ },
40
+ [{}, {}]
41
+ );
42
+ }
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ partition,
46
+ partitionRecord
47
+ });
48
+ //# sourceMappingURL=partition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/partition.ts"],"sourcesContent":["type Predicate<T, U extends T> = (value: T) => value is U\n\n/**\n * Splits the array into two based on the predicate's result. Returns a tuple of arrays with\n * matching and non-matching elements, maintaining the original order within each group.\n *\n * If the predicate includes a type assertion, the resulting arrays will be typed accordingly.\n */\nexport function partition<T, U extends T>(\n array: readonly T[],\n predicate: Predicate<T, U>,\n): [U[], Exclude<T, U>[]]\n\nexport function partition<T>(array: readonly T[], predicate: (value: T) => boolean): [T[], T[]]\n\nexport function partition(\n array: readonly unknown[],\n predicate: (value: unknown) => boolean,\n): [unknown[], unknown[]] {\n return array.reduce(\n (result: [unknown[], unknown[]], value) => {\n result[predicate(value) ? 0 : 1].push(value)\n return result\n },\n [[], []],\n )\n}\n\ntype R = Record<string, unknown>\n\n/**\n * Splits the record into two based on the predicate's result. Returns a tuple of records with\n * matching and non-matching elements.\n *\n * If the predicate includes a type assertion, the resulting records will be typed accordingly.\n */\nexport function partitionRecord<T, U extends T>(\n obj: Record<string, T>,\n predicate: Predicate<T, U>,\n): [Record<string, U>, Record<string, Exclude<T, U>>]\n\nexport function partitionRecord<T>(\n obj: Record<string, T>,\n predicate: (value: T) => boolean,\n): [Record<string, T>, Record<string, T>]\n\nexport function partitionRecord(obj: R, predicate: (value: unknown) => boolean): [R, R] {\n return Object.entries(obj).reduce(\n (result, [key, value]) => {\n result[predicate(value) ? 0 : 1][key] = value\n return result\n },\n [{}, {}] as [R, R],\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,UACd,OACA,WACwB;AACxB,SAAO,MAAM;AAAA,IACX,CAAC,QAAgC,UAAU;AACzC,aAAO,UAAU,KAAK,IAAI,IAAI,CAAC,EAAE,KAAK,KAAK;AAC3C,aAAO;AAAA,IACT;AAAA,IACA,CAAC,CAAC,GAAG,CAAC,CAAC;AAAA,EACT;AACF;AAoBO,SAAS,gBAAgB,KAAQ,WAAgD;AACtF,SAAO,OAAO,QAAQ,GAAG,EAAE;AAAA,IACzB,CAAC,QAAQ,CAAC,KAAK,KAAK,MAAM;AACxB,aAAO,UAAU,KAAK,IAAI,IAAI,CAAC,EAAE,GAAG,IAAI;AACxC,aAAO;AAAA,IACT;AAAA,IACA,CAAC,CAAC,GAAG,CAAC,CAAC;AAAA,EACT;AACF;","names":[]}
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,36 +15,12 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
  var shallowEqual_exports = {};
30
20
  __export(shallowEqual_exports, {
31
21
  default: () => shallowEqual_default
32
22
  });
33
23
  module.exports = __toCommonJS(shallowEqual_exports);
34
- var import_is = __toESM(require("./is"));
35
- const { hasOwnProperty } = Object.prototype;
36
- const shallowEqual = (a, b) => {
37
- if ((0, import_is.default)(a, b))
38
- return true;
39
- if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
40
- return false;
41
- const keysA = Object.keys(a);
42
- const keysB = Object.keys(b);
43
- if (keysA.length !== keysB.length)
44
- return false;
45
- for (let i = 0; i < keysA.length; i += 1) {
46
- if (!hasOwnProperty.call(b, keysA[i]) || !(0, import_is.default)(a[keysA[i]], b[keysA[i]]))
47
- return false;
48
- }
49
- return true;
50
- };
51
- var shallowEqual_default = shallowEqual;
24
+ var import_controls = require("@makeswift/controls");
25
+ var shallowEqual_default = import_controls.shallowEqual;
52
26
  //# sourceMappingURL=shallowEqual.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/shallowEqual.ts"],"sourcesContent":["import is from './is'\n\nconst { hasOwnProperty } = Object.prototype\n\nconst shallowEqual = (a: unknown, b: unknown): boolean => {\n if (is(a, b)) return true\n\n if (typeof a !== 'object' || a === null || typeof b !== 'object' || b === null) return false\n\n const keysA = Object.keys(a)\n const keysB = Object.keys(b)\n\n if (keysA.length !== keysB.length) return false\n\n for (let i = 0; i < keysA.length; i += 1) {\n // @ts-expect-error: {}[string] is OK.\n if (!hasOwnProperty.call(b, keysA[i]) || !is(a[keysA[i]], b[keysA[i]])) return false\n }\n\n return true\n}\n\nexport default shallowEqual\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAe;AAEf,MAAM,EAAE,eAAe,IAAI,OAAO;AAElC,MAAM,eAAe,CAAC,GAAY,MAAwB;AACxD,UAAI,UAAAA,SAAG,GAAG,CAAC;AAAG,WAAO;AAErB,MAAI,OAAO,MAAM,YAAY,MAAM,QAAQ,OAAO,MAAM,YAAY,MAAM;AAAM,WAAO;AAEvF,QAAM,QAAQ,OAAO,KAAK,CAAC;AAC3B,QAAM,QAAQ,OAAO,KAAK,CAAC;AAE3B,MAAI,MAAM,WAAW,MAAM;AAAQ,WAAO;AAE1C,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,GAAG;AAExC,QAAI,CAAC,eAAe,KAAK,GAAG,MAAM,CAAC,CAAC,KAAK,KAAC,UAAAA,SAAG,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;AAAG,aAAO;AAAA,EACjF;AAEA,SAAO;AACT;AAEA,IAAO,uBAAQ;","names":["is"]}
1
+ {"version":3,"sources":["../../../src/utils/shallowEqual.ts"],"sourcesContent":["import { shallowEqual } from '@makeswift/controls'\n\nexport default shallowEqual\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA6B;AAE7B,IAAO,uBAAQ;","names":[]}
@@ -13,7 +13,7 @@ async function handler(...args) {
13
13
  const supportsPreviewMode = match(args).with(routeHandlerPattern, () => false).with(apiRoutePattern, () => true).exhaustive();
14
14
  const supportsDraftMode = match(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
15
15
  const body = {
16
- version: "0.20.4-canary.0",
16
+ version: "0.20.4-canary.1",
17
17
  previewMode: supportsPreviewMode,
18
18
  draftMode: supportsDraftMode,
19
19
  interactionMode: true,
@@ -1,21 +1,4 @@
1
- import shallowEqual from "./shallowEqual";
2
- const { hasOwnProperty } = Object.prototype;
3
- const deepEqual = (a, b) => {
4
- if (shallowEqual(a, b))
5
- return true;
6
- if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
7
- return false;
8
- const keysA = Object.keys(a);
9
- const keysB = Object.keys(b);
10
- if (keysA.length !== keysB.length)
11
- return false;
12
- for (let i = 0; i < keysA.length; i += 1) {
13
- if (!hasOwnProperty.call(b, keysA[i]) || // @ts-expect-error: {}[string] is OK.
14
- !deepEqual(a[keysA[i]], b[keysA[i]]))
15
- return false;
16
- }
17
- return true;
18
- };
1
+ import { deepEqual } from "@makeswift/controls";
19
2
  var deepEqual_default = deepEqual;
20
3
  export {
21
4
  deepEqual_default as default
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/deepEqual.ts"],"sourcesContent":["import shallowEqual from './shallowEqual'\n\nconst { hasOwnProperty } = Object.prototype\n\nconst deepEqual = (a: unknown, b: unknown): boolean => {\n if (shallowEqual(a, b)) return true\n\n if (typeof a !== 'object' || a === null || typeof b !== 'object' || b === null) return false\n\n const keysA = Object.keys(a)\n const keysB = Object.keys(b)\n\n if (keysA.length !== keysB.length) return false\n\n for (let i = 0; i < keysA.length; i += 1) {\n if (\n !hasOwnProperty.call(b, keysA[i]) ||\n // @ts-expect-error: {}[string] is OK.\n !deepEqual(a[keysA[i]], b[keysA[i]])\n )\n return false\n }\n\n return true\n}\n\nexport default deepEqual\n"],"mappings":"AAAA,OAAO,kBAAkB;AAEzB,MAAM,EAAE,eAAe,IAAI,OAAO;AAElC,MAAM,YAAY,CAAC,GAAY,MAAwB;AACrD,MAAI,aAAa,GAAG,CAAC;AAAG,WAAO;AAE/B,MAAI,OAAO,MAAM,YAAY,MAAM,QAAQ,OAAO,MAAM,YAAY,MAAM;AAAM,WAAO;AAEvF,QAAM,QAAQ,OAAO,KAAK,CAAC;AAC3B,QAAM,QAAQ,OAAO,KAAK,CAAC;AAE3B,MAAI,MAAM,WAAW,MAAM;AAAQ,WAAO;AAE1C,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,GAAG;AACxC,QACE,CAAC,eAAe,KAAK,GAAG,MAAM,CAAC,CAAC;AAAA,IAEhC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;AAEnC,aAAO;AAAA,EACX;AAEA,SAAO;AACT;AAEA,IAAO,oBAAQ;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/deepEqual.ts"],"sourcesContent":["import { deepEqual } from '@makeswift/controls'\n\nexport default deepEqual\n"],"mappings":"AAAA,SAAS,iBAAiB;AAE1B,IAAO,oBAAQ;","names":[]}
@@ -1,9 +1,6 @@
1
- function is(x, y) {
2
- if (x === y)
3
- return x !== 0 || y !== 0 || 1 / x === 1 / y;
4
- return x !== x && y !== y;
5
- }
1
+ import { is } from "@makeswift/controls";
2
+ var is_default = is;
6
3
  export {
7
- is as default
4
+ is_default as default
8
5
  };
9
6
  //# sourceMappingURL=is.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/is.ts"],"sourcesContent":["export default function is(x: unknown, y: unknown): boolean {\n if (x === y) return x !== 0 || y !== 0 || 1 / x === 1 / y\n\n return x !== x && y !== y\n}\n"],"mappings":"AAAe,SAAR,GAAoB,GAAY,GAAqB;AAC1D,MAAI,MAAM;AAAG,WAAO,MAAM,KAAK,MAAM,KAAK,IAAI,MAAM,IAAI;AAExD,SAAO,MAAM,KAAK,MAAM;AAC1B;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/is.ts"],"sourcesContent":["import { is } from '@makeswift/controls'\n\nexport default is\n"],"mappings":"AAAA,SAAS,UAAU;AAEnB,IAAO,aAAQ;","names":[]}
@@ -0,0 +1,23 @@
1
+ function partition(array, predicate) {
2
+ return array.reduce(
3
+ (result, value) => {
4
+ result[predicate(value) ? 0 : 1].push(value);
5
+ return result;
6
+ },
7
+ [[], []]
8
+ );
9
+ }
10
+ function partitionRecord(obj, predicate) {
11
+ return Object.entries(obj).reduce(
12
+ (result, [key, value]) => {
13
+ result[predicate(value) ? 0 : 1][key] = value;
14
+ return result;
15
+ },
16
+ [{}, {}]
17
+ );
18
+ }
19
+ export {
20
+ partition,
21
+ partitionRecord
22
+ };
23
+ //# sourceMappingURL=partition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/partition.ts"],"sourcesContent":["type Predicate<T, U extends T> = (value: T) => value is U\n\n/**\n * Splits the array into two based on the predicate's result. Returns a tuple of arrays with\n * matching and non-matching elements, maintaining the original order within each group.\n *\n * If the predicate includes a type assertion, the resulting arrays will be typed accordingly.\n */\nexport function partition<T, U extends T>(\n array: readonly T[],\n predicate: Predicate<T, U>,\n): [U[], Exclude<T, U>[]]\n\nexport function partition<T>(array: readonly T[], predicate: (value: T) => boolean): [T[], T[]]\n\nexport function partition(\n array: readonly unknown[],\n predicate: (value: unknown) => boolean,\n): [unknown[], unknown[]] {\n return array.reduce(\n (result: [unknown[], unknown[]], value) => {\n result[predicate(value) ? 0 : 1].push(value)\n return result\n },\n [[], []],\n )\n}\n\ntype R = Record<string, unknown>\n\n/**\n * Splits the record into two based on the predicate's result. Returns a tuple of records with\n * matching and non-matching elements.\n *\n * If the predicate includes a type assertion, the resulting records will be typed accordingly.\n */\nexport function partitionRecord<T, U extends T>(\n obj: Record<string, T>,\n predicate: Predicate<T, U>,\n): [Record<string, U>, Record<string, Exclude<T, U>>]\n\nexport function partitionRecord<T>(\n obj: Record<string, T>,\n predicate: (value: T) => boolean,\n): [Record<string, T>, Record<string, T>]\n\nexport function partitionRecord(obj: R, predicate: (value: unknown) => boolean): [R, R] {\n return Object.entries(obj).reduce(\n (result, [key, value]) => {\n result[predicate(value) ? 0 : 1][key] = value\n return result\n },\n [{}, {}] as [R, R],\n )\n}\n"],"mappings":"AAeO,SAAS,UACd,OACA,WACwB;AACxB,SAAO,MAAM;AAAA,IACX,CAAC,QAAgC,UAAU;AACzC,aAAO,UAAU,KAAK,IAAI,IAAI,CAAC,EAAE,KAAK,KAAK;AAC3C,aAAO;AAAA,IACT;AAAA,IACA,CAAC,CAAC,GAAG,CAAC,CAAC;AAAA,EACT;AACF;AAoBO,SAAS,gBAAgB,KAAQ,WAAgD;AACtF,SAAO,OAAO,QAAQ,GAAG,EAAE;AAAA,IACzB,CAAC,QAAQ,CAAC,KAAK,KAAK,MAAM;AACxB,aAAO,UAAU,KAAK,IAAI,IAAI,CAAC,EAAE,GAAG,IAAI;AACxC,aAAO;AAAA,IACT;AAAA,IACA,CAAC,CAAC,GAAG,CAAC,CAAC;AAAA,EACT;AACF;","names":[]}
@@ -1,20 +1,4 @@
1
- import is from "./is";
2
- const { hasOwnProperty } = Object.prototype;
3
- const shallowEqual = (a, b) => {
4
- if (is(a, b))
5
- return true;
6
- if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
7
- return false;
8
- const keysA = Object.keys(a);
9
- const keysB = Object.keys(b);
10
- if (keysA.length !== keysB.length)
11
- return false;
12
- for (let i = 0; i < keysA.length; i += 1) {
13
- if (!hasOwnProperty.call(b, keysA[i]) || !is(a[keysA[i]], b[keysA[i]]))
14
- return false;
15
- }
16
- return true;
17
- };
1
+ import { shallowEqual } from "@makeswift/controls";
18
2
  var shallowEqual_default = shallowEqual;
19
3
  export {
20
4
  shallowEqual_default as default
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/shallowEqual.ts"],"sourcesContent":["import is from './is'\n\nconst { hasOwnProperty } = Object.prototype\n\nconst shallowEqual = (a: unknown, b: unknown): boolean => {\n if (is(a, b)) return true\n\n if (typeof a !== 'object' || a === null || typeof b !== 'object' || b === null) return false\n\n const keysA = Object.keys(a)\n const keysB = Object.keys(b)\n\n if (keysA.length !== keysB.length) return false\n\n for (let i = 0; i < keysA.length; i += 1) {\n // @ts-expect-error: {}[string] is OK.\n if (!hasOwnProperty.call(b, keysA[i]) || !is(a[keysA[i]], b[keysA[i]])) return false\n }\n\n return true\n}\n\nexport default shallowEqual\n"],"mappings":"AAAA,OAAO,QAAQ;AAEf,MAAM,EAAE,eAAe,IAAI,OAAO;AAElC,MAAM,eAAe,CAAC,GAAY,MAAwB;AACxD,MAAI,GAAG,GAAG,CAAC;AAAG,WAAO;AAErB,MAAI,OAAO,MAAM,YAAY,MAAM,QAAQ,OAAO,MAAM,YAAY,MAAM;AAAM,WAAO;AAEvF,QAAM,QAAQ,OAAO,KAAK,CAAC;AAC3B,QAAM,QAAQ,OAAO,KAAK,CAAC;AAE3B,MAAI,MAAM,WAAW,MAAM;AAAQ,WAAO;AAE1C,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,GAAG;AAExC,QAAI,CAAC,eAAe,KAAK,GAAG,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;AAAG,aAAO;AAAA,EACjF;AAEA,SAAO;AACT;AAEA,IAAO,uBAAQ;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/shallowEqual.ts"],"sourcesContent":["import { shallowEqual } from '@makeswift/controls'\n\nexport default shallowEqual\n"],"mappings":"AAAA,SAAS,oBAAoB;AAE7B,IAAO,uBAAQ;","names":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=partition.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partition.test.d.ts","sourceRoot":"","sources":["../../../../src/utils/__tests__/partition.test.ts"],"names":[],"mappings":""}
@@ -1,3 +1,3 @@
1
- declare const deepEqual: (a: unknown, b: unknown) => boolean;
1
+ import { deepEqual } from '@makeswift/controls';
2
2
  export default deepEqual;
3
3
  //# sourceMappingURL=deepEqual.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deepEqual.d.ts","sourceRoot":"","sources":["../../../src/utils/deepEqual.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,SAAS,MAAO,OAAO,KAAK,OAAO,KAAG,OAoB3C,CAAA;AAED,eAAe,SAAS,CAAA"}
1
+ {"version":3,"file":"deepEqual.d.ts","sourceRoot":"","sources":["../../../src/utils/deepEqual.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,eAAe,SAAS,CAAA"}
@@ -1,2 +1,3 @@
1
- export default function is(x: unknown, y: unknown): boolean;
1
+ import { is } from '@makeswift/controls';
2
+ export default is;
2
3
  //# sourceMappingURL=is.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is.d.ts","sourceRoot":"","sources":["../../../src/utils/is.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAI1D"}
1
+ {"version":3,"file":"is.d.ts","sourceRoot":"","sources":["../../../src/utils/is.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAA;AAExC,eAAe,EAAE,CAAA"}
@@ -0,0 +1,19 @@
1
+ type Predicate<T, U extends T> = (value: T) => value is U;
2
+ /**
3
+ * Splits the array into two based on the predicate's result. Returns a tuple of arrays with
4
+ * matching and non-matching elements, maintaining the original order within each group.
5
+ *
6
+ * If the predicate includes a type assertion, the resulting arrays will be typed accordingly.
7
+ */
8
+ export declare function partition<T, U extends T>(array: readonly T[], predicate: Predicate<T, U>): [U[], Exclude<T, U>[]];
9
+ export declare function partition<T>(array: readonly T[], predicate: (value: T) => boolean): [T[], T[]];
10
+ /**
11
+ * Splits the record into two based on the predicate's result. Returns a tuple of records with
12
+ * matching and non-matching elements.
13
+ *
14
+ * If the predicate includes a type assertion, the resulting records will be typed accordingly.
15
+ */
16
+ export declare function partitionRecord<T, U extends T>(obj: Record<string, T>, predicate: Predicate<T, U>): [Record<string, U>, Record<string, Exclude<T, U>>];
17
+ export declare function partitionRecord<T>(obj: Record<string, T>, predicate: (value: T) => boolean): [Record<string, T>, Record<string, T>];
18
+ export {};
19
+ //# sourceMappingURL=partition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partition.d.ts","sourceRoot":"","sources":["../../../src/utils/partition.ts"],"names":[],"mappings":"AAAA,KAAK,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,CAAA;AAEzD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EACtC,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,SAAS,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GACzB,CAAC,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAA;AAEzB,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAA;AAiB/F;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAC5C,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EACtB,SAAS,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GACzB,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AAErD,wBAAgB,eAAe,CAAC,CAAC,EAC/B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EACtB,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAC/B,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAA"}
@@ -1,3 +1,3 @@
1
- declare const shallowEqual: (a: unknown, b: unknown) => boolean;
1
+ import { shallowEqual } from '@makeswift/controls';
2
2
  export default shallowEqual;
3
3
  //# sourceMappingURL=shallowEqual.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shallowEqual.d.ts","sourceRoot":"","sources":["../../../src/utils/shallowEqual.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,YAAY,MAAO,OAAO,KAAK,OAAO,KAAG,OAgB9C,CAAA;AAED,eAAe,YAAY,CAAA"}
1
+ {"version":3,"file":"shallowEqual.d.ts","sourceRoot":"","sources":["../../../src/utils/shallowEqual.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAElD,eAAe,YAAY,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makeswift/runtime",
3
- "version": "0.20.4-canary.0",
3
+ "version": "0.20.4-canary.1",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist",
@@ -149,9 +149,9 @@
149
149
  "use-sync-external-store": "^1.0.0-rc.0",
150
150
  "uuid": "^9.0.0",
151
151
  "zod": "^3.21.4",
152
- "@makeswift/controls": "0.1.2",
152
+ "@makeswift/controls": "0.1.3-canary.0",
153
153
  "@makeswift/next-plugin": "0.3.0",
154
- "@makeswift/prop-controllers": "0.3.3"
154
+ "@makeswift/prop-controllers": "0.3.4-canary.0"
155
155
  },
156
156
  "devDependencies": {
157
157
  "@emotion/jest": "^11.11.0",