251127:1700 Frontend Start Build
This commit is contained in:
2
frontend/.ignored_node_modules/zustand/esm/index.d.mts
generated
Normal file
2
frontend/.ignored_node_modules/zustand/esm/index.d.mts
generated
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from 'zustand/vanilla';
|
||||
export * from 'zustand/react';
|
||||
2
frontend/.ignored_node_modules/zustand/esm/index.mjs
generated
Normal file
2
frontend/.ignored_node_modules/zustand/esm/index.mjs
generated
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from 'zustand/vanilla';
|
||||
export * from 'zustand/react';
|
||||
5
frontend/.ignored_node_modules/zustand/esm/middleware.d.mts
generated
Normal file
5
frontend/.ignored_node_modules/zustand/esm/middleware.d.mts
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
export { redux } from './middleware/redux.mjs';
|
||||
export { devtools, type DevtoolsOptions, type NamedSet, } from './middleware/devtools.mjs';
|
||||
export { subscribeWithSelector } from './middleware/subscribeWithSelector.mjs';
|
||||
export { combine } from './middleware/combine.mjs';
|
||||
export { persist, createJSONStorage, type StateStorage, type StorageValue, type PersistStorage, type PersistOptions, } from './middleware/persist.mjs';
|
||||
462
frontend/.ignored_node_modules/zustand/esm/middleware.mjs
generated
Normal file
462
frontend/.ignored_node_modules/zustand/esm/middleware.mjs
generated
Normal file
@@ -0,0 +1,462 @@
|
||||
const reduxImpl = (reducer, initial) => (set, _get, api) => {
|
||||
api.dispatch = (action) => {
|
||||
set((state) => reducer(state, action), false, action);
|
||||
return action;
|
||||
};
|
||||
api.dispatchFromDevtools = true;
|
||||
return { dispatch: (...args) => api.dispatch(...args), ...initial };
|
||||
};
|
||||
const redux = reduxImpl;
|
||||
|
||||
const trackedConnections = /* @__PURE__ */ new Map();
|
||||
const getTrackedConnectionState = (name) => {
|
||||
const api = trackedConnections.get(name);
|
||||
if (!api) return {};
|
||||
return Object.fromEntries(
|
||||
Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()])
|
||||
);
|
||||
};
|
||||
const extractConnectionInformation = (store, extensionConnector, options) => {
|
||||
if (store === void 0) {
|
||||
return {
|
||||
type: "untracked",
|
||||
connection: extensionConnector.connect(options)
|
||||
};
|
||||
}
|
||||
const existingConnection = trackedConnections.get(options.name);
|
||||
if (existingConnection) {
|
||||
return { type: "tracked", store, ...existingConnection };
|
||||
}
|
||||
const newConnection = {
|
||||
connection: extensionConnector.connect(options),
|
||||
stores: {}
|
||||
};
|
||||
trackedConnections.set(options.name, newConnection);
|
||||
return { type: "tracked", store, ...newConnection };
|
||||
};
|
||||
const removeStoreFromTrackedConnections = (name, store) => {
|
||||
if (store === void 0) return;
|
||||
const connectionInfo = trackedConnections.get(name);
|
||||
if (!connectionInfo) return;
|
||||
delete connectionInfo.stores[store];
|
||||
if (Object.keys(connectionInfo.stores).length === 0) {
|
||||
trackedConnections.delete(name);
|
||||
}
|
||||
};
|
||||
const findCallerName = (stack) => {
|
||||
var _a, _b;
|
||||
if (!stack) return void 0;
|
||||
const traceLines = stack.split("\n");
|
||||
const apiSetStateLineIndex = traceLines.findIndex(
|
||||
(traceLine) => traceLine.includes("api.setState")
|
||||
);
|
||||
if (apiSetStateLineIndex < 0) return void 0;
|
||||
const callerLine = ((_a = traceLines[apiSetStateLineIndex + 1]) == null ? void 0 : _a.trim()) || "";
|
||||
return (_b = /.+ (.+) .+/.exec(callerLine)) == null ? void 0 : _b[1];
|
||||
};
|
||||
const devtoolsImpl = (fn, devtoolsOptions = {}) => (set, get, api) => {
|
||||
const { enabled, anonymousActionType, store, ...options } = devtoolsOptions;
|
||||
let extensionConnector;
|
||||
try {
|
||||
extensionConnector = (enabled != null ? enabled : (import.meta.env ? import.meta.env.MODE : void 0) !== "production") && window.__REDUX_DEVTOOLS_EXTENSION__;
|
||||
} catch (e) {
|
||||
}
|
||||
if (!extensionConnector) {
|
||||
return fn(set, get, api);
|
||||
}
|
||||
const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options);
|
||||
let isRecording = true;
|
||||
api.setState = ((state, replace, nameOrAction) => {
|
||||
const r = set(state, replace);
|
||||
if (!isRecording) return r;
|
||||
const action = nameOrAction === void 0 ? {
|
||||
type: anonymousActionType || findCallerName(new Error().stack) || "anonymous"
|
||||
} : typeof nameOrAction === "string" ? { type: nameOrAction } : nameOrAction;
|
||||
if (store === void 0) {
|
||||
connection == null ? void 0 : connection.send(action, get());
|
||||
return r;
|
||||
}
|
||||
connection == null ? void 0 : connection.send(
|
||||
{
|
||||
...action,
|
||||
type: `${store}/${action.type}`
|
||||
},
|
||||
{
|
||||
...getTrackedConnectionState(options.name),
|
||||
[store]: api.getState()
|
||||
}
|
||||
);
|
||||
return r;
|
||||
});
|
||||
api.devtools = {
|
||||
cleanup: () => {
|
||||
if (connection && typeof connection.unsubscribe === "function") {
|
||||
connection.unsubscribe();
|
||||
}
|
||||
removeStoreFromTrackedConnections(options.name, store);
|
||||
}
|
||||
};
|
||||
const setStateFromDevtools = (...a) => {
|
||||
const originalIsRecording = isRecording;
|
||||
isRecording = false;
|
||||
set(...a);
|
||||
isRecording = originalIsRecording;
|
||||
};
|
||||
const initialState = fn(api.setState, get, api);
|
||||
if (connectionInformation.type === "untracked") {
|
||||
connection == null ? void 0 : connection.init(initialState);
|
||||
} else {
|
||||
connectionInformation.stores[connectionInformation.store] = api;
|
||||
connection == null ? void 0 : connection.init(
|
||||
Object.fromEntries(
|
||||
Object.entries(connectionInformation.stores).map(([key, store2]) => [
|
||||
key,
|
||||
key === connectionInformation.store ? initialState : store2.getState()
|
||||
])
|
||||
)
|
||||
);
|
||||
}
|
||||
if (api.dispatchFromDevtools && typeof api.dispatch === "function") {
|
||||
let didWarnAboutReservedActionType = false;
|
||||
const originalDispatch = api.dispatch;
|
||||
api.dispatch = (...args) => {
|
||||
if ((import.meta.env ? import.meta.env.MODE : void 0) !== "production" && args[0].type === "__setState" && !didWarnAboutReservedActionType) {
|
||||
console.warn(
|
||||
'[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'
|
||||
);
|
||||
didWarnAboutReservedActionType = true;
|
||||
}
|
||||
originalDispatch(...args);
|
||||
};
|
||||
}
|
||||
connection.subscribe((message) => {
|
||||
var _a;
|
||||
switch (message.type) {
|
||||
case "ACTION":
|
||||
if (typeof message.payload !== "string") {
|
||||
console.error(
|
||||
"[zustand devtools middleware] Unsupported action format"
|
||||
);
|
||||
return;
|
||||
}
|
||||
return parseJsonThen(
|
||||
message.payload,
|
||||
(action) => {
|
||||
if (action.type === "__setState") {
|
||||
if (store === void 0) {
|
||||
setStateFromDevtools(action.state);
|
||||
return;
|
||||
}
|
||||
if (Object.keys(action.state).length !== 1) {
|
||||
console.error(
|
||||
`
|
||||
[zustand devtools middleware] Unsupported __setState action format.
|
||||
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
||||
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|
||||
`
|
||||
);
|
||||
}
|
||||
const stateFromDevtools = action.state[store];
|
||||
if (stateFromDevtools === void 0 || stateFromDevtools === null) {
|
||||
return;
|
||||
}
|
||||
if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) {
|
||||
setStateFromDevtools(stateFromDevtools);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!api.dispatchFromDevtools) return;
|
||||
if (typeof api.dispatch !== "function") return;
|
||||
api.dispatch(action);
|
||||
}
|
||||
);
|
||||
case "DISPATCH":
|
||||
switch (message.payload.type) {
|
||||
case "RESET":
|
||||
setStateFromDevtools(initialState);
|
||||
if (store === void 0) {
|
||||
return connection == null ? void 0 : connection.init(api.getState());
|
||||
}
|
||||
return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));
|
||||
case "COMMIT":
|
||||
if (store === void 0) {
|
||||
connection == null ? void 0 : connection.init(api.getState());
|
||||
return;
|
||||
}
|
||||
return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));
|
||||
case "ROLLBACK":
|
||||
return parseJsonThen(message.state, (state) => {
|
||||
if (store === void 0) {
|
||||
setStateFromDevtools(state);
|
||||
connection == null ? void 0 : connection.init(api.getState());
|
||||
return;
|
||||
}
|
||||
setStateFromDevtools(state[store]);
|
||||
connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));
|
||||
});
|
||||
case "JUMP_TO_STATE":
|
||||
case "JUMP_TO_ACTION":
|
||||
return parseJsonThen(message.state, (state) => {
|
||||
if (store === void 0) {
|
||||
setStateFromDevtools(state);
|
||||
return;
|
||||
}
|
||||
if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) {
|
||||
setStateFromDevtools(state[store]);
|
||||
}
|
||||
});
|
||||
case "IMPORT_STATE": {
|
||||
const { nextLiftedState } = message.payload;
|
||||
const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a.state;
|
||||
if (!lastComputedState) return;
|
||||
if (store === void 0) {
|
||||
setStateFromDevtools(lastComputedState);
|
||||
} else {
|
||||
setStateFromDevtools(lastComputedState[store]);
|
||||
}
|
||||
connection == null ? void 0 : connection.send(
|
||||
null,
|
||||
// FIXME no-any
|
||||
nextLiftedState
|
||||
);
|
||||
return;
|
||||
}
|
||||
case "PAUSE_RECORDING":
|
||||
return isRecording = !isRecording;
|
||||
}
|
||||
return;
|
||||
}
|
||||
});
|
||||
return initialState;
|
||||
};
|
||||
const devtools = devtoolsImpl;
|
||||
const parseJsonThen = (stringified, fn) => {
|
||||
let parsed;
|
||||
try {
|
||||
parsed = JSON.parse(stringified);
|
||||
} catch (e) {
|
||||
console.error(
|
||||
"[zustand devtools middleware] Could not parse the received json",
|
||||
e
|
||||
);
|
||||
}
|
||||
if (parsed !== void 0) fn(parsed);
|
||||
};
|
||||
|
||||
const subscribeWithSelectorImpl = (fn) => (set, get, api) => {
|
||||
const origSubscribe = api.subscribe;
|
||||
api.subscribe = ((selector, optListener, options) => {
|
||||
let listener = selector;
|
||||
if (optListener) {
|
||||
const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;
|
||||
let currentSlice = selector(api.getState());
|
||||
listener = (state) => {
|
||||
const nextSlice = selector(state);
|
||||
if (!equalityFn(currentSlice, nextSlice)) {
|
||||
const previousSlice = currentSlice;
|
||||
optListener(currentSlice = nextSlice, previousSlice);
|
||||
}
|
||||
};
|
||||
if (options == null ? void 0 : options.fireImmediately) {
|
||||
optListener(currentSlice, currentSlice);
|
||||
}
|
||||
}
|
||||
return origSubscribe(listener);
|
||||
});
|
||||
const initialState = fn(set, get, api);
|
||||
return initialState;
|
||||
};
|
||||
const subscribeWithSelector = subscribeWithSelectorImpl;
|
||||
|
||||
function combine(initialState, create) {
|
||||
return (...args) => Object.assign({}, initialState, create(...args));
|
||||
}
|
||||
|
||||
function createJSONStorage(getStorage, options) {
|
||||
let storage;
|
||||
try {
|
||||
storage = getStorage();
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
const persistStorage = {
|
||||
getItem: (name) => {
|
||||
var _a;
|
||||
const parse = (str2) => {
|
||||
if (str2 === null) {
|
||||
return null;
|
||||
}
|
||||
return JSON.parse(str2, options == null ? void 0 : options.reviver);
|
||||
};
|
||||
const str = (_a = storage.getItem(name)) != null ? _a : null;
|
||||
if (str instanceof Promise) {
|
||||
return str.then(parse);
|
||||
}
|
||||
return parse(str);
|
||||
},
|
||||
setItem: (name, newValue) => storage.setItem(name, JSON.stringify(newValue, options == null ? void 0 : options.replacer)),
|
||||
removeItem: (name) => storage.removeItem(name)
|
||||
};
|
||||
return persistStorage;
|
||||
}
|
||||
const toThenable = (fn) => (input) => {
|
||||
try {
|
||||
const result = fn(input);
|
||||
if (result instanceof Promise) {
|
||||
return result;
|
||||
}
|
||||
return {
|
||||
then(onFulfilled) {
|
||||
return toThenable(onFulfilled)(result);
|
||||
},
|
||||
catch(_onRejected) {
|
||||
return this;
|
||||
}
|
||||
};
|
||||
} catch (e) {
|
||||
return {
|
||||
then(_onFulfilled) {
|
||||
return this;
|
||||
},
|
||||
catch(onRejected) {
|
||||
return toThenable(onRejected)(e);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
const persistImpl = (config, baseOptions) => (set, get, api) => {
|
||||
let options = {
|
||||
storage: createJSONStorage(() => localStorage),
|
||||
partialize: (state) => state,
|
||||
version: 0,
|
||||
merge: (persistedState, currentState) => ({
|
||||
...currentState,
|
||||
...persistedState
|
||||
}),
|
||||
...baseOptions
|
||||
};
|
||||
let hasHydrated = false;
|
||||
const hydrationListeners = /* @__PURE__ */ new Set();
|
||||
const finishHydrationListeners = /* @__PURE__ */ new Set();
|
||||
let storage = options.storage;
|
||||
if (!storage) {
|
||||
return config(
|
||||
(...args) => {
|
||||
console.warn(
|
||||
`[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`
|
||||
);
|
||||
set(...args);
|
||||
},
|
||||
get,
|
||||
api
|
||||
);
|
||||
}
|
||||
const setItem = () => {
|
||||
const state = options.partialize({ ...get() });
|
||||
return storage.setItem(options.name, {
|
||||
state,
|
||||
version: options.version
|
||||
});
|
||||
};
|
||||
const savedSetState = api.setState;
|
||||
api.setState = (state, replace) => {
|
||||
savedSetState(state, replace);
|
||||
return setItem();
|
||||
};
|
||||
const configResult = config(
|
||||
(...args) => {
|
||||
set(...args);
|
||||
return setItem();
|
||||
},
|
||||
get,
|
||||
api
|
||||
);
|
||||
api.getInitialState = () => configResult;
|
||||
let stateFromStorage;
|
||||
const hydrate = () => {
|
||||
var _a, _b;
|
||||
if (!storage) return;
|
||||
hasHydrated = false;
|
||||
hydrationListeners.forEach((cb) => {
|
||||
var _a2;
|
||||
return cb((_a2 = get()) != null ? _a2 : configResult);
|
||||
});
|
||||
const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0;
|
||||
return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {
|
||||
if (deserializedStorageValue) {
|
||||
if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) {
|
||||
if (options.migrate) {
|
||||
const migration = options.migrate(
|
||||
deserializedStorageValue.state,
|
||||
deserializedStorageValue.version
|
||||
);
|
||||
if (migration instanceof Promise) {
|
||||
return migration.then((result) => [true, result]);
|
||||
}
|
||||
return [true, migration];
|
||||
}
|
||||
console.error(
|
||||
`State loaded from storage couldn't be migrated since no migrate function was provided`
|
||||
);
|
||||
} else {
|
||||
return [false, deserializedStorageValue.state];
|
||||
}
|
||||
}
|
||||
return [false, void 0];
|
||||
}).then((migrationResult) => {
|
||||
var _a2;
|
||||
const [migrated, migratedState] = migrationResult;
|
||||
stateFromStorage = options.merge(
|
||||
migratedState,
|
||||
(_a2 = get()) != null ? _a2 : configResult
|
||||
);
|
||||
set(stateFromStorage, true);
|
||||
if (migrated) {
|
||||
return setItem();
|
||||
}
|
||||
}).then(() => {
|
||||
postRehydrationCallback == null ? void 0 : postRehydrationCallback(stateFromStorage, void 0);
|
||||
stateFromStorage = get();
|
||||
hasHydrated = true;
|
||||
finishHydrationListeners.forEach((cb) => cb(stateFromStorage));
|
||||
}).catch((e) => {
|
||||
postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);
|
||||
});
|
||||
};
|
||||
api.persist = {
|
||||
setOptions: (newOptions) => {
|
||||
options = {
|
||||
...options,
|
||||
...newOptions
|
||||
};
|
||||
if (newOptions.storage) {
|
||||
storage = newOptions.storage;
|
||||
}
|
||||
},
|
||||
clearStorage: () => {
|
||||
storage == null ? void 0 : storage.removeItem(options.name);
|
||||
},
|
||||
getOptions: () => options,
|
||||
rehydrate: () => hydrate(),
|
||||
hasHydrated: () => hasHydrated,
|
||||
onHydrate: (cb) => {
|
||||
hydrationListeners.add(cb);
|
||||
return () => {
|
||||
hydrationListeners.delete(cb);
|
||||
};
|
||||
},
|
||||
onFinishHydration: (cb) => {
|
||||
finishHydrationListeners.add(cb);
|
||||
return () => {
|
||||
finishHydrationListeners.delete(cb);
|
||||
};
|
||||
}
|
||||
};
|
||||
if (!options.skipHydration) {
|
||||
hydrate();
|
||||
}
|
||||
return stateFromStorage || configResult;
|
||||
};
|
||||
const persist = persistImpl;
|
||||
|
||||
export { combine, createJSONStorage, devtools, persist, redux, subscribeWithSelector };
|
||||
4
frontend/.ignored_node_modules/zustand/esm/middleware/combine.d.mts
generated
Normal file
4
frontend/.ignored_node_modules/zustand/esm/middleware/combine.d.mts
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
import type { StateCreator, StoreMutatorIdentifier } from 'zustand/vanilla';
|
||||
type Write<T, U> = Omit<T, keyof U> & U;
|
||||
export declare function combine<T extends object, U extends object, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = []>(initialState: T, create: StateCreator<T, Mps, Mcs, U>): StateCreator<Write<T, U>, Mps, Mcs>;
|
||||
export {};
|
||||
58
frontend/.ignored_node_modules/zustand/esm/middleware/devtools.d.mts
generated
Normal file
58
frontend/.ignored_node_modules/zustand/esm/middleware/devtools.d.mts
generated
Normal file
@@ -0,0 +1,58 @@
|
||||
import type { StateCreator, StoreApi, StoreMutatorIdentifier } from 'zustand/vanilla';
|
||||
type Config = Parameters<(Window extends {
|
||||
__REDUX_DEVTOOLS_EXTENSION__?: infer T;
|
||||
} ? T : {
|
||||
connect: (param: any) => any;
|
||||
})['connect']>[0];
|
||||
declare module '../vanilla.mjs' {
|
||||
interface StoreMutators<S, A> {
|
||||
'zustand/devtools': WithDevtools<S>;
|
||||
}
|
||||
}
|
||||
type Cast<T, U> = T extends U ? T : U;
|
||||
type Write<T, U> = Omit<T, keyof U> & U;
|
||||
type TakeTwo<T> = T extends {
|
||||
length: 0;
|
||||
} ? [undefined, undefined] : T extends {
|
||||
length: 1;
|
||||
} ? [...args0: Cast<T, unknown[]>, arg1: undefined] : T extends {
|
||||
length: 0 | 1;
|
||||
} ? [...args0: Cast<T, unknown[]>, arg1: undefined] : T extends {
|
||||
length: 2;
|
||||
} ? T : T extends {
|
||||
length: 1 | 2;
|
||||
} ? T : T extends {
|
||||
length: 0 | 1 | 2;
|
||||
} ? T : T extends [infer A0, infer A1, ...unknown[]] ? [A0, A1] : T extends [infer A0, (infer A1)?, ...unknown[]] ? [A0, A1?] : T extends [(infer A0)?, (infer A1)?, ...unknown[]] ? [A0?, A1?] : never;
|
||||
type WithDevtools<S> = Write<S, StoreDevtools<S>>;
|
||||
type Action = string | {
|
||||
type: string;
|
||||
[x: string | number | symbol]: unknown;
|
||||
};
|
||||
type StoreDevtools<S> = S extends {
|
||||
setState: {
|
||||
(...args: infer Sa1): infer Sr1;
|
||||
(...args: infer Sa2): infer Sr2;
|
||||
};
|
||||
} ? {
|
||||
setState(...args: [...args: TakeTwo<Sa1>, action?: Action]): Sr1;
|
||||
setState(...args: [...args: TakeTwo<Sa2>, action?: Action]): Sr2;
|
||||
devtools: {
|
||||
cleanup: () => void;
|
||||
};
|
||||
} : never;
|
||||
export interface DevtoolsOptions extends Config {
|
||||
name?: string;
|
||||
enabled?: boolean;
|
||||
anonymousActionType?: string;
|
||||
store?: string;
|
||||
}
|
||||
type Devtools = <T, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = [], U = T>(initializer: StateCreator<T, [...Mps, ['zustand/devtools', never]], Mcs, U>, devtoolsOptions?: DevtoolsOptions) => StateCreator<T, Mps, [['zustand/devtools', never], ...Mcs]>;
|
||||
declare module '../vanilla.mjs' {
|
||||
interface StoreMutators<S, A> {
|
||||
'zustand/devtools': WithDevtools<S>;
|
||||
}
|
||||
}
|
||||
export type NamedSet<T> = WithDevtools<StoreApi<T>>['setState'];
|
||||
export declare const devtools: Devtools;
|
||||
export {};
|
||||
29
frontend/.ignored_node_modules/zustand/esm/middleware/immer.d.mts
generated
Normal file
29
frontend/.ignored_node_modules/zustand/esm/middleware/immer.d.mts
generated
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { Draft } from 'immer';
|
||||
import type { StateCreator, StoreMutatorIdentifier } from 'zustand/vanilla';
|
||||
type Immer = <T, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = []>(initializer: StateCreator<T, [...Mps, ['zustand/immer', never]], Mcs>) => StateCreator<T, Mps, [['zustand/immer', never], ...Mcs]>;
|
||||
declare module '../vanilla.mjs' {
|
||||
interface StoreMutators<S, A> {
|
||||
['zustand/immer']: WithImmer<S>;
|
||||
}
|
||||
}
|
||||
type Write<T, U> = Omit<T, keyof U> & U;
|
||||
type SkipTwo<T> = T extends {
|
||||
length: 0;
|
||||
} ? [] : T extends {
|
||||
length: 1;
|
||||
} ? [] : T extends {
|
||||
length: 0 | 1;
|
||||
} ? [] : T extends [unknown, unknown, ...infer A] ? A : T extends [unknown, unknown?, ...infer A] ? A : T extends [unknown?, unknown?, ...infer A] ? A : never;
|
||||
type SetStateType<T extends unknown[]> = Exclude<T[0], (...args: any[]) => any>;
|
||||
type WithImmer<S> = Write<S, StoreImmer<S>>;
|
||||
type StoreImmer<S> = S extends {
|
||||
setState: infer SetState;
|
||||
} ? SetState extends {
|
||||
(...args: infer A1): infer Sr1;
|
||||
(...args: infer A2): infer Sr2;
|
||||
} ? {
|
||||
setState(nextStateOrUpdater: SetStateType<A2> | Partial<SetStateType<A2>> | ((state: Draft<SetStateType<A2>>) => void), shouldReplace?: false, ...args: SkipTwo<A1>): Sr1;
|
||||
setState(nextStateOrUpdater: SetStateType<A2> | ((state: Draft<SetStateType<A2>>) => void), shouldReplace: true, ...args: SkipTwo<A2>): Sr2;
|
||||
} : never : never;
|
||||
export declare const immer: Immer;
|
||||
export {};
|
||||
12
frontend/.ignored_node_modules/zustand/esm/middleware/immer.mjs
generated
Normal file
12
frontend/.ignored_node_modules/zustand/esm/middleware/immer.mjs
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
import { produce } from 'immer';
|
||||
|
||||
const immerImpl = (initializer) => (set, get, store) => {
|
||||
store.setState = (updater, replace, ...args) => {
|
||||
const nextState = typeof updater === "function" ? produce(updater) : updater;
|
||||
return set(nextState, replace, ...args);
|
||||
};
|
||||
return initializer(store.setState, get, store);
|
||||
};
|
||||
const immer = immerImpl;
|
||||
|
||||
export { immer };
|
||||
99
frontend/.ignored_node_modules/zustand/esm/middleware/persist.d.mts
generated
Normal file
99
frontend/.ignored_node_modules/zustand/esm/middleware/persist.d.mts
generated
Normal file
@@ -0,0 +1,99 @@
|
||||
import type { StateCreator, StoreMutatorIdentifier } from 'zustand/vanilla';
|
||||
export interface StateStorage<R = unknown> {
|
||||
getItem: (name: string) => string | null | Promise<string | null>;
|
||||
setItem: (name: string, value: string) => R;
|
||||
removeItem: (name: string) => R;
|
||||
}
|
||||
export type StorageValue<S> = {
|
||||
state: S;
|
||||
version?: number;
|
||||
};
|
||||
export interface PersistStorage<S, R = unknown> {
|
||||
getItem: (name: string) => StorageValue<S> | null | Promise<StorageValue<S> | null>;
|
||||
setItem: (name: string, value: StorageValue<S>) => R;
|
||||
removeItem: (name: string) => R;
|
||||
}
|
||||
type JsonStorageOptions = {
|
||||
reviver?: (key: string, value: unknown) => unknown;
|
||||
replacer?: (key: string, value: unknown) => unknown;
|
||||
};
|
||||
export declare function createJSONStorage<S, R = unknown>(getStorage: () => StateStorage<R>, options?: JsonStorageOptions): PersistStorage<S, unknown> | undefined;
|
||||
export interface PersistOptions<S, PersistedState = S, PersistReturn = unknown> {
|
||||
/** Name of the storage (must be unique) */
|
||||
name: string;
|
||||
/**
|
||||
* Use a custom persist storage.
|
||||
*
|
||||
* Combining `createJSONStorage` helps creating a persist storage
|
||||
* with JSON.parse and JSON.stringify.
|
||||
*
|
||||
* @default createJSONStorage(() => localStorage)
|
||||
*/
|
||||
storage?: PersistStorage<PersistedState, PersistReturn> | undefined;
|
||||
/**
|
||||
* Filter the persisted value.
|
||||
*
|
||||
* @params state The state's value
|
||||
*/
|
||||
partialize?: (state: S) => PersistedState;
|
||||
/**
|
||||
* A function returning another (optional) function.
|
||||
* The main function will be called before the state rehydration.
|
||||
* The returned function will be called after the state rehydration or when an error occurred.
|
||||
*/
|
||||
onRehydrateStorage?: (state: S) => ((state?: S, error?: unknown) => void) | void;
|
||||
/**
|
||||
* If the stored state's version mismatch the one specified here, the storage will not be used.
|
||||
* This is useful when adding a breaking change to your store.
|
||||
*/
|
||||
version?: number;
|
||||
/**
|
||||
* A function to perform persisted state migration.
|
||||
* This function will be called when persisted state versions mismatch with the one specified here.
|
||||
*/
|
||||
migrate?: (persistedState: unknown, version: number) => PersistedState | Promise<PersistedState>;
|
||||
/**
|
||||
* A function to perform custom hydration merges when combining the stored state with the current one.
|
||||
* By default, this function does a shallow merge.
|
||||
*/
|
||||
merge?: (persistedState: unknown, currentState: S) => S;
|
||||
/**
|
||||
* An optional boolean that will prevent the persist middleware from triggering hydration on initialization,
|
||||
* This allows you to call `rehydrate()` at a specific point in your apps rendering life-cycle.
|
||||
*
|
||||
* This is useful in SSR application.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
skipHydration?: boolean;
|
||||
}
|
||||
type PersistListener<S> = (state: S) => void;
|
||||
type StorePersist<S, Ps, Pr> = S extends {
|
||||
getState: () => infer T;
|
||||
setState: {
|
||||
(...args: infer Sa1): infer Sr1;
|
||||
(...args: infer Sa2): infer Sr2;
|
||||
};
|
||||
} ? {
|
||||
setState(...args: Sa1): Sr1 | Pr;
|
||||
setState(...args: Sa2): Sr2 | Pr;
|
||||
persist: {
|
||||
setOptions: (options: Partial<PersistOptions<T, Ps, Pr>>) => void;
|
||||
clearStorage: () => void;
|
||||
rehydrate: () => Promise<void> | void;
|
||||
hasHydrated: () => boolean;
|
||||
onHydrate: (fn: PersistListener<T>) => () => void;
|
||||
onFinishHydration: (fn: PersistListener<T>) => () => void;
|
||||
getOptions: () => Partial<PersistOptions<T, Ps, Pr>>;
|
||||
};
|
||||
} : never;
|
||||
type Persist = <T, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = [], U = T>(initializer: StateCreator<T, [...Mps, ['zustand/persist', unknown]], Mcs>, options: PersistOptions<T, U>) => StateCreator<T, Mps, [['zustand/persist', U], ...Mcs]>;
|
||||
declare module '../vanilla.mjs' {
|
||||
interface StoreMutators<S, A> {
|
||||
'zustand/persist': WithPersist<S, A>;
|
||||
}
|
||||
}
|
||||
type Write<T, U> = Omit<T, keyof U> & U;
|
||||
type WithPersist<S, A> = Write<S, StorePersist<S, A, unknown>>;
|
||||
export declare const persist: Persist;
|
||||
export {};
|
||||
21
frontend/.ignored_node_modules/zustand/esm/middleware/redux.d.mts
generated
Normal file
21
frontend/.ignored_node_modules/zustand/esm/middleware/redux.d.mts
generated
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { StateCreator, StoreMutatorIdentifier } from 'zustand/vanilla';
|
||||
type Write<T, U> = Omit<T, keyof U> & U;
|
||||
type Action = {
|
||||
type: string;
|
||||
};
|
||||
type StoreRedux<A> = {
|
||||
dispatch: (a: A) => A;
|
||||
dispatchFromDevtools: true;
|
||||
};
|
||||
type ReduxState<A> = {
|
||||
dispatch: StoreRedux<A>['dispatch'];
|
||||
};
|
||||
type WithRedux<S, A> = Write<S, StoreRedux<A>>;
|
||||
type Redux = <T, A extends Action, Cms extends [StoreMutatorIdentifier, unknown][] = []>(reducer: (state: T, action: A) => T, initialState: T) => StateCreator<Write<T, ReduxState<A>>, Cms, [['zustand/redux', A]]>;
|
||||
declare module '../vanilla.mjs' {
|
||||
interface StoreMutators<S, A> {
|
||||
'zustand/redux': WithRedux<S, A>;
|
||||
}
|
||||
}
|
||||
export declare const redux: Redux;
|
||||
export {};
|
||||
25
frontend/.ignored_node_modules/zustand/esm/middleware/subscribeWithSelector.d.mts
generated
Normal file
25
frontend/.ignored_node_modules/zustand/esm/middleware/subscribeWithSelector.d.mts
generated
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { StateCreator, StoreMutatorIdentifier } from 'zustand/vanilla';
|
||||
type SubscribeWithSelector = <T, Mps extends [StoreMutatorIdentifier, unknown][] = [], Mcs extends [StoreMutatorIdentifier, unknown][] = []>(initializer: StateCreator<T, [
|
||||
...Mps,
|
||||
['zustand/subscribeWithSelector', never]
|
||||
], Mcs>) => StateCreator<T, Mps, [['zustand/subscribeWithSelector', never], ...Mcs]>;
|
||||
type Write<T, U> = Omit<T, keyof U> & U;
|
||||
type WithSelectorSubscribe<S> = S extends {
|
||||
getState: () => infer T;
|
||||
} ? Write<S, StoreSubscribeWithSelector<T>> : never;
|
||||
declare module '../vanilla.mjs' {
|
||||
interface StoreMutators<S, A> {
|
||||
['zustand/subscribeWithSelector']: WithSelectorSubscribe<S>;
|
||||
}
|
||||
}
|
||||
type StoreSubscribeWithSelector<T> = {
|
||||
subscribe: {
|
||||
(listener: (selectedState: T, previousSelectedState: T) => void): () => void;
|
||||
<U>(selector: (state: T) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
||||
equalityFn?: (a: U, b: U) => boolean;
|
||||
fireImmediately?: boolean;
|
||||
}): () => void;
|
||||
};
|
||||
};
|
||||
export declare const subscribeWithSelector: SubscribeWithSelector;
|
||||
export {};
|
||||
14
frontend/.ignored_node_modules/zustand/esm/react.d.mts
generated
Normal file
14
frontend/.ignored_node_modules/zustand/esm/react.d.mts
generated
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { ExtractState, Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from 'zustand/vanilla';
|
||||
type ReadonlyStoreApi<T> = Pick<StoreApi<T>, 'getState' | 'getInitialState' | 'subscribe'>;
|
||||
export declare function useStore<S extends ReadonlyStoreApi<unknown>>(api: S): ExtractState<S>;
|
||||
export declare function useStore<S extends ReadonlyStoreApi<unknown>, U>(api: S, selector: (state: ExtractState<S>) => U): U;
|
||||
export type UseBoundStore<S extends ReadonlyStoreApi<unknown>> = {
|
||||
(): ExtractState<S>;
|
||||
<U>(selector: (state: ExtractState<S>) => U): U;
|
||||
} & S;
|
||||
type Create = {
|
||||
<T, Mos extends [StoreMutatorIdentifier, unknown][] = []>(initializer: StateCreator<T, [], Mos>): UseBoundStore<Mutate<StoreApi<T>, Mos>>;
|
||||
<T>(): <Mos extends [StoreMutatorIdentifier, unknown][] = []>(initializer: StateCreator<T, [], Mos>) => UseBoundStore<Mutate<StoreApi<T>, Mos>>;
|
||||
};
|
||||
export declare const create: Create;
|
||||
export {};
|
||||
22
frontend/.ignored_node_modules/zustand/esm/react.mjs
generated
Normal file
22
frontend/.ignored_node_modules/zustand/esm/react.mjs
generated
Normal file
@@ -0,0 +1,22 @@
|
||||
import React from 'react';
|
||||
import { createStore } from 'zustand/vanilla';
|
||||
|
||||
const identity = (arg) => arg;
|
||||
function useStore(api, selector = identity) {
|
||||
const slice = React.useSyncExternalStore(
|
||||
api.subscribe,
|
||||
React.useCallback(() => selector(api.getState()), [api, selector]),
|
||||
React.useCallback(() => selector(api.getInitialState()), [api, selector])
|
||||
);
|
||||
React.useDebugValue(slice);
|
||||
return slice;
|
||||
}
|
||||
const createImpl = (createState) => {
|
||||
const api = createStore(createState);
|
||||
const useBoundStore = (selector) => useStore(api, selector);
|
||||
Object.assign(useBoundStore, api);
|
||||
return useBoundStore;
|
||||
};
|
||||
const create = ((createState) => createState ? createImpl(createState) : createImpl);
|
||||
|
||||
export { create, useStore };
|
||||
1
frontend/.ignored_node_modules/zustand/esm/react/shallow.d.mts
generated
Normal file
1
frontend/.ignored_node_modules/zustand/esm/react/shallow.d.mts
generated
Normal file
@@ -0,0 +1 @@
|
||||
export declare function useShallow<S, U>(selector: (state: S) => U): (state: S) => U;
|
||||
12
frontend/.ignored_node_modules/zustand/esm/react/shallow.mjs
generated
Normal file
12
frontend/.ignored_node_modules/zustand/esm/react/shallow.mjs
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'zustand/vanilla/shallow';
|
||||
|
||||
function useShallow(selector) {
|
||||
const prev = React.useRef(void 0);
|
||||
return (state) => {
|
||||
const next = selector(state);
|
||||
return shallow(prev.current, next) ? prev.current : prev.current = next;
|
||||
};
|
||||
}
|
||||
|
||||
export { useShallow };
|
||||
2
frontend/.ignored_node_modules/zustand/esm/shallow.d.mts
generated
Normal file
2
frontend/.ignored_node_modules/zustand/esm/shallow.d.mts
generated
Normal file
@@ -0,0 +1,2 @@
|
||||
export { shallow } from 'zustand/vanilla/shallow';
|
||||
export { useShallow } from 'zustand/react/shallow';
|
||||
2
frontend/.ignored_node_modules/zustand/esm/shallow.mjs
generated
Normal file
2
frontend/.ignored_node_modules/zustand/esm/shallow.mjs
generated
Normal file
@@ -0,0 +1,2 @@
|
||||
export { shallow } from 'zustand/vanilla/shallow';
|
||||
export { useShallow } from 'zustand/react/shallow';
|
||||
14
frontend/.ignored_node_modules/zustand/esm/traditional.d.mts
generated
Normal file
14
frontend/.ignored_node_modules/zustand/esm/traditional.d.mts
generated
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { ExtractState, Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from 'zustand/vanilla';
|
||||
type ReadonlyStoreApi<T> = Pick<StoreApi<T>, 'getState' | 'getInitialState' | 'subscribe'>;
|
||||
export declare function useStoreWithEqualityFn<S extends ReadonlyStoreApi<unknown>>(api: S): ExtractState<S>;
|
||||
export declare function useStoreWithEqualityFn<S extends ReadonlyStoreApi<unknown>, U>(api: S, selector: (state: ExtractState<S>) => U, equalityFn?: (a: U, b: U) => boolean): U;
|
||||
export type UseBoundStoreWithEqualityFn<S extends ReadonlyStoreApi<unknown>> = {
|
||||
(): ExtractState<S>;
|
||||
<U>(selector: (state: ExtractState<S>) => U, equalityFn?: (a: U, b: U) => boolean): U;
|
||||
} & S;
|
||||
type CreateWithEqualityFn = {
|
||||
<T, Mos extends [StoreMutatorIdentifier, unknown][] = []>(initializer: StateCreator<T, [], Mos>, defaultEqualityFn?: <U>(a: U, b: U) => boolean): UseBoundStoreWithEqualityFn<Mutate<StoreApi<T>, Mos>>;
|
||||
<T>(): <Mos extends [StoreMutatorIdentifier, unknown][] = []>(initializer: StateCreator<T, [], Mos>, defaultEqualityFn?: <U>(a: U, b: U) => boolean) => UseBoundStoreWithEqualityFn<Mutate<StoreApi<T>, Mos>>;
|
||||
};
|
||||
export declare const createWithEqualityFn: CreateWithEqualityFn;
|
||||
export {};
|
||||
26
frontend/.ignored_node_modules/zustand/esm/traditional.mjs
generated
Normal file
26
frontend/.ignored_node_modules/zustand/esm/traditional.mjs
generated
Normal file
@@ -0,0 +1,26 @@
|
||||
import React from 'react';
|
||||
import useSyncExternalStoreExports from 'use-sync-external-store/shim/with-selector.js';
|
||||
import { createStore } from 'zustand/vanilla';
|
||||
|
||||
const { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports;
|
||||
const identity = (arg) => arg;
|
||||
function useStoreWithEqualityFn(api, selector = identity, equalityFn) {
|
||||
const slice = useSyncExternalStoreWithSelector(
|
||||
api.subscribe,
|
||||
api.getState,
|
||||
api.getInitialState,
|
||||
selector,
|
||||
equalityFn
|
||||
);
|
||||
React.useDebugValue(slice);
|
||||
return slice;
|
||||
}
|
||||
const createWithEqualityFnImpl = (createState, defaultEqualityFn) => {
|
||||
const api = createStore(createState);
|
||||
const useBoundStoreWithEqualityFn = (selector, equalityFn = defaultEqualityFn) => useStoreWithEqualityFn(api, selector, equalityFn);
|
||||
Object.assign(useBoundStoreWithEqualityFn, api);
|
||||
return useBoundStoreWithEqualityFn;
|
||||
};
|
||||
const createWithEqualityFn = ((createState, defaultEqualityFn) => createState ? createWithEqualityFnImpl(createState, defaultEqualityFn) : createWithEqualityFnImpl);
|
||||
|
||||
export { createWithEqualityFn, useStoreWithEqualityFn };
|
||||
31
frontend/.ignored_node_modules/zustand/esm/vanilla.d.mts
generated
Normal file
31
frontend/.ignored_node_modules/zustand/esm/vanilla.d.mts
generated
Normal file
@@ -0,0 +1,31 @@
|
||||
type SetStateInternal<T> = {
|
||||
_(partial: T | Partial<T> | {
|
||||
_(state: T): T | Partial<T>;
|
||||
}['_'], replace?: false): void;
|
||||
_(state: T | {
|
||||
_(state: T): T;
|
||||
}['_'], replace: true): void;
|
||||
}['_'];
|
||||
export interface StoreApi<T> {
|
||||
setState: SetStateInternal<T>;
|
||||
getState: () => T;
|
||||
getInitialState: () => T;
|
||||
subscribe: (listener: (state: T, prevState: T) => void) => () => void;
|
||||
}
|
||||
export type ExtractState<S> = S extends {
|
||||
getState: () => infer T;
|
||||
} ? T : never;
|
||||
type Get<T, K, F> = K extends keyof T ? T[K] : F;
|
||||
export type Mutate<S, Ms> = number extends Ms['length' & keyof Ms] ? S : Ms extends [] ? S : Ms extends [[infer Mi, infer Ma], ...infer Mrs] ? Mutate<StoreMutators<S, Ma>[Mi & StoreMutatorIdentifier], Mrs> : never;
|
||||
export type StateCreator<T, Mis extends [StoreMutatorIdentifier, unknown][] = [], Mos extends [StoreMutatorIdentifier, unknown][] = [], U = T> = ((setState: Get<Mutate<StoreApi<T>, Mis>, 'setState', never>, getState: Get<Mutate<StoreApi<T>, Mis>, 'getState', never>, store: Mutate<StoreApi<T>, Mis>) => U) & {
|
||||
$$storeMutators?: Mos;
|
||||
};
|
||||
export interface StoreMutators<S, A> {
|
||||
}
|
||||
export type StoreMutatorIdentifier = keyof StoreMutators<unknown, unknown>;
|
||||
type CreateStore = {
|
||||
<T, Mos extends [StoreMutatorIdentifier, unknown][] = []>(initializer: StateCreator<T, [], Mos>): Mutate<StoreApi<T>, Mos>;
|
||||
<T>(): <Mos extends [StoreMutatorIdentifier, unknown][] = []>(initializer: StateCreator<T, [], Mos>) => Mutate<StoreApi<T>, Mos>;
|
||||
};
|
||||
export declare const createStore: CreateStore;
|
||||
export {};
|
||||
24
frontend/.ignored_node_modules/zustand/esm/vanilla.mjs
generated
Normal file
24
frontend/.ignored_node_modules/zustand/esm/vanilla.mjs
generated
Normal file
@@ -0,0 +1,24 @@
|
||||
const createStoreImpl = (createState) => {
|
||||
let state;
|
||||
const listeners = /* @__PURE__ */ new Set();
|
||||
const setState = (partial, replace) => {
|
||||
const nextState = typeof partial === "function" ? partial(state) : partial;
|
||||
if (!Object.is(nextState, state)) {
|
||||
const previousState = state;
|
||||
state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
|
||||
listeners.forEach((listener) => listener(state, previousState));
|
||||
}
|
||||
};
|
||||
const getState = () => state;
|
||||
const getInitialState = () => initialState;
|
||||
const subscribe = (listener) => {
|
||||
listeners.add(listener);
|
||||
return () => listeners.delete(listener);
|
||||
};
|
||||
const api = { setState, getState, getInitialState, subscribe };
|
||||
const initialState = state = createState(setState, getState, api);
|
||||
return api;
|
||||
};
|
||||
const createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
|
||||
|
||||
export { createStore };
|
||||
1
frontend/.ignored_node_modules/zustand/esm/vanilla/shallow.d.mts
generated
Normal file
1
frontend/.ignored_node_modules/zustand/esm/vanilla/shallow.d.mts
generated
Normal file
@@ -0,0 +1 @@
|
||||
export declare function shallow<T>(valueA: T, valueB: T): boolean;
|
||||
55
frontend/.ignored_node_modules/zustand/esm/vanilla/shallow.mjs
generated
Normal file
55
frontend/.ignored_node_modules/zustand/esm/vanilla/shallow.mjs
generated
Normal file
@@ -0,0 +1,55 @@
|
||||
const isIterable = (obj) => Symbol.iterator in obj;
|
||||
const hasIterableEntries = (value) => (
|
||||
// HACK: avoid checking entries type
|
||||
"entries" in value
|
||||
);
|
||||
const compareEntries = (valueA, valueB) => {
|
||||
const mapA = valueA instanceof Map ? valueA : new Map(valueA.entries());
|
||||
const mapB = valueB instanceof Map ? valueB : new Map(valueB.entries());
|
||||
if (mapA.size !== mapB.size) {
|
||||
return false;
|
||||
}
|
||||
for (const [key, value] of mapA) {
|
||||
if (!mapB.has(key) || !Object.is(value, mapB.get(key))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const compareIterables = (valueA, valueB) => {
|
||||
const iteratorA = valueA[Symbol.iterator]();
|
||||
const iteratorB = valueB[Symbol.iterator]();
|
||||
let nextA = iteratorA.next();
|
||||
let nextB = iteratorB.next();
|
||||
while (!nextA.done && !nextB.done) {
|
||||
if (!Object.is(nextA.value, nextB.value)) {
|
||||
return false;
|
||||
}
|
||||
nextA = iteratorA.next();
|
||||
nextB = iteratorB.next();
|
||||
}
|
||||
return !!nextA.done && !!nextB.done;
|
||||
};
|
||||
function shallow(valueA, valueB) {
|
||||
if (Object.is(valueA, valueB)) {
|
||||
return true;
|
||||
}
|
||||
if (typeof valueA !== "object" || valueA === null || typeof valueB !== "object" || valueB === null) {
|
||||
return false;
|
||||
}
|
||||
if (Object.getPrototypeOf(valueA) !== Object.getPrototypeOf(valueB)) {
|
||||
return false;
|
||||
}
|
||||
if (isIterable(valueA) && isIterable(valueB)) {
|
||||
if (hasIterableEntries(valueA) && hasIterableEntries(valueB)) {
|
||||
return compareEntries(valueA, valueB);
|
||||
}
|
||||
return compareIterables(valueA, valueB);
|
||||
}
|
||||
return compareEntries(
|
||||
{ entries: () => Object.entries(valueA) },
|
||||
{ entries: () => Object.entries(valueB) }
|
||||
);
|
||||
}
|
||||
|
||||
export { shallow };
|
||||
Reference in New Issue
Block a user