v1.0 with SW PWA enabled
This commit is contained in:
4
frontend/node_modules/smob/dist/constants.d.ts
generated
vendored
Normal file
4
frontend/node_modules/smob/dist/constants.d.ts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
export declare enum PriorityName {
|
||||
LEFT = "left",
|
||||
RIGHT = "right"
|
||||
}
|
||||
283
frontend/node_modules/smob/dist/index.cjs
generated
vendored
Normal file
283
frontend/node_modules/smob/dist/index.cjs
generated
vendored
Normal file
@ -0,0 +1,283 @@
|
||||
'use strict';
|
||||
|
||||
exports.PriorityName = void 0;
|
||||
(function(PriorityName) {
|
||||
PriorityName["LEFT"] = "left";
|
||||
PriorityName["RIGHT"] = "right";
|
||||
})(exports.PriorityName || (exports.PriorityName = {}));
|
||||
|
||||
function isObject(item) {
|
||||
return !!item && typeof item === 'object' && !Array.isArray(item);
|
||||
}
|
||||
function isSafeKey(key) {
|
||||
return key !== '__proto__' && key !== 'prototype' && key !== 'constructor';
|
||||
}
|
||||
function isEqual(x, y) {
|
||||
if (Object.is(x, y)) return true;
|
||||
if (x instanceof Date && y instanceof Date) {
|
||||
return x.getTime() === y.getTime();
|
||||
}
|
||||
if (x instanceof RegExp && y instanceof RegExp) {
|
||||
return x.toString() === y.toString();
|
||||
}
|
||||
if (isObject(x) && isObject(y)) {
|
||||
const keysX = Reflect.ownKeys(x);
|
||||
const keysY = Reflect.ownKeys(y);
|
||||
if (keysX.length !== keysY.length) {
|
||||
return false;
|
||||
}
|
||||
for(let i = 0; i < keysX.length; i++){
|
||||
const key = keysX[i];
|
||||
if (!Reflect.has(y, key) || !isEqual(x[key], y[key])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (Array.isArray(x) && Array.isArray(y)) {
|
||||
if (x.length !== y.length) {
|
||||
return false;
|
||||
}
|
||||
for(let i = 0; i < x.length; i++){
|
||||
if (!isEqual(x[i], y[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function distinctArray(arr) {
|
||||
for(let i = 0; i < arr.length; i++){
|
||||
for(let j = arr.length - 1; j > i; j--){
|
||||
if (isEqual(arr[i], arr[j])) {
|
||||
arr.splice(j, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/* istanbul ignore next */ const gT = (()=>{
|
||||
if (typeof globalThis !== 'undefined') {
|
||||
return globalThis;
|
||||
}
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
if (typeof self !== 'undefined') {
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
return self;
|
||||
}
|
||||
if (typeof window !== 'undefined') {
|
||||
return window;
|
||||
}
|
||||
if (typeof global !== 'undefined') {
|
||||
return global;
|
||||
}
|
||||
throw new Error('unable to locate global object');
|
||||
})();
|
||||
function polyfillClone(input) {
|
||||
const map = new WeakMap();
|
||||
const fn = (value)=>{
|
||||
if (Array.isArray(value)) {
|
||||
if (map.has(value)) {
|
||||
return map.get(value);
|
||||
}
|
||||
const cloned = [];
|
||||
map.set(value, cloned);
|
||||
value.map((el)=>cloned.push(fn(el)));
|
||||
return cloned;
|
||||
}
|
||||
if (isObject(value)) {
|
||||
if (map.has(value)) {
|
||||
return map.get(value);
|
||||
}
|
||||
const output = {};
|
||||
const keys = Object.keys(value);
|
||||
map.set(value, output);
|
||||
for(let i = 0; i < keys.length; i++){
|
||||
output[keys[i]] = fn(value[keys[i]]);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
return fn(input);
|
||||
}
|
||||
/* istanbul ignore next */ function clone(value) {
|
||||
if (gT.structuredClone) {
|
||||
return gT.structuredClone(value);
|
||||
}
|
||||
/* istanbul ignore next */ return polyfillClone(value);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
function hasOwnProperty(obj, prop) {
|
||||
return Object.prototype.hasOwnProperty.call(obj, prop);
|
||||
}
|
||||
|
||||
function buildOptions(options = {}) {
|
||||
var _options_array;
|
||||
options.array = (_options_array = options.array) != null ? _options_array : true;
|
||||
var _options_arrayDistinct;
|
||||
options.arrayDistinct = (_options_arrayDistinct = options.arrayDistinct) != null ? _options_arrayDistinct : false;
|
||||
var _options_clone;
|
||||
options.clone = (_options_clone = options.clone) != null ? _options_clone : false;
|
||||
var _options_inPlace;
|
||||
options.inPlace = (_options_inPlace = options.inPlace) != null ? _options_inPlace : false;
|
||||
options.priority = options.priority || exports.PriorityName.LEFT;
|
||||
options.arrayPriority = options.arrayPriority || options.priority;
|
||||
return options;
|
||||
}
|
||||
function togglePriority(priority) {
|
||||
return priority === exports.PriorityName.LEFT ? `${exports.PriorityName.RIGHT}` : `${exports.PriorityName.LEFT}`;
|
||||
}
|
||||
|
||||
function baseMerger(context, ...sources) {
|
||||
let target;
|
||||
let source;
|
||||
let { priority } = context.options;
|
||||
if (sources.length >= 2) {
|
||||
if (Array.isArray(sources.at(0)) && Array.isArray(sources.at(-1))) {
|
||||
priority = context.options.arrayPriority;
|
||||
}
|
||||
}
|
||||
if (priority === exports.PriorityName.RIGHT) {
|
||||
target = sources.pop();
|
||||
source = sources.pop();
|
||||
} else {
|
||||
target = sources.shift();
|
||||
source = sources.shift();
|
||||
}
|
||||
if (!source) {
|
||||
if (Array.isArray(target) && context.options.arrayDistinct) {
|
||||
return distinctArray(target);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
if (Array.isArray(target) && Array.isArray(source)) {
|
||||
target.push(...source);
|
||||
if (context.options.arrayPriority === exports.PriorityName.RIGHT) {
|
||||
return baseMerger(context, ...sources, target);
|
||||
}
|
||||
return baseMerger(context, target, ...sources);
|
||||
}
|
||||
context.map.set(source, true);
|
||||
if (isObject(target) && isObject(source)) {
|
||||
const keys = Object.keys(source);
|
||||
for(let i = 0; i < keys.length; i++){
|
||||
const key = keys[i];
|
||||
if (hasOwnProperty(target, key)) {
|
||||
if (!isSafeKey(key)) {
|
||||
continue;
|
||||
}
|
||||
if (context.options.strategy) {
|
||||
const applied = context.options.strategy(target, key, source[key]);
|
||||
if (typeof applied !== 'undefined') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (isObject(target[key]) && isObject(source[key])) {
|
||||
if (context.map.has(source[key])) {
|
||||
const sourceKeys = Object.keys(source[key]);
|
||||
for(let j = 0; j < sourceKeys.length; j++){
|
||||
if (isSafeKey(sourceKeys[j]) && !hasOwnProperty(target[key], sourceKeys[j])) {
|
||||
target[key][sourceKeys[j]] = source[key][sourceKeys[j]];
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (context.options.priority === exports.PriorityName.RIGHT) {
|
||||
target[key] = baseMerger(context, source[key], target[key]);
|
||||
} else {
|
||||
target[key] = baseMerger(context, target[key], source[key]);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (context.options.array && Array.isArray(target[key]) && Array.isArray(source[key])) {
|
||||
const arrayPriority = context.options.priority !== context.options.arrayPriority ? togglePriority(context.options.arrayPriority) : context.options.arrayPriority;
|
||||
switch(arrayPriority){
|
||||
case exports.PriorityName.LEFT:
|
||||
Object.assign(target, {
|
||||
[key]: baseMerger(context, target[key], source[key])
|
||||
});
|
||||
break;
|
||||
case exports.PriorityName.RIGHT:
|
||||
Object.assign(target, {
|
||||
[key]: baseMerger(context, source[key], target[key])
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Object.assign(target, {
|
||||
[key]: source[key]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
context.map = new WeakMap();
|
||||
if (context.options.priority === exports.PriorityName.RIGHT) {
|
||||
return baseMerger(context, ...sources, target);
|
||||
}
|
||||
return baseMerger(context, target, ...sources);
|
||||
}
|
||||
function createMerger(input) {
|
||||
const options = buildOptions(input);
|
||||
return (...sources)=>{
|
||||
if (!sources.length) {
|
||||
throw new SyntaxError('At least one input element is required.');
|
||||
}
|
||||
const ctx = {
|
||||
options,
|
||||
map: new WeakMap()
|
||||
};
|
||||
if (options.clone) {
|
||||
return baseMerger(ctx, ...clone(sources));
|
||||
}
|
||||
if (!options.inPlace) {
|
||||
if (Array.isArray(sources.at(0)) && options.arrayPriority === exports.PriorityName.LEFT) {
|
||||
sources.unshift([]);
|
||||
return baseMerger(ctx, ...sources);
|
||||
}
|
||||
if (Array.isArray(sources.at(-1)) && options.arrayPriority === exports.PriorityName.RIGHT) {
|
||||
sources.push([]);
|
||||
return baseMerger(ctx, ...sources);
|
||||
}
|
||||
if (options.priority === exports.PriorityName.LEFT) {
|
||||
sources.unshift({});
|
||||
} else {
|
||||
sources.push({});
|
||||
}
|
||||
}
|
||||
return baseMerger(ctx, ...sources);
|
||||
};
|
||||
}
|
||||
const merge = createMerger();
|
||||
|
||||
/**
|
||||
* Assign source attributes to a target object.
|
||||
*
|
||||
* @param target
|
||||
* @param sources
|
||||
*/ function assign(target, ...sources) {
|
||||
return createMerger({
|
||||
inPlace: true,
|
||||
priority: 'left',
|
||||
array: false
|
||||
})(target, ...sources);
|
||||
}
|
||||
|
||||
exports.assign = assign;
|
||||
exports.buildOptions = buildOptions;
|
||||
exports.clone = clone;
|
||||
exports.createMerger = createMerger;
|
||||
exports.distinctArray = distinctArray;
|
||||
exports.hasOwnProperty = hasOwnProperty;
|
||||
exports.isEqual = isEqual;
|
||||
exports.isObject = isObject;
|
||||
exports.isSafeKey = isSafeKey;
|
||||
exports.merge = merge;
|
||||
exports.polyfillClone = polyfillClone;
|
||||
exports.togglePriority = togglePriority;
|
||||
//# sourceMappingURL=index.cjs.map
|
||||
1
frontend/node_modules/smob/dist/index.cjs.map
generated
vendored
Normal file
1
frontend/node_modules/smob/dist/index.cjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
frontend/node_modules/smob/dist/index.d.ts
generated
vendored
Normal file
5
frontend/node_modules/smob/dist/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
export * from './constants';
|
||||
export * from './module';
|
||||
export * from './utils';
|
||||
export * from './presets';
|
||||
export * from './type';
|
||||
270
frontend/node_modules/smob/dist/index.mjs
generated
vendored
Normal file
270
frontend/node_modules/smob/dist/index.mjs
generated
vendored
Normal file
@ -0,0 +1,270 @@
|
||||
var PriorityName;
|
||||
(function(PriorityName) {
|
||||
PriorityName["LEFT"] = "left";
|
||||
PriorityName["RIGHT"] = "right";
|
||||
})(PriorityName || (PriorityName = {}));
|
||||
|
||||
function isObject(item) {
|
||||
return !!item && typeof item === 'object' && !Array.isArray(item);
|
||||
}
|
||||
function isSafeKey(key) {
|
||||
return key !== '__proto__' && key !== 'prototype' && key !== 'constructor';
|
||||
}
|
||||
function isEqual(x, y) {
|
||||
if (Object.is(x, y)) return true;
|
||||
if (x instanceof Date && y instanceof Date) {
|
||||
return x.getTime() === y.getTime();
|
||||
}
|
||||
if (x instanceof RegExp && y instanceof RegExp) {
|
||||
return x.toString() === y.toString();
|
||||
}
|
||||
if (isObject(x) && isObject(y)) {
|
||||
const keysX = Reflect.ownKeys(x);
|
||||
const keysY = Reflect.ownKeys(y);
|
||||
if (keysX.length !== keysY.length) {
|
||||
return false;
|
||||
}
|
||||
for(let i = 0; i < keysX.length; i++){
|
||||
const key = keysX[i];
|
||||
if (!Reflect.has(y, key) || !isEqual(x[key], y[key])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (Array.isArray(x) && Array.isArray(y)) {
|
||||
if (x.length !== y.length) {
|
||||
return false;
|
||||
}
|
||||
for(let i = 0; i < x.length; i++){
|
||||
if (!isEqual(x[i], y[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function distinctArray(arr) {
|
||||
for(let i = 0; i < arr.length; i++){
|
||||
for(let j = arr.length - 1; j > i; j--){
|
||||
if (isEqual(arr[i], arr[j])) {
|
||||
arr.splice(j, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/* istanbul ignore next */ const gT = (()=>{
|
||||
if (typeof globalThis !== 'undefined') {
|
||||
return globalThis;
|
||||
}
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
if (typeof self !== 'undefined') {
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
return self;
|
||||
}
|
||||
if (typeof window !== 'undefined') {
|
||||
return window;
|
||||
}
|
||||
if (typeof global !== 'undefined') {
|
||||
return global;
|
||||
}
|
||||
throw new Error('unable to locate global object');
|
||||
})();
|
||||
function polyfillClone(input) {
|
||||
const map = new WeakMap();
|
||||
const fn = (value)=>{
|
||||
if (Array.isArray(value)) {
|
||||
if (map.has(value)) {
|
||||
return map.get(value);
|
||||
}
|
||||
const cloned = [];
|
||||
map.set(value, cloned);
|
||||
value.map((el)=>cloned.push(fn(el)));
|
||||
return cloned;
|
||||
}
|
||||
if (isObject(value)) {
|
||||
if (map.has(value)) {
|
||||
return map.get(value);
|
||||
}
|
||||
const output = {};
|
||||
const keys = Object.keys(value);
|
||||
map.set(value, output);
|
||||
for(let i = 0; i < keys.length; i++){
|
||||
output[keys[i]] = fn(value[keys[i]]);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
return fn(input);
|
||||
}
|
||||
/* istanbul ignore next */ function clone(value) {
|
||||
if (gT.structuredClone) {
|
||||
return gT.structuredClone(value);
|
||||
}
|
||||
/* istanbul ignore next */ return polyfillClone(value);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
function hasOwnProperty(obj, prop) {
|
||||
return Object.prototype.hasOwnProperty.call(obj, prop);
|
||||
}
|
||||
|
||||
function buildOptions(options = {}) {
|
||||
var _options_array;
|
||||
options.array = (_options_array = options.array) != null ? _options_array : true;
|
||||
var _options_arrayDistinct;
|
||||
options.arrayDistinct = (_options_arrayDistinct = options.arrayDistinct) != null ? _options_arrayDistinct : false;
|
||||
var _options_clone;
|
||||
options.clone = (_options_clone = options.clone) != null ? _options_clone : false;
|
||||
var _options_inPlace;
|
||||
options.inPlace = (_options_inPlace = options.inPlace) != null ? _options_inPlace : false;
|
||||
options.priority = options.priority || PriorityName.LEFT;
|
||||
options.arrayPriority = options.arrayPriority || options.priority;
|
||||
return options;
|
||||
}
|
||||
function togglePriority(priority) {
|
||||
return priority === PriorityName.LEFT ? `${PriorityName.RIGHT}` : `${PriorityName.LEFT}`;
|
||||
}
|
||||
|
||||
function baseMerger(context, ...sources) {
|
||||
let target;
|
||||
let source;
|
||||
let { priority } = context.options;
|
||||
if (sources.length >= 2) {
|
||||
if (Array.isArray(sources.at(0)) && Array.isArray(sources.at(-1))) {
|
||||
priority = context.options.arrayPriority;
|
||||
}
|
||||
}
|
||||
if (priority === PriorityName.RIGHT) {
|
||||
target = sources.pop();
|
||||
source = sources.pop();
|
||||
} else {
|
||||
target = sources.shift();
|
||||
source = sources.shift();
|
||||
}
|
||||
if (!source) {
|
||||
if (Array.isArray(target) && context.options.arrayDistinct) {
|
||||
return distinctArray(target);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
if (Array.isArray(target) && Array.isArray(source)) {
|
||||
target.push(...source);
|
||||
if (context.options.arrayPriority === PriorityName.RIGHT) {
|
||||
return baseMerger(context, ...sources, target);
|
||||
}
|
||||
return baseMerger(context, target, ...sources);
|
||||
}
|
||||
context.map.set(source, true);
|
||||
if (isObject(target) && isObject(source)) {
|
||||
const keys = Object.keys(source);
|
||||
for(let i = 0; i < keys.length; i++){
|
||||
const key = keys[i];
|
||||
if (hasOwnProperty(target, key)) {
|
||||
if (!isSafeKey(key)) {
|
||||
continue;
|
||||
}
|
||||
if (context.options.strategy) {
|
||||
const applied = context.options.strategy(target, key, source[key]);
|
||||
if (typeof applied !== 'undefined') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (isObject(target[key]) && isObject(source[key])) {
|
||||
if (context.map.has(source[key])) {
|
||||
const sourceKeys = Object.keys(source[key]);
|
||||
for(let j = 0; j < sourceKeys.length; j++){
|
||||
if (isSafeKey(sourceKeys[j]) && !hasOwnProperty(target[key], sourceKeys[j])) {
|
||||
target[key][sourceKeys[j]] = source[key][sourceKeys[j]];
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (context.options.priority === PriorityName.RIGHT) {
|
||||
target[key] = baseMerger(context, source[key], target[key]);
|
||||
} else {
|
||||
target[key] = baseMerger(context, target[key], source[key]);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (context.options.array && Array.isArray(target[key]) && Array.isArray(source[key])) {
|
||||
const arrayPriority = context.options.priority !== context.options.arrayPriority ? togglePriority(context.options.arrayPriority) : context.options.arrayPriority;
|
||||
switch(arrayPriority){
|
||||
case PriorityName.LEFT:
|
||||
Object.assign(target, {
|
||||
[key]: baseMerger(context, target[key], source[key])
|
||||
});
|
||||
break;
|
||||
case PriorityName.RIGHT:
|
||||
Object.assign(target, {
|
||||
[key]: baseMerger(context, source[key], target[key])
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Object.assign(target, {
|
||||
[key]: source[key]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
context.map = new WeakMap();
|
||||
if (context.options.priority === PriorityName.RIGHT) {
|
||||
return baseMerger(context, ...sources, target);
|
||||
}
|
||||
return baseMerger(context, target, ...sources);
|
||||
}
|
||||
function createMerger(input) {
|
||||
const options = buildOptions(input);
|
||||
return (...sources)=>{
|
||||
if (!sources.length) {
|
||||
throw new SyntaxError('At least one input element is required.');
|
||||
}
|
||||
const ctx = {
|
||||
options,
|
||||
map: new WeakMap()
|
||||
};
|
||||
if (options.clone) {
|
||||
return baseMerger(ctx, ...clone(sources));
|
||||
}
|
||||
if (!options.inPlace) {
|
||||
if (Array.isArray(sources.at(0)) && options.arrayPriority === PriorityName.LEFT) {
|
||||
sources.unshift([]);
|
||||
return baseMerger(ctx, ...sources);
|
||||
}
|
||||
if (Array.isArray(sources.at(-1)) && options.arrayPriority === PriorityName.RIGHT) {
|
||||
sources.push([]);
|
||||
return baseMerger(ctx, ...sources);
|
||||
}
|
||||
if (options.priority === PriorityName.LEFT) {
|
||||
sources.unshift({});
|
||||
} else {
|
||||
sources.push({});
|
||||
}
|
||||
}
|
||||
return baseMerger(ctx, ...sources);
|
||||
};
|
||||
}
|
||||
const merge = createMerger();
|
||||
|
||||
/**
|
||||
* Assign source attributes to a target object.
|
||||
*
|
||||
* @param target
|
||||
* @param sources
|
||||
*/ function assign(target, ...sources) {
|
||||
return createMerger({
|
||||
inPlace: true,
|
||||
priority: 'left',
|
||||
array: false
|
||||
})(target, ...sources);
|
||||
}
|
||||
|
||||
export { PriorityName, assign, buildOptions, clone, createMerger, distinctArray, hasOwnProperty, isEqual, isObject, isSafeKey, merge, polyfillClone, togglePriority };
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
frontend/node_modules/smob/dist/index.mjs.map
generated
vendored
Normal file
1
frontend/node_modules/smob/dist/index.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
frontend/node_modules/smob/dist/module.d.ts
generated
vendored
Normal file
3
frontend/node_modules/smob/dist/module.d.ts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import type { Merger, OptionsInput } from './type';
|
||||
export declare function createMerger(input?: OptionsInput): Merger;
|
||||
export declare const merge: Merger;
|
||||
8
frontend/node_modules/smob/dist/presets.d.ts
generated
vendored
Normal file
8
frontend/node_modules/smob/dist/presets.d.ts
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
import type { MergerResult } from './type';
|
||||
/**
|
||||
* Assign source attributes to a target object.
|
||||
*
|
||||
* @param target
|
||||
* @param sources
|
||||
*/
|
||||
export declare function assign<A extends Record<string, any>, B extends Record<string, any>[]>(target: A, ...sources: B): A & MergerResult<B>;
|
||||
60
frontend/node_modules/smob/dist/type.d.ts
generated
vendored
Normal file
60
frontend/node_modules/smob/dist/type.d.ts
generated
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
import type { PriorityName } from './constants';
|
||||
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
||||
export type Options = {
|
||||
/**
|
||||
* Merge object array properties.
|
||||
*
|
||||
* default: true
|
||||
*/
|
||||
array: boolean;
|
||||
/**
|
||||
* Remove duplicates, when merging array elements.
|
||||
*
|
||||
* default: false
|
||||
*/
|
||||
arrayDistinct: boolean;
|
||||
/**
|
||||
* Merge sources from left-to-right or right-to-left.
|
||||
* From v2 upwards default to left independent of the option priority.
|
||||
*
|
||||
* default: left (aka. options.priority)
|
||||
*/
|
||||
arrayPriority: `${PriorityName}`;
|
||||
/**
|
||||
* Strategy to merge different object keys.
|
||||
*
|
||||
* @param target
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
strategy?: (target: Record<string, any>, key: string, value: unknown) => Record<string, any> | undefined;
|
||||
/**
|
||||
* Merge sources in place.
|
||||
*
|
||||
* default: false
|
||||
*/
|
||||
inPlace?: boolean;
|
||||
/**
|
||||
* Deep clone input sources.
|
||||
*
|
||||
* default: false
|
||||
*/
|
||||
clone?: boolean;
|
||||
/**
|
||||
* Merge sources from left-to-right or right-to-left.
|
||||
* From v2 upwards default to right.
|
||||
*
|
||||
* default: left
|
||||
*/
|
||||
priority: `${PriorityName}`;
|
||||
};
|
||||
export type OptionsInput = Partial<Options>;
|
||||
export type MergerSource = any[] | Record<string, any>;
|
||||
export type MergerSourceUnwrap<T extends MergerSource> = T extends Array<infer Return> ? Return : T;
|
||||
export type MergerResult<B extends MergerSource> = UnionToIntersection<MergerSourceUnwrap<B>>;
|
||||
export type MergerContext = {
|
||||
options: Options;
|
||||
map: WeakMap<any, any>;
|
||||
};
|
||||
export type Merger = <B extends MergerSource[]>(...sources: B) => MergerResult<B>;
|
||||
export {};
|
||||
1
frontend/node_modules/smob/dist/utils/array.d.ts
generated
vendored
Normal file
1
frontend/node_modules/smob/dist/utils/array.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function distinctArray<T = any>(arr: T[]): T[];
|
||||
3
frontend/node_modules/smob/dist/utils/check.d.ts
generated
vendored
Normal file
3
frontend/node_modules/smob/dist/utils/check.d.ts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
export declare function isObject(item: unknown): item is Record<string, any>;
|
||||
export declare function isSafeKey(key: string): boolean;
|
||||
export declare function isEqual(x: any, y: any): boolean;
|
||||
2
frontend/node_modules/smob/dist/utils/clone.d.ts
generated
vendored
Normal file
2
frontend/node_modules/smob/dist/utils/clone.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export declare function polyfillClone<T>(input: T): T;
|
||||
export declare function clone<T>(value: T): T;
|
||||
5
frontend/node_modules/smob/dist/utils/index.d.ts
generated
vendored
Normal file
5
frontend/node_modules/smob/dist/utils/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
export * from './array';
|
||||
export * from './check';
|
||||
export * from './clone';
|
||||
export * from './object';
|
||||
export * from './options';
|
||||
1
frontend/node_modules/smob/dist/utils/object.d.ts
generated
vendored
Normal file
1
frontend/node_modules/smob/dist/utils/object.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function hasOwnProperty<X extends {}, Y extends PropertyKey>(obj: X, prop: Y): obj is X & Record<Y, unknown>;
|
||||
4
frontend/node_modules/smob/dist/utils/options.d.ts
generated
vendored
Normal file
4
frontend/node_modules/smob/dist/utils/options.d.ts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { PriorityName } from '../constants';
|
||||
import type { Options, OptionsInput } from '../type';
|
||||
export declare function buildOptions(options?: OptionsInput): Options;
|
||||
export declare function togglePriority(priority: `${PriorityName}`): "left" | "right";
|
||||
Reference in New Issue
Block a user