@tachybase/schema 0.23.41 → 0.23.47
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/core/effects/index.d.ts +2 -0
- package/lib/core/effects/index.js +23 -0
- package/lib/core/effects/onFieldEffects.d.ts +27 -0
- package/lib/core/effects/onFieldEffects.js +158 -0
- package/lib/core/effects/onFormEffects.d.ts +24 -0
- package/lib/core/effects/onFormEffects.js +117 -0
- package/lib/core/global.d.js +0 -0
- package/lib/core/index.d.ts +4 -0
- package/lib/core/index.js +27 -0
- package/lib/core/models/ArrayField.d.ts +17 -0
- package/lib/core/models/ArrayField.js +145 -0
- package/lib/core/models/BaseField.d.ts +72 -0
- package/lib/core/models/BaseField.js +285 -0
- package/lib/core/models/Field.d.ts +70 -0
- package/lib/core/models/Field.js +426 -0
- package/lib/core/models/Form.d.ts +102 -0
- package/lib/core/models/Form.js +483 -0
- package/lib/core/models/Graph.d.ts +8 -0
- package/lib/core/models/Graph.js +77 -0
- package/lib/core/models/Heart.d.ts +16 -0
- package/lib/core/models/Heart.js +91 -0
- package/lib/core/models/LifeCycle.d.ts +14 -0
- package/lib/core/models/LifeCycle.js +64 -0
- package/lib/core/models/ObjectField.d.ts +12 -0
- package/lib/core/models/ObjectField.js +64 -0
- package/lib/core/models/Query.d.ts +18 -0
- package/lib/core/models/Query.js +105 -0
- package/lib/core/models/VoidField.d.ts +14 -0
- package/lib/core/models/VoidField.js +117 -0
- package/lib/core/models/index.d.ts +9 -0
- package/lib/core/models/index.js +37 -0
- package/lib/core/models/types.d.ts +9 -0
- package/lib/core/models/types.js +15 -0
- package/lib/core/shared/checkers.d.ts +117 -0
- package/lib/core/shared/checkers.js +109 -0
- package/lib/core/shared/constants.d.ts +48 -0
- package/lib/core/shared/constants.js +86 -0
- package/lib/core/shared/effective.d.ts +9 -0
- package/lib/core/shared/effective.js +91 -0
- package/lib/core/shared/externals.d.ts +8 -0
- package/lib/core/shared/externals.js +87 -0
- package/lib/core/shared/internals.d.ts +54 -0
- package/lib/core/shared/internals.js +956 -0
- package/lib/core/types.d.ts +275 -0
- package/lib/core/types.js +76 -0
- package/lib/grid/index.d.ts +67 -0
- package/lib/grid/index.js +378 -0
- package/lib/grid/observer.d.ts +19 -0
- package/lib/grid/observer.js +107 -0
- package/lib/index.d.ts +12 -24
- package/lib/index.js +27 -244
- package/lib/json-schema/compiler.d.ts +8 -0
- package/lib/json-schema/compiler.js +129 -0
- package/lib/json-schema/global.d.js +0 -0
- package/lib/json-schema/index.d.ts +2 -0
- package/lib/json-schema/index.js +23 -0
- package/lib/json-schema/patches.d.ts +5 -0
- package/lib/json-schema/patches.js +68 -0
- package/lib/json-schema/polyfills/SPECIFICATION_1_0.d.ts +2 -0
- package/lib/json-schema/polyfills/SPECIFICATION_1_0.js +132 -0
- package/lib/json-schema/polyfills/index.d.ts +1 -0
- package/lib/json-schema/polyfills/index.js +21 -0
- package/lib/json-schema/schema.d.ts +88 -0
- package/lib/json-schema/schema.js +231 -0
- package/lib/json-schema/shared.d.ts +62 -0
- package/lib/json-schema/shared.js +232 -0
- package/lib/json-schema/transformer.d.ts +4 -0
- package/lib/json-schema/transformer.js +238 -0
- package/lib/json-schema/types.d.ts +119 -0
- package/lib/json-schema/types.js +15 -0
- package/lib/path/contexts.d.ts +10 -0
- package/lib/path/contexts.js +49 -0
- package/lib/path/destructor.d.ts +15 -0
- package/lib/path/destructor.js +151 -0
- package/lib/path/index.d.ts +51 -0
- package/lib/path/index.js +513 -0
- package/lib/path/matcher.d.ts +33 -0
- package/lib/path/matcher.js +197 -0
- package/lib/path/parser.d.ts +33 -0
- package/lib/path/parser.js +379 -0
- package/lib/path/shared.d.ts +13 -0
- package/lib/path/shared.js +121 -0
- package/lib/path/tokenizer.d.ts +27 -0
- package/lib/path/tokenizer.js +269 -0
- package/lib/path/tokens.d.ts +27 -0
- package/lib/path/tokens.js +216 -0
- package/lib/path/types.d.ts +88 -0
- package/lib/path/types.js +63 -0
- package/lib/react/components/ArrayField.d.ts +6 -0
- package/lib/react/components/ArrayField.js +44 -0
- package/lib/react/components/ExpressionScope.d.ts +2 -0
- package/lib/react/components/ExpressionScope.js +35 -0
- package/lib/react/components/Field.d.ts +5 -0
- package/lib/react/components/Field.js +45 -0
- package/lib/react/components/FormConsumer.d.ts +2 -0
- package/lib/react/components/FormConsumer.js +36 -0
- package/lib/react/components/FormProvider.d.ts +2 -0
- package/lib/react/components/FormProvider.js +35 -0
- package/lib/react/components/ObjectField.d.ts +6 -0
- package/lib/react/components/ObjectField.js +39 -0
- package/lib/react/components/ReactiveField.d.ts +11 -0
- package/lib/react/components/ReactiveField.js +115 -0
- package/lib/react/components/RecordScope.d.ts +2 -0
- package/lib/react/components/RecordScope.js +65 -0
- package/lib/react/components/RecordsScope.d.ts +2 -0
- package/lib/react/components/RecordsScope.js +43 -0
- package/lib/react/components/RecursionField.d.ts +2 -0
- package/lib/react/components/RecursionField.js +105 -0
- package/lib/react/components/SchemaField.d.ts +41 -0
- package/lib/react/components/SchemaField.js +154 -0
- package/lib/react/components/VoidField.d.ts +5 -0
- package/lib/react/components/VoidField.js +39 -0
- package/lib/react/components/index.d.ts +11 -0
- package/lib/react/components/index.js +41 -0
- package/lib/react/global.d.js +0 -0
- package/lib/react/hooks/index.d.ts +6 -0
- package/lib/react/hooks/index.js +31 -0
- package/lib/react/hooks/useAttach.d.ts +6 -0
- package/lib/react/hooks/useAttach.js +35 -0
- package/lib/react/hooks/useExpressionScope.d.ts +1 -0
- package/lib/react/hooks/useExpressionScope.js +30 -0
- package/lib/react/hooks/useField.d.ts +2 -0
- package/lib/react/hooks/useField.js +32 -0
- package/lib/react/hooks/useFieldSchema.d.ts +2 -0
- package/lib/react/hooks/useFieldSchema.js +32 -0
- package/lib/react/hooks/useForm.d.ts +2 -0
- package/lib/react/hooks/useForm.js +32 -0
- package/lib/react/hooks/useFormEffects.d.ts +2 -0
- package/lib/react/hooks/useFormEffects.js +42 -0
- package/lib/react/hooks/useParentForm.d.ts +2 -0
- package/lib/react/hooks/useParentForm.js +40 -0
- package/lib/react/index.d.ts +5 -0
- package/lib/react/index.js +29 -0
- package/lib/react/shared/connect.d.ts +9 -0
- package/lib/react/shared/connect.js +118 -0
- package/lib/react/shared/context.d.ts +14 -0
- package/lib/react/shared/context.js +74 -0
- package/lib/react/shared/index.d.ts +2 -0
- package/lib/react/shared/index.js +23 -0
- package/lib/react/shared/render.d.ts +2 -0
- package/lib/react/shared/render.js +69 -0
- package/lib/react/types.d.ts +84 -0
- package/lib/react/types.js +15 -0
- package/lib/reactive/action.d.ts +2 -0
- package/lib/reactive/action.js +48 -0
- package/lib/reactive/annotations/box.d.ts +7 -0
- package/lib/reactive/annotations/box.js +76 -0
- package/lib/reactive/annotations/computed.d.ts +12 -0
- package/lib/reactive/annotations/computed.js +154 -0
- package/lib/reactive/annotations/index.d.ts +5 -0
- package/lib/reactive/annotations/index.js +29 -0
- package/lib/reactive/annotations/observable.d.ts +4 -0
- package/lib/reactive/annotations/observable.js +67 -0
- package/lib/reactive/annotations/ref.d.ts +6 -0
- package/lib/reactive/annotations/ref.js +78 -0
- package/lib/reactive/annotations/shallow.d.ts +2 -0
- package/lib/reactive/annotations/shallow.js +67 -0
- package/lib/reactive/array.d.ts +12 -0
- package/lib/reactive/array.js +83 -0
- package/lib/reactive/autorun.d.ts +7 -0
- package/lib/reactive/autorun.js +155 -0
- package/lib/reactive/batch.d.ts +2 -0
- package/lib/reactive/batch.js +40 -0
- package/lib/reactive/checkers.d.ts +10 -0
- package/lib/reactive/checkers.js +60 -0
- package/lib/reactive/environment.d.ts +28 -0
- package/lib/reactive/environment.js +76 -0
- package/lib/reactive/externals.d.ts +10 -0
- package/lib/reactive/externals.js +156 -0
- package/lib/reactive/global.d.js +0 -0
- package/lib/reactive/handlers.d.ts +4 -0
- package/lib/reactive/handlers.js +246 -0
- package/lib/reactive/index.d.ts +10 -0
- package/lib/reactive/index.js +39 -0
- package/lib/reactive/internals.d.ts +17 -0
- package/lib/reactive/internals.js +139 -0
- package/lib/reactive/model.d.ts +3 -0
- package/lib/reactive/model.js +68 -0
- package/lib/reactive/observable.d.ts +9 -0
- package/lib/reactive/observable.js +50 -0
- package/lib/reactive/observe.d.ts +2 -0
- package/lib/reactive/observe.js +58 -0
- package/lib/reactive/reaction.d.ts +21 -0
- package/lib/reactive/reaction.js +278 -0
- package/lib/reactive/tracker.d.ts +7 -0
- package/lib/reactive/tracker.js +63 -0
- package/lib/reactive/tree.d.ts +25 -0
- package/lib/reactive/tree.js +106 -0
- package/lib/reactive/types.d.ts +79 -0
- package/lib/reactive/types.js +21 -0
- package/lib/reactive/untracked.d.ts +4 -0
- package/lib/reactive/untracked.js +29 -0
- package/lib/reactive-react/hooks/index.d.ts +9 -0
- package/lib/reactive-react/hooks/index.js +48 -0
- package/lib/reactive-react/hooks/useCompatEffect.d.ts +2 -0
- package/lib/reactive-react/hooks/useCompatEffect.js +60 -0
- package/lib/reactive-react/hooks/useCompatFactory.d.ts +3 -0
- package/lib/reactive-react/hooks/useCompatFactory.js +74 -0
- package/lib/reactive-react/hooks/useDidUpdate.d.ts +1 -0
- package/lib/reactive-react/hooks/useDidUpdate.js +38 -0
- package/lib/reactive-react/hooks/useForceUpdate.d.ts +1 -0
- package/lib/reactive-react/hooks/useForceUpdate.js +76 -0
- package/lib/reactive-react/hooks/useLayoutEffect.d.ts +2 -0
- package/lib/reactive-react/hooks/useLayoutEffect.js +28 -0
- package/lib/reactive-react/hooks/useObserver.d.ts +2 -0
- package/lib/reactive-react/hooks/useObserver.js +43 -0
- package/lib/reactive-react/index.d.ts +3 -0
- package/lib/reactive-react/index.js +25 -0
- package/lib/reactive-react/observer.d.ts +8 -0
- package/lib/reactive-react/observer.js +64 -0
- package/lib/reactive-react/shared/gc.d.ts +8 -0
- package/lib/reactive-react/shared/gc.js +59 -0
- package/lib/reactive-react/shared/global.d.ts +1 -0
- package/lib/reactive-react/shared/global.js +50 -0
- package/lib/reactive-react/shared/immediate.d.ts +1 -0
- package/lib/reactive-react/shared/immediate.js +40 -0
- package/lib/reactive-react/shared/index.d.ts +2 -0
- package/lib/reactive-react/shared/index.js +23 -0
- package/lib/reactive-react/types.d.ts +14 -0
- package/lib/reactive-react/types.js +15 -0
- package/lib/shared/array.d.ts +35 -0
- package/lib/shared/array.js +189 -0
- package/lib/shared/case.d.ts +6 -0
- package/lib/shared/case.js +39 -0
- package/lib/shared/checkers.d.ts +21 -0
- package/lib/shared/checkers.js +77 -0
- package/lib/shared/clone.d.ts +2 -0
- package/lib/shared/clone.js +97 -0
- package/lib/shared/compare.d.ts +1 -0
- package/lib/shared/compare.js +129 -0
- package/lib/shared/defaults.d.ts +6 -0
- package/lib/shared/defaults.js +63 -0
- package/lib/shared/deprecate.d.ts +1 -0
- package/lib/shared/deprecate.js +42 -0
- package/lib/shared/global.d.ts +1 -0
- package/lib/shared/global.js +50 -0
- package/lib/shared/index.d.ts +16 -0
- package/lib/shared/index.js +51 -0
- package/lib/shared/instanceof.d.ts +1 -0
- package/lib/shared/instanceof.js +36 -0
- package/lib/shared/isEmpty.d.ts +3 -0
- package/lib/shared/isEmpty.js +94 -0
- package/lib/shared/merge.d.ts +12 -0
- package/lib/shared/merge.js +214 -0
- package/lib/shared/middleware.d.ts +4 -0
- package/lib/shared/middleware.js +41 -0
- package/lib/shared/path.d.ts +3 -0
- package/lib/shared/path.js +27 -0
- package/lib/shared/string.d.ts +1 -0
- package/lib/shared/string.js +38 -0
- package/lib/shared/subscribable.d.ts +11 -0
- package/lib/shared/subscribable.js +74 -0
- package/lib/shared/uid.d.ts +1 -0
- package/lib/shared/uid.js +35 -0
- package/lib/validator/formats.d.ts +16 -0
- package/lib/validator/formats.js +40 -0
- package/lib/validator/index.d.ts +4 -0
- package/lib/validator/index.js +27 -0
- package/lib/validator/locale.d.ts +219 -0
- package/lib/validator/locale.js +240 -0
- package/lib/validator/parser.d.ts +5 -0
- package/lib/validator/parser.js +153 -0
- package/lib/validator/registry.d.ts +15 -0
- package/lib/validator/registry.js +116 -0
- package/lib/validator/rules.d.ts +3 -0
- package/lib/validator/rules.js +154 -0
- package/lib/validator/template.d.ts +2 -0
- package/lib/validator/template.js +42 -0
- package/lib/validator/types.d.ts +62 -0
- package/lib/validator/types.js +28 -0
- package/lib/validator/validator.d.ts +2 -0
- package/lib/validator/validator.js +63 -0
- package/package.json +16 -10
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var types_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
type EachArrayIterator<T> = (currentValue: T, key: number) => void | boolean;
|
|
2
|
+
type EachStringIterator = (currentValue: string, key: number) => void | boolean;
|
|
3
|
+
type EachObjectIterator<T = any> = (currentValue: T, key: string) => void | boolean;
|
|
4
|
+
type MapArrayIterator<TItem, TResult> = (currentValue: TItem, key: number) => TResult;
|
|
5
|
+
type MapStringIterator<TResult> = (currentValue: string, key: number) => TResult;
|
|
6
|
+
type MapObjectIterator<TItem, TResult> = (currentValue: TItem, key: string) => TResult;
|
|
7
|
+
type MemoArrayIterator<T, U> = (previousValue: U, currentValue: T, key: number) => U;
|
|
8
|
+
type MemoStringIterator<T> = (previousValue: T, currentValue: string, key: number) => T;
|
|
9
|
+
type MemoObjectIterator<TValue, TResult> = (previousValue: TResult, currentValue: TValue, key: string) => TResult;
|
|
10
|
+
export declare const toArr: (val: any) => any[];
|
|
11
|
+
export declare function each(val: string, iterator: EachStringIterator, revert?: boolean): void;
|
|
12
|
+
export declare function each<T>(val: T[], iterator: EachArrayIterator<T>, revert?: boolean): void;
|
|
13
|
+
export declare function each<T extends {}, TValue extends T[keyof T]>(val: T, iterator: EachObjectIterator<TValue>, revert?: boolean): void;
|
|
14
|
+
export declare function map<T>(val: string, iterator: MapStringIterator<T>, revert?: boolean): T[];
|
|
15
|
+
export declare function map<TItem, TResult>(val: TItem[], iterator: MapArrayIterator<TItem, TResult>, revert?: boolean): TResult[];
|
|
16
|
+
export declare function map<T extends {}, TResult>(val: T, iterator: MapObjectIterator<T[keyof T], TResult>, revert?: boolean): Record<keyof T, TResult>;
|
|
17
|
+
export declare function reduce<T, U>(val: T[], iterator: MemoArrayIterator<T, U>, accumulator?: U, revert?: boolean): U;
|
|
18
|
+
export declare function reduce<T>(val: string, iterator: MemoStringIterator<T>, accumulator?: T, revert?: boolean): T;
|
|
19
|
+
export declare function reduce<T extends {}, TValue extends T[keyof T], TResult = any>(val: T, iterator: MemoObjectIterator<TValue, TResult>, accumulator?: TResult, revert?: boolean): TResult;
|
|
20
|
+
export declare function every<T extends string>(val: T, iterator: EachStringIterator, revert?: boolean): boolean;
|
|
21
|
+
export declare function every<T>(val: T[], iterator: EachArrayIterator<T>, revert?: boolean): boolean;
|
|
22
|
+
export declare function every<T extends {}>(val: T, iterator: EachObjectIterator, revert?: boolean): boolean;
|
|
23
|
+
export declare function some<T extends string>(val: T, iterator: EachStringIterator, revert?: boolean): boolean;
|
|
24
|
+
export declare function some<T>(val: T[], iterator: EachArrayIterator<T>, revert?: boolean): boolean;
|
|
25
|
+
export declare function some<T extends {}>(val: T, iterator: EachObjectIterator, revert?: boolean): boolean;
|
|
26
|
+
export declare function findIndex<T extends string>(val: T, iterator: EachStringIterator, revert?: boolean): number;
|
|
27
|
+
export declare function findIndex<T>(val: T[], iterator: EachArrayIterator<T>, revert?: boolean): number;
|
|
28
|
+
export declare function findIndex<T extends {}>(val: T, iterator: EachObjectIterator, revert?: boolean): keyof T;
|
|
29
|
+
export declare function find<T extends string>(val: T, iterator: EachStringIterator, revert?: boolean): any;
|
|
30
|
+
export declare function find<T>(val: T[], iterator: EachArrayIterator<T>, revert?: boolean): T;
|
|
31
|
+
export declare function find<T extends {}>(val: T, iterator: EachObjectIterator, revert?: boolean): T[keyof T];
|
|
32
|
+
export declare function includes<T extends string>(val: T, searchElement: string, revert?: boolean): boolean;
|
|
33
|
+
export declare function includes<T>(val: T[], searchElement: T, revert?: boolean): boolean;
|
|
34
|
+
export declare function move<T extends any>(array: T[], fromIndex: number, toIndex: number): T[];
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
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 array_exports = {};
|
|
20
|
+
__export(array_exports, {
|
|
21
|
+
each: () => each,
|
|
22
|
+
every: () => every,
|
|
23
|
+
find: () => find,
|
|
24
|
+
findIndex: () => findIndex,
|
|
25
|
+
includes: () => includes,
|
|
26
|
+
map: () => map,
|
|
27
|
+
move: () => move,
|
|
28
|
+
reduce: () => reduce,
|
|
29
|
+
some: () => some,
|
|
30
|
+
toArr: () => toArr
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(array_exports);
|
|
33
|
+
var import_checkers = require("./checkers");
|
|
34
|
+
const toArr = /* @__PURE__ */ __name((val) => (0, import_checkers.isArr)(val) ? val : val ? [val] : [], "toArr");
|
|
35
|
+
function each(val, iterator, revert) {
|
|
36
|
+
if ((0, import_checkers.isArr)(val) || (0, import_checkers.isStr)(val)) {
|
|
37
|
+
if (revert) {
|
|
38
|
+
for (let i = val.length - 1; i >= 0; i--) {
|
|
39
|
+
if (iterator(val[i], i) === false) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
} else {
|
|
44
|
+
for (let i = 0; i < val.length; i++) {
|
|
45
|
+
if (iterator(val[i], i) === false) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
} else if ((0, import_checkers.isObj)(val)) {
|
|
51
|
+
let key;
|
|
52
|
+
for (key in val) {
|
|
53
|
+
if (Object.hasOwnProperty.call(val, key)) {
|
|
54
|
+
if (iterator(val[key], key) === false) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
__name(each, "each");
|
|
62
|
+
function map(val, iterator, revert) {
|
|
63
|
+
const res = (0, import_checkers.isArr)(val) || (0, import_checkers.isStr)(val) ? [] : {};
|
|
64
|
+
each(
|
|
65
|
+
val,
|
|
66
|
+
(item, key) => {
|
|
67
|
+
const value = iterator(item, key);
|
|
68
|
+
if ((0, import_checkers.isArr)(res)) {
|
|
69
|
+
res.push(value);
|
|
70
|
+
} else {
|
|
71
|
+
res[key] = value;
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
revert
|
|
75
|
+
);
|
|
76
|
+
return res;
|
|
77
|
+
}
|
|
78
|
+
__name(map, "map");
|
|
79
|
+
function reduce(val, iterator, accumulator, revert) {
|
|
80
|
+
let result = accumulator;
|
|
81
|
+
each(
|
|
82
|
+
val,
|
|
83
|
+
(item, key) => {
|
|
84
|
+
result = iterator(result, item, key);
|
|
85
|
+
},
|
|
86
|
+
revert
|
|
87
|
+
);
|
|
88
|
+
return result;
|
|
89
|
+
}
|
|
90
|
+
__name(reduce, "reduce");
|
|
91
|
+
function every(val, iterator, revert) {
|
|
92
|
+
let res = true;
|
|
93
|
+
each(
|
|
94
|
+
val,
|
|
95
|
+
(item, key) => {
|
|
96
|
+
if (!iterator(item, key)) {
|
|
97
|
+
res = false;
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
revert
|
|
102
|
+
);
|
|
103
|
+
return res;
|
|
104
|
+
}
|
|
105
|
+
__name(every, "every");
|
|
106
|
+
function some(val, iterator, revert) {
|
|
107
|
+
let res = false;
|
|
108
|
+
each(
|
|
109
|
+
val,
|
|
110
|
+
(item, key) => {
|
|
111
|
+
if (iterator(item, key)) {
|
|
112
|
+
res = true;
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
revert
|
|
117
|
+
);
|
|
118
|
+
return res;
|
|
119
|
+
}
|
|
120
|
+
__name(some, "some");
|
|
121
|
+
function findIndex(val, iterator, revert) {
|
|
122
|
+
let res = -1;
|
|
123
|
+
each(
|
|
124
|
+
val,
|
|
125
|
+
(item, key) => {
|
|
126
|
+
if (iterator(item, key)) {
|
|
127
|
+
res = key;
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
revert
|
|
132
|
+
);
|
|
133
|
+
return res;
|
|
134
|
+
}
|
|
135
|
+
__name(findIndex, "findIndex");
|
|
136
|
+
function find(val, iterator, revert) {
|
|
137
|
+
let res;
|
|
138
|
+
each(
|
|
139
|
+
val,
|
|
140
|
+
(item, key) => {
|
|
141
|
+
if (iterator(item, key)) {
|
|
142
|
+
res = item;
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
revert
|
|
147
|
+
);
|
|
148
|
+
return res;
|
|
149
|
+
}
|
|
150
|
+
__name(find, "find");
|
|
151
|
+
function includes(val, searchElement, revert) {
|
|
152
|
+
if ((0, import_checkers.isStr)(val)) return val.includes(searchElement);
|
|
153
|
+
return some(val, (item) => item === searchElement, revert);
|
|
154
|
+
}
|
|
155
|
+
__name(includes, "includes");
|
|
156
|
+
function move(array, fromIndex, toIndex) {
|
|
157
|
+
if (fromIndex === toIndex) return array;
|
|
158
|
+
if (toIndex < 0 || fromIndex < 0 || toIndex > array.length - 1 || fromIndex > array.length - 1) {
|
|
159
|
+
return array;
|
|
160
|
+
}
|
|
161
|
+
if (fromIndex < toIndex) {
|
|
162
|
+
const fromItem = array[fromIndex];
|
|
163
|
+
for (let index = fromIndex; index < toIndex; index++) {
|
|
164
|
+
array[index] = array[index + 1];
|
|
165
|
+
}
|
|
166
|
+
array[toIndex] = fromItem;
|
|
167
|
+
} else {
|
|
168
|
+
const fromItem = array[fromIndex];
|
|
169
|
+
for (let index = fromIndex; index > toIndex; index--) {
|
|
170
|
+
array[index] = array[index - 1];
|
|
171
|
+
}
|
|
172
|
+
array[toIndex] = fromItem;
|
|
173
|
+
}
|
|
174
|
+
return array;
|
|
175
|
+
}
|
|
176
|
+
__name(move, "move");
|
|
177
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
178
|
+
0 && (module.exports = {
|
|
179
|
+
each,
|
|
180
|
+
every,
|
|
181
|
+
find,
|
|
182
|
+
findIndex,
|
|
183
|
+
includes,
|
|
184
|
+
map,
|
|
185
|
+
move,
|
|
186
|
+
reduce,
|
|
187
|
+
some,
|
|
188
|
+
toArr
|
|
189
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { camelCase } from 'camel-case';
|
|
2
|
+
import { lowerCase } from 'lower-case';
|
|
3
|
+
import { paramCase } from 'param-case';
|
|
4
|
+
import { pascalCase } from 'pascal-case';
|
|
5
|
+
import { upperCase } from 'upper-case';
|
|
6
|
+
export { lowerCase, upperCase, camelCase, pascalCase, paramCase };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var case_exports = {};
|
|
19
|
+
__export(case_exports, {
|
|
20
|
+
camelCase: () => import_camel_case.camelCase,
|
|
21
|
+
lowerCase: () => import_lower_case.lowerCase,
|
|
22
|
+
paramCase: () => import_param_case.paramCase,
|
|
23
|
+
pascalCase: () => import_pascal_case.pascalCase,
|
|
24
|
+
upperCase: () => import_upper_case.upperCase
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(case_exports);
|
|
27
|
+
var import_camel_case = require("camel-case");
|
|
28
|
+
var import_lower_case = require("lower-case");
|
|
29
|
+
var import_param_case = require("param-case");
|
|
30
|
+
var import_pascal_case = require("pascal-case");
|
|
31
|
+
var import_upper_case = require("upper-case");
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
camelCase,
|
|
35
|
+
lowerCase,
|
|
36
|
+
paramCase,
|
|
37
|
+
pascalCase,
|
|
38
|
+
upperCase
|
|
39
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const getType: (obj: any) => any;
|
|
2
|
+
export declare const isFn: (val: any) => val is Function;
|
|
3
|
+
export declare const isArr: (arg: any) => arg is any[];
|
|
4
|
+
export declare const isPlainObj: (obj: unknown) => obj is object;
|
|
5
|
+
export declare const isStr: (obj: unknown) => obj is string;
|
|
6
|
+
export declare const isBool: (obj: unknown) => obj is boolean;
|
|
7
|
+
export declare const isNum: (obj: unknown) => obj is number;
|
|
8
|
+
export declare const isMap: (val: any) => val is Map<any, any>;
|
|
9
|
+
export declare const isSet: (val: any) => val is Set<any>;
|
|
10
|
+
export declare const isWeakMap: (val: any) => val is WeakMap<any, any>;
|
|
11
|
+
export declare const isWeakSet: (val: any) => val is WeakSet<any>;
|
|
12
|
+
export declare const isNumberLike: (index: any) => index is number;
|
|
13
|
+
export declare const isObj: (val: unknown) => val is object;
|
|
14
|
+
export declare const isRegExp: (obj: unknown) => obj is RegExp;
|
|
15
|
+
export declare const isReactElement: (obj: any) => boolean;
|
|
16
|
+
export declare const isHTMLElement: (target: any) => target is EventTarget;
|
|
17
|
+
export type Subscriber<S> = (payload: S) => void;
|
|
18
|
+
export interface Subscription<S> {
|
|
19
|
+
notify?: (payload: S) => void | boolean;
|
|
20
|
+
filter?: (payload: S) => any;
|
|
21
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
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 checkers_exports = {};
|
|
20
|
+
__export(checkers_exports, {
|
|
21
|
+
getType: () => getType,
|
|
22
|
+
isArr: () => isArr,
|
|
23
|
+
isBool: () => isBool,
|
|
24
|
+
isFn: () => isFn,
|
|
25
|
+
isHTMLElement: () => isHTMLElement,
|
|
26
|
+
isMap: () => isMap,
|
|
27
|
+
isNum: () => isNum,
|
|
28
|
+
isNumberLike: () => isNumberLike,
|
|
29
|
+
isObj: () => isObj,
|
|
30
|
+
isPlainObj: () => isPlainObj,
|
|
31
|
+
isReactElement: () => isReactElement,
|
|
32
|
+
isRegExp: () => isRegExp,
|
|
33
|
+
isSet: () => isSet,
|
|
34
|
+
isStr: () => isStr,
|
|
35
|
+
isWeakMap: () => isWeakMap,
|
|
36
|
+
isWeakSet: () => isWeakSet
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(checkers_exports);
|
|
39
|
+
const toString = Object.prototype.toString;
|
|
40
|
+
const isType = /* @__PURE__ */ __name((type) => (obj) => getType(obj) === `[object ${type}]`, "isType");
|
|
41
|
+
const getType = /* @__PURE__ */ __name((obj) => toString.call(obj), "getType");
|
|
42
|
+
const isFn = /* @__PURE__ */ __name((val) => typeof val === "function", "isFn");
|
|
43
|
+
const isArr = Array.isArray;
|
|
44
|
+
const isPlainObj = isType("Object");
|
|
45
|
+
const isStr = isType("String");
|
|
46
|
+
const isBool = isType("Boolean");
|
|
47
|
+
const isNum = isType("Number");
|
|
48
|
+
const isMap = /* @__PURE__ */ __name((val) => val && val instanceof Map, "isMap");
|
|
49
|
+
const isSet = /* @__PURE__ */ __name((val) => val && val instanceof Set, "isSet");
|
|
50
|
+
const isWeakMap = /* @__PURE__ */ __name((val) => val && val instanceof WeakMap, "isWeakMap");
|
|
51
|
+
const isWeakSet = /* @__PURE__ */ __name((val) => val && val instanceof WeakSet, "isWeakSet");
|
|
52
|
+
const isNumberLike = /* @__PURE__ */ __name((index) => isNum(index) || /^\d+$/.test(index), "isNumberLike");
|
|
53
|
+
const isObj = /* @__PURE__ */ __name((val) => typeof val === "object", "isObj");
|
|
54
|
+
const isRegExp = isType("RegExp");
|
|
55
|
+
const isReactElement = /* @__PURE__ */ __name((obj) => obj && obj["$$typeof"] && obj["_owner"], "isReactElement");
|
|
56
|
+
const isHTMLElement = /* @__PURE__ */ __name((target) => {
|
|
57
|
+
return Object.prototype.toString.call(target).indexOf("HTML") > -1;
|
|
58
|
+
}, "isHTMLElement");
|
|
59
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
+
0 && (module.exports = {
|
|
61
|
+
getType,
|
|
62
|
+
isArr,
|
|
63
|
+
isBool,
|
|
64
|
+
isFn,
|
|
65
|
+
isHTMLElement,
|
|
66
|
+
isMap,
|
|
67
|
+
isNum,
|
|
68
|
+
isNumberLike,
|
|
69
|
+
isObj,
|
|
70
|
+
isPlainObj,
|
|
71
|
+
isReactElement,
|
|
72
|
+
isRegExp,
|
|
73
|
+
isSet,
|
|
74
|
+
isStr,
|
|
75
|
+
isWeakMap,
|
|
76
|
+
isWeakSet
|
|
77
|
+
});
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
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 clone_exports = {};
|
|
20
|
+
__export(clone_exports, {
|
|
21
|
+
clone: () => clone,
|
|
22
|
+
shallowClone: () => shallowClone
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(clone_exports);
|
|
25
|
+
var import_checkers = require("./checkers");
|
|
26
|
+
const shallowClone = /* @__PURE__ */ __name((values) => {
|
|
27
|
+
if (Array.isArray(values)) {
|
|
28
|
+
return values.slice(0);
|
|
29
|
+
} else if ((0, import_checkers.isPlainObj)(values)) {
|
|
30
|
+
if ("$$typeof" in values && "_owner" in values) {
|
|
31
|
+
return values;
|
|
32
|
+
}
|
|
33
|
+
if (values["_isBigNumber"]) {
|
|
34
|
+
return values;
|
|
35
|
+
}
|
|
36
|
+
if (values["_isAMomentObject"]) {
|
|
37
|
+
return values;
|
|
38
|
+
}
|
|
39
|
+
if (values["_isJSONSchemaObject"]) {
|
|
40
|
+
return values;
|
|
41
|
+
}
|
|
42
|
+
if ((0, import_checkers.isFn)(values["toJS"])) {
|
|
43
|
+
return values;
|
|
44
|
+
}
|
|
45
|
+
if ((0, import_checkers.isFn)(values["toJSON"])) {
|
|
46
|
+
return values;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
...values
|
|
50
|
+
};
|
|
51
|
+
} else if (typeof values === "object") {
|
|
52
|
+
return new values.constructor(values);
|
|
53
|
+
}
|
|
54
|
+
return values;
|
|
55
|
+
}, "shallowClone");
|
|
56
|
+
const clone = /* @__PURE__ */ __name((values) => {
|
|
57
|
+
if (Array.isArray(values)) {
|
|
58
|
+
const res = [];
|
|
59
|
+
values.forEach((item) => {
|
|
60
|
+
res.push(clone(item));
|
|
61
|
+
});
|
|
62
|
+
return res;
|
|
63
|
+
} else if ((0, import_checkers.isPlainObj)(values)) {
|
|
64
|
+
if ("$$typeof" in values && "_owner" in values) {
|
|
65
|
+
return values;
|
|
66
|
+
}
|
|
67
|
+
if (values["_isBigNumber"]) {
|
|
68
|
+
return values;
|
|
69
|
+
}
|
|
70
|
+
if (values["_isAMomentObject"]) {
|
|
71
|
+
return values;
|
|
72
|
+
}
|
|
73
|
+
if (values["_isJSONSchemaObject"]) {
|
|
74
|
+
return values;
|
|
75
|
+
}
|
|
76
|
+
if ((0, import_checkers.isFn)(values["toJS"])) {
|
|
77
|
+
return values["toJS"]();
|
|
78
|
+
}
|
|
79
|
+
if ((0, import_checkers.isFn)(values["toJSON"])) {
|
|
80
|
+
return values["toJSON"]();
|
|
81
|
+
}
|
|
82
|
+
const res = {};
|
|
83
|
+
for (const key in values) {
|
|
84
|
+
if (Object.hasOwnProperty.call(values, key)) {
|
|
85
|
+
res[key] = clone(values[key]);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return res;
|
|
89
|
+
} else {
|
|
90
|
+
return values;
|
|
91
|
+
}
|
|
92
|
+
}, "clone");
|
|
93
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
94
|
+
0 && (module.exports = {
|
|
95
|
+
clone,
|
|
96
|
+
shallowClone
|
|
97
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isEqual: (a: any, b: any) => any;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
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 compare_exports = {};
|
|
20
|
+
__export(compare_exports, {
|
|
21
|
+
isEqual: () => isEqual
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(compare_exports);
|
|
24
|
+
var import_checkers = require("./checkers");
|
|
25
|
+
var import_instanceof = require("./instanceof");
|
|
26
|
+
const isArray = import_checkers.isArr;
|
|
27
|
+
const keyList = Object.keys;
|
|
28
|
+
const hasProp = Object.prototype.hasOwnProperty;
|
|
29
|
+
function equal(a, b) {
|
|
30
|
+
if (a === b) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
if (a && b && typeof a === "object" && typeof b === "object") {
|
|
34
|
+
const arrA = isArray(a);
|
|
35
|
+
const arrB = isArray(b);
|
|
36
|
+
let i;
|
|
37
|
+
let length;
|
|
38
|
+
let key;
|
|
39
|
+
if (arrA && arrB) {
|
|
40
|
+
length = a.length;
|
|
41
|
+
if (length !== b.length) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
for (i = length; i-- !== 0; ) {
|
|
45
|
+
if (!equal(a[i], b[i])) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
if (arrA !== arrB) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
const momentA = a && a._isAMomentObject;
|
|
55
|
+
const momentB = b && b._isAMomentObject;
|
|
56
|
+
if (momentA !== momentB) return false;
|
|
57
|
+
if (momentA && momentB) return a.isSame(b);
|
|
58
|
+
const immutableA = a && a.toJS;
|
|
59
|
+
const immutableB = b && b.toJS;
|
|
60
|
+
if (immutableA !== immutableB) return false;
|
|
61
|
+
if (immutableA) return a.is ? a.is(b) : a === b;
|
|
62
|
+
const dateA = (0, import_instanceof.instOf)(a, "Date");
|
|
63
|
+
const dateB = (0, import_instanceof.instOf)(b, "Date");
|
|
64
|
+
if (dateA !== dateB) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
if (dateA && dateB) {
|
|
68
|
+
return a.getTime() === b.getTime();
|
|
69
|
+
}
|
|
70
|
+
const regexpA = (0, import_instanceof.instOf)(a, "RegExp");
|
|
71
|
+
const regexpB = (0, import_instanceof.instOf)(b, "RegExp");
|
|
72
|
+
if (regexpA !== regexpB) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
if (regexpA && regexpB) {
|
|
76
|
+
return a.toString() === b.toString();
|
|
77
|
+
}
|
|
78
|
+
const urlA = (0, import_instanceof.instOf)(a, "URL");
|
|
79
|
+
const urlB = (0, import_instanceof.instOf)(b, "URL");
|
|
80
|
+
if (urlA !== urlB) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
if (urlA && urlB) {
|
|
84
|
+
return a.href === b.href;
|
|
85
|
+
}
|
|
86
|
+
const schemaA = a && a.toJSON;
|
|
87
|
+
const schemaB = b && b.toJSON;
|
|
88
|
+
if (schemaA !== schemaB) return false;
|
|
89
|
+
if (schemaA && schemaB) return equal(a.toJSON(), b.toJSON());
|
|
90
|
+
const keys = keyList(a);
|
|
91
|
+
length = keys.length;
|
|
92
|
+
if (length !== keyList(b).length) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
for (i = length; i-- !== 0; ) {
|
|
96
|
+
if (!hasProp.call(b, keys[i])) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
for (i = length; i-- !== 0; ) {
|
|
101
|
+
key = keys[i];
|
|
102
|
+
if (key === "_owner" && a.$$typeof) {
|
|
103
|
+
continue;
|
|
104
|
+
} else {
|
|
105
|
+
if (!equal(a[key], b[key])) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
return a !== a && b !== b;
|
|
113
|
+
}
|
|
114
|
+
__name(equal, "equal");
|
|
115
|
+
const isEqual = /* @__PURE__ */ __name(function exportedEqual(a, b) {
|
|
116
|
+
try {
|
|
117
|
+
return equal(a, b);
|
|
118
|
+
} catch (error) {
|
|
119
|
+
if (error.message && error.message.match(/stack|recursion/i) || error.number === -2146828260) {
|
|
120
|
+
console.warn("Warning: react-fast-compare does not handle circular references.", error.name, error.message);
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
throw error;
|
|
124
|
+
}
|
|
125
|
+
}, "exportedEqual");
|
|
126
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
127
|
+
0 && (module.exports = {
|
|
128
|
+
isEqual
|
|
129
|
+
});
|