diff --git a/tools/ui/node_modules/es-toolkit/compat.d.ts b/tools/ui/node_modules/es-toolkit/compat.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..da697abed72620dfbfb78c6b3ea1a8af3d808179 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat.d.ts @@ -0,0 +1 @@ +export * from './dist/compat'; diff --git a/tools/ui/node_modules/es-toolkit/compat.js b/tools/ui/node_modules/es-toolkit/compat.js new file mode 100644 index 0000000000000000000000000000000000000000..347ee5dfc35331597d518e802ba9de08f4a59b15 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat.js @@ -0,0 +1 @@ +module.exports = require('./dist/compat'); diff --git a/tools/ui/node_modules/es-toolkit/compat/hasIn.d.ts b/tools/ui/node_modules/es-toolkit/compat/hasIn.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..53746f5a713eb3eb19f4db88634fa87f7276bc93 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/hasIn.d.ts @@ -0,0 +1 @@ +export { hasIn as default } from '../dist/compat/object/hasIn.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/hasIn.js b/tools/ui/node_modules/es-toolkit/compat/hasIn.js new file mode 100644 index 0000000000000000000000000000000000000000..6f363177cb188bcdf2937a2650f602a1bc774ad0 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/hasIn.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/hasIn.js').hasIn; diff --git a/tools/ui/node_modules/es-toolkit/compat/head.d.ts b/tools/ui/node_modules/es-toolkit/compat/head.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..139ab2a4d28de537b039d181bcbfdb2d80f1bffb --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/head.d.ts @@ -0,0 +1 @@ +export { head as default } from '../dist/compat/array/head.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/head.js b/tools/ui/node_modules/es-toolkit/compat/head.js new file mode 100644 index 0000000000000000000000000000000000000000..b4aea9bacec139f7f9cd439a836ea343606b6ae1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/head.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/head.js').head; diff --git a/tools/ui/node_modules/es-toolkit/compat/identity.d.ts b/tools/ui/node_modules/es-toolkit/compat/identity.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6f31000293b7ed8fdb0d8bfd934b8054ea45fb5d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/identity.d.ts @@ -0,0 +1 @@ +export { identity as default } from '../dist/function/identity.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/identity.js b/tools/ui/node_modules/es-toolkit/compat/identity.js new file mode 100644 index 0000000000000000000000000000000000000000..ed240aaf0a31c8dcaf45011a65efa26c57d41f98 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/identity.js @@ -0,0 +1 @@ +module.exports = require('../dist/function/identity.js').identity; diff --git a/tools/ui/node_modules/es-toolkit/compat/inRange.d.ts b/tools/ui/node_modules/es-toolkit/compat/inRange.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4f95da99077d19ecd1cb700fabec982e07510eb9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/inRange.d.ts @@ -0,0 +1 @@ +export { inRange as default } from '../dist/compat/math/inRange.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/inRange.js b/tools/ui/node_modules/es-toolkit/compat/inRange.js new file mode 100644 index 0000000000000000000000000000000000000000..46321fce345eb11c3fdc1928b22ffee36f173be9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/inRange.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/math/inRange.js').inRange; diff --git a/tools/ui/node_modules/es-toolkit/compat/includes.d.ts b/tools/ui/node_modules/es-toolkit/compat/includes.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4fadfc733db67265fbcc3111c4945e084afa1c87 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/includes.d.ts @@ -0,0 +1 @@ +export { includes as default } from '../dist/compat/array/includes.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/includes.js b/tools/ui/node_modules/es-toolkit/compat/includes.js new file mode 100644 index 0000000000000000000000000000000000000000..c496ad61464e0c635b399ccf3eebfe7d6056e59c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/includes.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/includes.js').includes; diff --git a/tools/ui/node_modules/es-toolkit/compat/indexOf.d.ts b/tools/ui/node_modules/es-toolkit/compat/indexOf.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..40c782a8a85df9d49ccc53b265bde36edcca6503 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/indexOf.d.ts @@ -0,0 +1 @@ +export { indexOf as default } from '../dist/compat/array/indexOf.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/indexOf.js b/tools/ui/node_modules/es-toolkit/compat/indexOf.js new file mode 100644 index 0000000000000000000000000000000000000000..6770050dd71c2141f6f4e6e59916846add8dd495 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/indexOf.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/indexOf.js').indexOf; diff --git a/tools/ui/node_modules/es-toolkit/compat/initial.d.ts b/tools/ui/node_modules/es-toolkit/compat/initial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ebc3cb7c468d1c4d7c672e7e07c788c2a180d777 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/initial.d.ts @@ -0,0 +1 @@ +export { initial as default } from '../dist/compat/array/initial.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/initial.js b/tools/ui/node_modules/es-toolkit/compat/initial.js new file mode 100644 index 0000000000000000000000000000000000000000..968b285ac7c726fcf4fbf588bb61f97db000a2cf --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/initial.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/initial.js').initial; diff --git a/tools/ui/node_modules/es-toolkit/compat/intersection.d.ts b/tools/ui/node_modules/es-toolkit/compat/intersection.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..01430d759a42a9241a4c064137fc7ac70f38698c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/intersection.d.ts @@ -0,0 +1 @@ +export { intersection as default } from '../dist/compat/array/intersection.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/intersection.js b/tools/ui/node_modules/es-toolkit/compat/intersection.js new file mode 100644 index 0000000000000000000000000000000000000000..43334ebab176322fb946185b71ae434b46ec8d74 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/intersection.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/intersection.js').intersection; diff --git a/tools/ui/node_modules/es-toolkit/compat/intersectionBy.d.ts b/tools/ui/node_modules/es-toolkit/compat/intersectionBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3efa12ede52d0ece29d30df87a2f16028823b562 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/intersectionBy.d.ts @@ -0,0 +1 @@ +export { intersectionBy as default } from '../dist/compat/array/intersectionBy.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/intersectionBy.js b/tools/ui/node_modules/es-toolkit/compat/intersectionBy.js new file mode 100644 index 0000000000000000000000000000000000000000..3e8e6f00d62259138d8a2a29186023a0aaea6e5f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/intersectionBy.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/intersectionBy.js').intersectionBy; diff --git a/tools/ui/node_modules/es-toolkit/compat/intersectionWith.d.ts b/tools/ui/node_modules/es-toolkit/compat/intersectionWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4f25474a0aa4e22c1e08ffc409bc632281df596c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/intersectionWith.d.ts @@ -0,0 +1 @@ +export { intersectionWith as default } from '../dist/compat/array/intersectionWith.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/intersectionWith.js b/tools/ui/node_modules/es-toolkit/compat/intersectionWith.js new file mode 100644 index 0000000000000000000000000000000000000000..db618b998728c94ff5ef2b74181ebf99f53ba72c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/intersectionWith.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/intersectionWith.js').intersectionWith; diff --git a/tools/ui/node_modules/es-toolkit/compat/invert.d.ts b/tools/ui/node_modules/es-toolkit/compat/invert.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ea8cadeffd5376f600897b1053a57953911c20bf --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/invert.d.ts @@ -0,0 +1 @@ +export { invert as default } from '../dist/object/invert.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/invert.js b/tools/ui/node_modules/es-toolkit/compat/invert.js new file mode 100644 index 0000000000000000000000000000000000000000..b6662ffcb99a74616534b5b3af5538c082ac949b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/invert.js @@ -0,0 +1 @@ +module.exports = require('../dist/object/invert.js').invert; diff --git a/tools/ui/node_modules/es-toolkit/compat/invertBy.d.ts b/tools/ui/node_modules/es-toolkit/compat/invertBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..11497565b90d1e6eb32b00313af3e3d846315886 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/invertBy.d.ts @@ -0,0 +1 @@ +export { invertBy as default } from '../dist/compat/object/invertBy.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/invertBy.js b/tools/ui/node_modules/es-toolkit/compat/invertBy.js new file mode 100644 index 0000000000000000000000000000000000000000..d593cd20b961825c000203c8df424010180f796f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/invertBy.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/invertBy.js').invertBy; diff --git a/tools/ui/node_modules/es-toolkit/compat/invoke.d.ts b/tools/ui/node_modules/es-toolkit/compat/invoke.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..68a6ed9232af2c502f39a07c222153720eb087ff --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/invoke.d.ts @@ -0,0 +1 @@ +export { invoke as default } from '../dist/compat/util/invoke.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/invoke.js b/tools/ui/node_modules/es-toolkit/compat/invoke.js new file mode 100644 index 0000000000000000000000000000000000000000..2b823729dbbc8f9a47f026bea34c72a2982480e1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/invoke.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/invoke.js').invoke; diff --git a/tools/ui/node_modules/es-toolkit/compat/invokeMap.d.ts b/tools/ui/node_modules/es-toolkit/compat/invokeMap.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..26241319327a732c61b7bf12e349c846af6ff158 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/invokeMap.d.ts @@ -0,0 +1 @@ +export { invokeMap as default } from '../dist/compat/array/invokeMap.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/invokeMap.js b/tools/ui/node_modules/es-toolkit/compat/invokeMap.js new file mode 100644 index 0000000000000000000000000000000000000000..48736e1c71de622457645d87e11931fc9a0b5c02 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/invokeMap.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/invokeMap.js').invokeMap; diff --git a/tools/ui/node_modules/es-toolkit/compat/isArguments.d.ts b/tools/ui/node_modules/es-toolkit/compat/isArguments.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4bcd2124d340b7379c8ed553840de31a2f88bb3d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isArguments.d.ts @@ -0,0 +1 @@ +export { isArguments as default } from '../dist/compat/predicate/isArguments.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isArguments.js b/tools/ui/node_modules/es-toolkit/compat/isArguments.js new file mode 100644 index 0000000000000000000000000000000000000000..58307bd1ce34b5a84da3c0828e273998c11605c2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isArguments.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isArguments.js').isArguments; diff --git a/tools/ui/node_modules/es-toolkit/compat/isArray.d.ts b/tools/ui/node_modules/es-toolkit/compat/isArray.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a6ac0fbfa294488617c779e3bbabb2a025fb7657 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isArray.d.ts @@ -0,0 +1 @@ +export { isArray as default } from '../dist/compat/predicate/isArray.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isArray.js b/tools/ui/node_modules/es-toolkit/compat/isArray.js new file mode 100644 index 0000000000000000000000000000000000000000..84d1ea88a508f7e1ea4bfdefa80287ad252c2769 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isArray.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isArray.js').isArray; diff --git a/tools/ui/node_modules/es-toolkit/compat/isArrayBuffer.d.ts b/tools/ui/node_modules/es-toolkit/compat/isArrayBuffer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8721922cbb85f11168e1929cde6d22d4a671e3ab --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isArrayBuffer.d.ts @@ -0,0 +1 @@ +export { isArrayBuffer as default } from '../dist/compat/predicate/isArrayBuffer.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isArrayBuffer.js b/tools/ui/node_modules/es-toolkit/compat/isArrayBuffer.js new file mode 100644 index 0000000000000000000000000000000000000000..9ea5bb8a641fc9df40a7386193719b050e80f60d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isArrayBuffer.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isArrayBuffer.js').isArrayBuffer; diff --git a/tools/ui/node_modules/es-toolkit/compat/isArrayLike.d.ts b/tools/ui/node_modules/es-toolkit/compat/isArrayLike.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..91abd02e1f275e199484496a7ac0025f7e8c3e77 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isArrayLike.d.ts @@ -0,0 +1 @@ +export { isArrayLike as default } from '../dist/compat/predicate/isArrayLike.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isArrayLike.js b/tools/ui/node_modules/es-toolkit/compat/isArrayLike.js new file mode 100644 index 0000000000000000000000000000000000000000..e4d7c70b1315d2bc86954bc8a99ff3dd79118afa --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isArrayLike.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isArrayLike.js').isArrayLike; diff --git a/tools/ui/node_modules/es-toolkit/compat/isArrayLikeObject.d.ts b/tools/ui/node_modules/es-toolkit/compat/isArrayLikeObject.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fb8010a610a65897916c295a5164d38fa27171da --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isArrayLikeObject.d.ts @@ -0,0 +1 @@ +export { isArrayLikeObject as default } from '../dist/compat/predicate/isArrayLikeObject.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isArrayLikeObject.js b/tools/ui/node_modules/es-toolkit/compat/isArrayLikeObject.js new file mode 100644 index 0000000000000000000000000000000000000000..8bbee722a25d025123e75c8fe49d39045f737f08 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isArrayLikeObject.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isArrayLikeObject.js').isArrayLikeObject; diff --git a/tools/ui/node_modules/es-toolkit/compat/isBoolean.d.ts b/tools/ui/node_modules/es-toolkit/compat/isBoolean.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..105c35d232930455433e81b3eb28ef5134d4bf6f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isBoolean.d.ts @@ -0,0 +1 @@ +export { isBoolean as default } from '../dist/compat/predicate/isBoolean.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isBoolean.js b/tools/ui/node_modules/es-toolkit/compat/isBoolean.js new file mode 100644 index 0000000000000000000000000000000000000000..ed0ff7729c1c06be7b80cac916dfdc441214538d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isBoolean.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isBoolean.js').isBoolean; diff --git a/tools/ui/node_modules/es-toolkit/compat/isBuffer.d.ts b/tools/ui/node_modules/es-toolkit/compat/isBuffer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..139dab849738b340ef209d24c13e1e7e3587007d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isBuffer.d.ts @@ -0,0 +1 @@ +export { isBuffer as default } from '../dist/compat/predicate/isBuffer.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isBuffer.js b/tools/ui/node_modules/es-toolkit/compat/isBuffer.js new file mode 100644 index 0000000000000000000000000000000000000000..372af797ae9f4006ee294a2c9a0f8f0e6a9589df --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isBuffer.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isBuffer.js').isBuffer; diff --git a/tools/ui/node_modules/es-toolkit/compat/isDate.d.ts b/tools/ui/node_modules/es-toolkit/compat/isDate.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5c5214ab61bce16c9a07aecc09cb8829b411ff5e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isDate.d.ts @@ -0,0 +1 @@ +export { isDate as default } from '../dist/compat/predicate/isDate.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isDate.js b/tools/ui/node_modules/es-toolkit/compat/isDate.js new file mode 100644 index 0000000000000000000000000000000000000000..a2fde9bdec7b3cef3ccc07743a3782d6170e434a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isDate.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isDate.js').isDate; diff --git a/tools/ui/node_modules/es-toolkit/compat/isElement.d.ts b/tools/ui/node_modules/es-toolkit/compat/isElement.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d743869751b9d3a906cc8a4f01b0785a88dff2e7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isElement.d.ts @@ -0,0 +1 @@ +export { isElement as default } from '../dist/compat/predicate/isElement.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isElement.js b/tools/ui/node_modules/es-toolkit/compat/isElement.js new file mode 100644 index 0000000000000000000000000000000000000000..36af2280bff5b1144dde332d12851f1f6c26ed98 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isElement.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isElement.js').isElement; diff --git a/tools/ui/node_modules/es-toolkit/compat/isEmpty.d.ts b/tools/ui/node_modules/es-toolkit/compat/isEmpty.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9af3a75b41650292018070179413f17a2d451968 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isEmpty.d.ts @@ -0,0 +1 @@ +export { isEmpty as default } from '../dist/compat/predicate/isEmpty.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isEmpty.js b/tools/ui/node_modules/es-toolkit/compat/isEmpty.js new file mode 100644 index 0000000000000000000000000000000000000000..6ab15a963a02b292a8facc910ed9be97886e64cd --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isEmpty.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isEmpty.js').isEmpty; diff --git a/tools/ui/node_modules/es-toolkit/compat/isEqual.d.ts b/tools/ui/node_modules/es-toolkit/compat/isEqual.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9e0ff0eed067967656e25bb05d38d61ff5d4e69b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isEqual.d.ts @@ -0,0 +1 @@ +export { isEqual as default } from '../dist/predicate/isEqual.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isEqual.js b/tools/ui/node_modules/es-toolkit/compat/isEqual.js new file mode 100644 index 0000000000000000000000000000000000000000..5cb45f3a7cbfcaa8997fb18c6fbccf9cc6814fed --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isEqual.js @@ -0,0 +1 @@ +module.exports = require('../dist/predicate/isEqual.js').isEqual; diff --git a/tools/ui/node_modules/es-toolkit/compat/isEqualWith.d.ts b/tools/ui/node_modules/es-toolkit/compat/isEqualWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..20c4829f63ce51831f41f62f588e1f5098a79b30 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isEqualWith.d.ts @@ -0,0 +1 @@ +export { isEqualWith as default } from '../dist/compat/predicate/isEqualWith.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isEqualWith.js b/tools/ui/node_modules/es-toolkit/compat/isEqualWith.js new file mode 100644 index 0000000000000000000000000000000000000000..cc8f8e24d7a6f448fd6db6f8b5acb918041bea17 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isEqualWith.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isEqualWith.js').isEqualWith; diff --git a/tools/ui/node_modules/es-toolkit/compat/isError.d.ts b/tools/ui/node_modules/es-toolkit/compat/isError.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e2fd19750feb1139809557cb88294dede1eb7aea --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isError.d.ts @@ -0,0 +1 @@ +export { isError as default } from '../dist/compat/predicate/isError.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isError.js b/tools/ui/node_modules/es-toolkit/compat/isError.js new file mode 100644 index 0000000000000000000000000000000000000000..f7fc01fb2ab499a4aed672047c9a507519087c98 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isError.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isError.js').isError; diff --git a/tools/ui/node_modules/es-toolkit/compat/isFinite.d.ts b/tools/ui/node_modules/es-toolkit/compat/isFinite.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..28006a11bf1c4212da793b6e22c2335273faaabc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isFinite.d.ts @@ -0,0 +1 @@ +export { isFinite as default } from '../dist/compat/predicate/isFinite.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isFinite.js b/tools/ui/node_modules/es-toolkit/compat/isFinite.js new file mode 100644 index 0000000000000000000000000000000000000000..58856e5db6e854383d185bd9bf600931d1fe92ec --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isFinite.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isFinite.js').isFinite; diff --git a/tools/ui/node_modules/es-toolkit/compat/isFunction.d.ts b/tools/ui/node_modules/es-toolkit/compat/isFunction.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fb4e485c1733355e67a15c3b9c5234e10bdb4a9b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isFunction.d.ts @@ -0,0 +1 @@ +export { isFunction as default } from '../dist/predicate/isFunction.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isFunction.js b/tools/ui/node_modules/es-toolkit/compat/isFunction.js new file mode 100644 index 0000000000000000000000000000000000000000..2234cec666c6b0296790b50b701908b6833bed5e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isFunction.js @@ -0,0 +1 @@ +module.exports = require('../dist/predicate/isFunction.js').isFunction; diff --git a/tools/ui/node_modules/es-toolkit/compat/isInteger.d.ts b/tools/ui/node_modules/es-toolkit/compat/isInteger.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8f276a03a3c5575e07019d726e97b2158261a795 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isInteger.d.ts @@ -0,0 +1 @@ +export { isInteger as default } from '../dist/compat/predicate/isInteger.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isInteger.js b/tools/ui/node_modules/es-toolkit/compat/isInteger.js new file mode 100644 index 0000000000000000000000000000000000000000..141ed8caf6335e0137932f96fd58400446fcd1e8 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isInteger.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isInteger.js').isInteger; diff --git a/tools/ui/node_modules/es-toolkit/compat/isLength.d.ts b/tools/ui/node_modules/es-toolkit/compat/isLength.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cf7d3fc1d06644f2f11d37d27f21b66be6007c95 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isLength.d.ts @@ -0,0 +1 @@ +export { isLength as default } from '../dist/predicate/isLength.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isLength.js b/tools/ui/node_modules/es-toolkit/compat/isLength.js new file mode 100644 index 0000000000000000000000000000000000000000..36226bc4b7fc8a01c8a9c998b668034d8881449a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isLength.js @@ -0,0 +1 @@ +module.exports = require('../dist/predicate/isLength.js').isLength; diff --git a/tools/ui/node_modules/es-toolkit/compat/isMap.d.ts b/tools/ui/node_modules/es-toolkit/compat/isMap.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bfe859879589ef6a630de5454d1253088624e711 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isMap.d.ts @@ -0,0 +1 @@ +export { isMap as default } from '../dist/compat/predicate/isMap.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isMap.js b/tools/ui/node_modules/es-toolkit/compat/isMap.js new file mode 100644 index 0000000000000000000000000000000000000000..c2e996900ad199f05bbe3ff0ed371c6162748729 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isMap.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isMap.js').isMap; diff --git a/tools/ui/node_modules/es-toolkit/compat/isMatch.d.ts b/tools/ui/node_modules/es-toolkit/compat/isMatch.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7b83dcbf183f064ecf3234c72a30d434a21120b9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isMatch.d.ts @@ -0,0 +1 @@ +export { isMatch as default } from '../dist/compat/predicate/isMatch.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isMatch.js b/tools/ui/node_modules/es-toolkit/compat/isMatch.js new file mode 100644 index 0000000000000000000000000000000000000000..9d44e67429c64e4320bb24c9cb71628abaefc80a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isMatch.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isMatch.js').isMatch; diff --git a/tools/ui/node_modules/es-toolkit/compat/isMatchWith.d.ts b/tools/ui/node_modules/es-toolkit/compat/isMatchWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..41830803c7c7b6a900e3a160917ecfef312b0656 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isMatchWith.d.ts @@ -0,0 +1 @@ +export { isMatchWith as default } from '../dist/compat/predicate/isMatchWith.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isMatchWith.js b/tools/ui/node_modules/es-toolkit/compat/isMatchWith.js new file mode 100644 index 0000000000000000000000000000000000000000..960cab199c41168a12db134800f14693b99f53ac --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isMatchWith.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isMatchWith.js').isMatchWith; diff --git a/tools/ui/node_modules/es-toolkit/compat/isNaN.d.ts b/tools/ui/node_modules/es-toolkit/compat/isNaN.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8ca3741b062c125cef044f504555124d6e0b2f3d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isNaN.d.ts @@ -0,0 +1 @@ +export { isNaN as default } from '../dist/compat/predicate/isNaN.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isNaN.js b/tools/ui/node_modules/es-toolkit/compat/isNaN.js new file mode 100644 index 0000000000000000000000000000000000000000..20074c3ace5328d0e2bdcfaef88127c76300b7ef --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isNaN.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isNaN.js').isNaN; diff --git a/tools/ui/node_modules/es-toolkit/compat/isNative.d.ts b/tools/ui/node_modules/es-toolkit/compat/isNative.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a24c82b7a29a9f81bdd4ec662513864d968c88d8 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isNative.d.ts @@ -0,0 +1 @@ +export { isNative as default } from '../dist/compat/predicate/isNative.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isNative.js b/tools/ui/node_modules/es-toolkit/compat/isNative.js new file mode 100644 index 0000000000000000000000000000000000000000..cf7cf13fc2dbac40396f313970506c469c90ab87 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isNative.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isNative.js').isNative; diff --git a/tools/ui/node_modules/es-toolkit/compat/isNil.d.ts b/tools/ui/node_modules/es-toolkit/compat/isNil.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4fe5ed49a00c213aa4796c8f55f04e27e64116ce --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isNil.d.ts @@ -0,0 +1 @@ +export { isNil as default } from '../dist/compat/predicate/isNil.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isNil.js b/tools/ui/node_modules/es-toolkit/compat/isNil.js new file mode 100644 index 0000000000000000000000000000000000000000..6cd495b9e1e6b8d4776d3edd612a48c26bb43230 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isNil.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isNil.js').isNil; diff --git a/tools/ui/node_modules/es-toolkit/compat/isNull.d.ts b/tools/ui/node_modules/es-toolkit/compat/isNull.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fa4fa64ed8b68a6f7b0356dc02e793dfa2894bfa --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isNull.d.ts @@ -0,0 +1 @@ +export { isNull as default } from '../dist/predicate/isNull.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isNull.js b/tools/ui/node_modules/es-toolkit/compat/isNull.js new file mode 100644 index 0000000000000000000000000000000000000000..927223a99bc008971a1dcee364c2a395b82068b5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isNull.js @@ -0,0 +1 @@ +module.exports = require('../dist/predicate/isNull.js').isNull; diff --git a/tools/ui/node_modules/es-toolkit/compat/isNumber.d.ts b/tools/ui/node_modules/es-toolkit/compat/isNumber.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b83bb622ab1d3159676ad4363d59cfb9761d0997 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isNumber.d.ts @@ -0,0 +1 @@ +export { isNumber as default } from '../dist/compat/predicate/isNumber.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isNumber.js b/tools/ui/node_modules/es-toolkit/compat/isNumber.js new file mode 100644 index 0000000000000000000000000000000000000000..69da17b207aa550e7dbea575dcdbd7994e264bca --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isNumber.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isNumber.js').isNumber; diff --git a/tools/ui/node_modules/es-toolkit/compat/isObject.d.ts b/tools/ui/node_modules/es-toolkit/compat/isObject.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6f1fdd2850dfe78fdc5ba6a69df511d182ecbd0c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isObject.d.ts @@ -0,0 +1 @@ +export { isObject as default } from '../dist/compat/predicate/isObject.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isObject.js b/tools/ui/node_modules/es-toolkit/compat/isObject.js new file mode 100644 index 0000000000000000000000000000000000000000..35ecb4777cb5fe712af753dd8649774eeba41db9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isObject.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isObject.js').isObject; diff --git a/tools/ui/node_modules/es-toolkit/compat/isObjectLike.d.ts b/tools/ui/node_modules/es-toolkit/compat/isObjectLike.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..95c1b2a90bb3f754ed745486bc36aaf26ca9649f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isObjectLike.d.ts @@ -0,0 +1 @@ +export { isObjectLike as default } from '../dist/compat/predicate/isObjectLike.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isObjectLike.js b/tools/ui/node_modules/es-toolkit/compat/isObjectLike.js new file mode 100644 index 0000000000000000000000000000000000000000..2466f3b3d75345a5ef04058953cd8364c7e01e87 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isObjectLike.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isObjectLike.js').isObjectLike; diff --git a/tools/ui/node_modules/es-toolkit/compat/isPlainObject.d.ts b/tools/ui/node_modules/es-toolkit/compat/isPlainObject.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d368c9a0018df9421e80ec920db122fd9788bfbf --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isPlainObject.d.ts @@ -0,0 +1 @@ +export { isPlainObject as default } from '../dist/compat/predicate/isPlainObject.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isPlainObject.js b/tools/ui/node_modules/es-toolkit/compat/isPlainObject.js new file mode 100644 index 0000000000000000000000000000000000000000..825f15cc9a96812ecfbcc060b0f36a4ee27ca9d6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isPlainObject.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isPlainObject.js').isPlainObject; diff --git a/tools/ui/node_modules/es-toolkit/compat/isRegExp.d.ts b/tools/ui/node_modules/es-toolkit/compat/isRegExp.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a96a56eeb0e6cc4265483cd24118c38e650b146d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isRegExp.d.ts @@ -0,0 +1 @@ +export { isRegExp as default } from '../dist/compat/predicate/isRegExp.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isRegExp.js b/tools/ui/node_modules/es-toolkit/compat/isRegExp.js new file mode 100644 index 0000000000000000000000000000000000000000..2d7a1f0dbbdfeb2cc8fe9b3f615d48fbdac0d80d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isRegExp.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isRegExp.js').isRegExp; diff --git a/tools/ui/node_modules/es-toolkit/compat/isSafeInteger.d.ts b/tools/ui/node_modules/es-toolkit/compat/isSafeInteger.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..719024e7351b07049f65ad115969a287ff069148 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isSafeInteger.d.ts @@ -0,0 +1 @@ +export { isSafeInteger as default } from '../dist/compat/predicate/isSafeInteger.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isSafeInteger.js b/tools/ui/node_modules/es-toolkit/compat/isSafeInteger.js new file mode 100644 index 0000000000000000000000000000000000000000..21f23cdd045cc7311389fb7977bce0edfbef3a66 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isSafeInteger.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isSafeInteger.js').isSafeInteger; diff --git a/tools/ui/node_modules/es-toolkit/compat/isSet.d.ts b/tools/ui/node_modules/es-toolkit/compat/isSet.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0253d5a690e8759cb6d836f24bf6b9e1708c2963 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isSet.d.ts @@ -0,0 +1 @@ +export { isSet as default } from '../dist/compat/predicate/isSet.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isSet.js b/tools/ui/node_modules/es-toolkit/compat/isSet.js new file mode 100644 index 0000000000000000000000000000000000000000..7ee21e6628218bd24442d9219b1de9a83c44b50d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isSet.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isSet.js').isSet; diff --git a/tools/ui/node_modules/es-toolkit/compat/isString.d.ts b/tools/ui/node_modules/es-toolkit/compat/isString.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3a5e7234523372a2f8d8ea462a486e892357dca2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isString.d.ts @@ -0,0 +1 @@ +export { isString as default } from '../dist/compat/predicate/isString.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isString.js b/tools/ui/node_modules/es-toolkit/compat/isString.js new file mode 100644 index 0000000000000000000000000000000000000000..6524ced260c3d91d801ff29d0232a1d950ef08a1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isString.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isString.js').isString; diff --git a/tools/ui/node_modules/es-toolkit/compat/isSymbol.d.ts b/tools/ui/node_modules/es-toolkit/compat/isSymbol.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7030188371448352dec0b435004cc1120f175b78 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isSymbol.d.ts @@ -0,0 +1 @@ +export { isSymbol as default } from '../dist/compat/predicate/isSymbol.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isSymbol.js b/tools/ui/node_modules/es-toolkit/compat/isSymbol.js new file mode 100644 index 0000000000000000000000000000000000000000..18d1152cdec2b710c7232efaae62254cda10b8fc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isSymbol.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isSymbol.js').isSymbol; diff --git a/tools/ui/node_modules/es-toolkit/compat/isTypedArray.d.ts b/tools/ui/node_modules/es-toolkit/compat/isTypedArray.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e4f493a34fbb7a19f04ba652eea33198a464f4b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isTypedArray.d.ts @@ -0,0 +1 @@ +export { isTypedArray as default } from '../dist/compat/predicate/isTypedArray.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isTypedArray.js b/tools/ui/node_modules/es-toolkit/compat/isTypedArray.js new file mode 100644 index 0000000000000000000000000000000000000000..79bd92151da2d7da6590d7152ae3beb97f3c6397 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isTypedArray.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isTypedArray.js').isTypedArray; diff --git a/tools/ui/node_modules/es-toolkit/compat/isUndefined.d.ts b/tools/ui/node_modules/es-toolkit/compat/isUndefined.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5bc15d1cca90d9a80cff7723a562c5a0a219d142 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isUndefined.d.ts @@ -0,0 +1 @@ +export { isUndefined as default } from '../dist/predicate/isUndefined.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isUndefined.js b/tools/ui/node_modules/es-toolkit/compat/isUndefined.js new file mode 100644 index 0000000000000000000000000000000000000000..db7e35cde4392d8f5fcfd949d293481d46b976ec --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isUndefined.js @@ -0,0 +1 @@ +module.exports = require('../dist/predicate/isUndefined.js').isUndefined; diff --git a/tools/ui/node_modules/es-toolkit/compat/isWeakMap.d.ts b/tools/ui/node_modules/es-toolkit/compat/isWeakMap.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..90e6fa7616336cf165a79d13bf0a70ad2053092d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isWeakMap.d.ts @@ -0,0 +1 @@ +export { isWeakMap as default } from '../dist/compat/predicate/isWeakMap.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isWeakMap.js b/tools/ui/node_modules/es-toolkit/compat/isWeakMap.js new file mode 100644 index 0000000000000000000000000000000000000000..35e0048a3ae4d64a97dc396f387434f9ac07521e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isWeakMap.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isWeakMap.js').isWeakMap; diff --git a/tools/ui/node_modules/es-toolkit/compat/isWeakSet.d.ts b/tools/ui/node_modules/es-toolkit/compat/isWeakSet.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..de8b80efe671df8452ac9047404aa520de82d63c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isWeakSet.d.ts @@ -0,0 +1 @@ +export { isWeakSet as default } from '../dist/compat/predicate/isWeakSet.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/isWeakSet.js b/tools/ui/node_modules/es-toolkit/compat/isWeakSet.js new file mode 100644 index 0000000000000000000000000000000000000000..3af817d2cc9426c61a3181a2aca94d00c31fff6b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/isWeakSet.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/isWeakSet.js').isWeakSet; diff --git a/tools/ui/node_modules/es-toolkit/compat/iteratee.d.ts b/tools/ui/node_modules/es-toolkit/compat/iteratee.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..48d0a7bba23bb42bf96f7d970b86b5e06815d4a5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/iteratee.d.ts @@ -0,0 +1 @@ +export { iteratee as default } from '../dist/compat/util/iteratee.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/iteratee.js b/tools/ui/node_modules/es-toolkit/compat/iteratee.js new file mode 100644 index 0000000000000000000000000000000000000000..271bc3921f38ffd3afb8f07a6f82b777b048d97b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/iteratee.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/iteratee.js').iteratee; diff --git a/tools/ui/node_modules/es-toolkit/compat/join.d.ts b/tools/ui/node_modules/es-toolkit/compat/join.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e228612cf50104224faf4834155c83c1645146ec --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/join.d.ts @@ -0,0 +1 @@ +export { join as default } from '../dist/compat/array/join.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/join.js b/tools/ui/node_modules/es-toolkit/compat/join.js new file mode 100644 index 0000000000000000000000000000000000000000..43cb4fcdbeb4a983cb6315e32bbdd49c4f1d4af6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/join.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/join.js').join; diff --git a/tools/ui/node_modules/es-toolkit/compat/kebabCase.d.ts b/tools/ui/node_modules/es-toolkit/compat/kebabCase.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2e6a3defb86fa14d78938b5ae2c4b92c2912ed32 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/kebabCase.d.ts @@ -0,0 +1 @@ +export { kebabCase as default } from '../dist/compat/string/kebabCase.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/kebabCase.js b/tools/ui/node_modules/es-toolkit/compat/kebabCase.js new file mode 100644 index 0000000000000000000000000000000000000000..fe516ca91980848bd7fb154342751d08e72c159f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/kebabCase.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/kebabCase.js').kebabCase; diff --git a/tools/ui/node_modules/es-toolkit/compat/keyBy.d.ts b/tools/ui/node_modules/es-toolkit/compat/keyBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b31d2315c7e8afaab5a8d4f0c02eac70be5ef8f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/keyBy.d.ts @@ -0,0 +1 @@ +export { keyBy as default } from '../dist/compat/array/keyBy.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/keyBy.js b/tools/ui/node_modules/es-toolkit/compat/keyBy.js new file mode 100644 index 0000000000000000000000000000000000000000..b512ce51b2c200eee1d006648317d78088f39a1c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/keyBy.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/keyBy.js').keyBy; diff --git a/tools/ui/node_modules/es-toolkit/compat/keys.d.ts b/tools/ui/node_modules/es-toolkit/compat/keys.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d50c1663aed2bcdd6ce89bf34ad7860905875fcd --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/keys.d.ts @@ -0,0 +1 @@ +export { keys as default } from '../dist/compat/object/keys.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/keys.js b/tools/ui/node_modules/es-toolkit/compat/keys.js new file mode 100644 index 0000000000000000000000000000000000000000..2724192c4574cee6e12660b57d8f1032c3b55e71 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/keys.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/keys.js').keys; diff --git a/tools/ui/node_modules/es-toolkit/compat/keysIn.d.ts b/tools/ui/node_modules/es-toolkit/compat/keysIn.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2534b9307782de9da40d1eed447317c28c1823cc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/keysIn.d.ts @@ -0,0 +1 @@ +export { keysIn as default } from '../dist/compat/object/keysIn.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/keysIn.js b/tools/ui/node_modules/es-toolkit/compat/keysIn.js new file mode 100644 index 0000000000000000000000000000000000000000..ed0d3b2be692f1d0946a2445edb6964ffaaac733 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/keysIn.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/keysIn.js').keysIn; diff --git a/tools/ui/node_modules/es-toolkit/compat/last.d.ts b/tools/ui/node_modules/es-toolkit/compat/last.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a965b6ce362ca057f43ca36dfcb41cd8b5a72e76 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/last.d.ts @@ -0,0 +1 @@ +export { last as default } from '../dist/compat/array/last.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/last.js b/tools/ui/node_modules/es-toolkit/compat/last.js new file mode 100644 index 0000000000000000000000000000000000000000..d692cad422476df2ed9c81f6141a3098cbd4c89b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/last.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/last.js').last; diff --git a/tools/ui/node_modules/es-toolkit/compat/lastIndexOf.d.ts b/tools/ui/node_modules/es-toolkit/compat/lastIndexOf.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b62fd33539a81c5eb71be68b7d291cb3671432b5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/lastIndexOf.d.ts @@ -0,0 +1 @@ +export { lastIndexOf as default } from '../dist/compat/array/lastIndexOf.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/lastIndexOf.js b/tools/ui/node_modules/es-toolkit/compat/lastIndexOf.js new file mode 100644 index 0000000000000000000000000000000000000000..1c51d42cb8cb3d0566870faa1f6b555bf2bf7347 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/lastIndexOf.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/lastIndexOf.js').lastIndexOf; diff --git a/tools/ui/node_modules/es-toolkit/compat/lowerCase.d.ts b/tools/ui/node_modules/es-toolkit/compat/lowerCase.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c94febec69c5432ba826cf72c8dd59c188a106a1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/lowerCase.d.ts @@ -0,0 +1 @@ +export { lowerCase as default } from '../dist/compat/string/lowerCase.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/lowerCase.js b/tools/ui/node_modules/es-toolkit/compat/lowerCase.js new file mode 100644 index 0000000000000000000000000000000000000000..6f3c7e0539cd6b00b78862657ed474e9e962eabb --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/lowerCase.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/lowerCase.js').lowerCase; diff --git a/tools/ui/node_modules/es-toolkit/compat/lowerFirst.d.ts b/tools/ui/node_modules/es-toolkit/compat/lowerFirst.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9028a16b48a1b4a2400b21ded5dbe05a7a624d49 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/lowerFirst.d.ts @@ -0,0 +1 @@ +export { lowerFirst as default } from '../dist/compat/string/lowerFirst.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/lowerFirst.js b/tools/ui/node_modules/es-toolkit/compat/lowerFirst.js new file mode 100644 index 0000000000000000000000000000000000000000..40c60365fb7334e36d7443cdaccf6f71c10c53ac --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/lowerFirst.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/lowerFirst.js').lowerFirst; diff --git a/tools/ui/node_modules/es-toolkit/compat/lt.d.ts b/tools/ui/node_modules/es-toolkit/compat/lt.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..47de8c95a5b1e66dbcfa6fbbb9f15e3a408fa199 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/lt.d.ts @@ -0,0 +1 @@ +export { lt as default } from '../dist/compat/util/lt.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/lt.js b/tools/ui/node_modules/es-toolkit/compat/lt.js new file mode 100644 index 0000000000000000000000000000000000000000..a4fed02db6ec7d8cc9aeedb9b9c270dd0b0ad2cc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/lt.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/lt.js').lt; diff --git a/tools/ui/node_modules/es-toolkit/compat/lte.d.ts b/tools/ui/node_modules/es-toolkit/compat/lte.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ea87cf37267dae043e7a0ef06354ecdd7c514127 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/lte.d.ts @@ -0,0 +1 @@ +export { lte as default } from '../dist/compat/util/lte.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/lte.js b/tools/ui/node_modules/es-toolkit/compat/lte.js new file mode 100644 index 0000000000000000000000000000000000000000..8af30f13505e80de81a3627c504e73baa2a1b7da --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/lte.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/lte.js').lte; diff --git a/tools/ui/node_modules/es-toolkit/compat/map.d.ts b/tools/ui/node_modules/es-toolkit/compat/map.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..64dad441bc9f1e2b355b76142438a07b975b22b6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/map.d.ts @@ -0,0 +1 @@ +export { map as default } from '../dist/compat/array/map.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/map.js b/tools/ui/node_modules/es-toolkit/compat/map.js new file mode 100644 index 0000000000000000000000000000000000000000..a18a00e357c7d9d038f343bbd7fb0d0e5dff91fe --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/map.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/map.js').map; diff --git a/tools/ui/node_modules/es-toolkit/compat/mapKeys.d.ts b/tools/ui/node_modules/es-toolkit/compat/mapKeys.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..714cf3bab886c74ce113679b1cb2e019c747ea70 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/mapKeys.d.ts @@ -0,0 +1 @@ +export { mapKeys as default } from '../dist/compat/object/mapKeys.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/mapKeys.js b/tools/ui/node_modules/es-toolkit/compat/mapKeys.js new file mode 100644 index 0000000000000000000000000000000000000000..83cdfd757037ab503c9991564688ae1244d4c346 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/mapKeys.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/mapKeys.js').mapKeys; diff --git a/tools/ui/node_modules/es-toolkit/compat/mapValues.d.ts b/tools/ui/node_modules/es-toolkit/compat/mapValues.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5f7c23629b9fa8adfe47fa3c73cb4fad43b705da --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/mapValues.d.ts @@ -0,0 +1 @@ +export { mapValues as default } from '../dist/compat/object/mapValues.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/mapValues.js b/tools/ui/node_modules/es-toolkit/compat/mapValues.js new file mode 100644 index 0000000000000000000000000000000000000000..47bff7a505f39929e0f4d60fe38ded4e3bf12078 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/mapValues.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/mapValues.js').mapValues; diff --git a/tools/ui/node_modules/es-toolkit/compat/matches.d.ts b/tools/ui/node_modules/es-toolkit/compat/matches.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7db01ab9496dca3ae14c46f05c2d6aebae17f6ec --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/matches.d.ts @@ -0,0 +1 @@ +export { matches as default } from '../dist/compat/predicate/matches.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/matches.js b/tools/ui/node_modules/es-toolkit/compat/matches.js new file mode 100644 index 0000000000000000000000000000000000000000..2e41870368701b9b0863bbc3c56ededbb559f49a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/matches.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/matches.js').matches; diff --git a/tools/ui/node_modules/es-toolkit/compat/matchesProperty.d.ts b/tools/ui/node_modules/es-toolkit/compat/matchesProperty.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6499c83486cf89871e47557b2e602aecf6d396f3 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/matchesProperty.d.ts @@ -0,0 +1 @@ +export { matchesProperty as default } from '../dist/compat/predicate/matchesProperty.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/matchesProperty.js b/tools/ui/node_modules/es-toolkit/compat/matchesProperty.js new file mode 100644 index 0000000000000000000000000000000000000000..afc34d01c1cd372f78ff0d1c8e970ecb118a6cc7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/matchesProperty.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/predicate/matchesProperty.js').matchesProperty; diff --git a/tools/ui/node_modules/es-toolkit/compat/max.d.ts b/tools/ui/node_modules/es-toolkit/compat/max.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..93be531034d60009cd70c941d09e2b95ed308d25 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/max.d.ts @@ -0,0 +1 @@ +export { max as default } from '../dist/compat/math/max.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/max.js b/tools/ui/node_modules/es-toolkit/compat/max.js new file mode 100644 index 0000000000000000000000000000000000000000..51297d7093f87ed7e709830d344fe886931845b0 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/max.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/math/max.js').max; diff --git a/tools/ui/node_modules/es-toolkit/compat/maxBy.d.ts b/tools/ui/node_modules/es-toolkit/compat/maxBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9d9a90495f226f837328206216bbedd56cec5e2e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/maxBy.d.ts @@ -0,0 +1 @@ +export { maxBy as default } from '../dist/compat/math/maxBy.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/maxBy.js b/tools/ui/node_modules/es-toolkit/compat/maxBy.js new file mode 100644 index 0000000000000000000000000000000000000000..6d76ad3bcf4ad197062a7fc426a4e2c91ed36f9a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/maxBy.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/math/maxBy.js').maxBy; diff --git a/tools/ui/node_modules/es-toolkit/compat/mean.d.ts b/tools/ui/node_modules/es-toolkit/compat/mean.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..af5f41f64b4c2944af97aa86c7de8b949127922c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/mean.d.ts @@ -0,0 +1 @@ +export { mean as default } from '../dist/compat/math/mean.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/mean.js b/tools/ui/node_modules/es-toolkit/compat/mean.js new file mode 100644 index 0000000000000000000000000000000000000000..fe8f77f49850db475e9b4b2a4869a444b1266954 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/mean.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/math/mean.js').mean; diff --git a/tools/ui/node_modules/es-toolkit/compat/meanBy.d.ts b/tools/ui/node_modules/es-toolkit/compat/meanBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0245ad6c8089704d631051927518af8557a7901e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/meanBy.d.ts @@ -0,0 +1 @@ +export { meanBy as default } from '../dist/compat/math/meanBy.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/meanBy.js b/tools/ui/node_modules/es-toolkit/compat/meanBy.js new file mode 100644 index 0000000000000000000000000000000000000000..f59da9c76cc2a5f159391b26bb79027c84ceb4fb --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/meanBy.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/math/meanBy.js').meanBy; diff --git a/tools/ui/node_modules/es-toolkit/compat/memoize.d.ts b/tools/ui/node_modules/es-toolkit/compat/memoize.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b8770287d901fe5c4fe9361bce7537e42dc7be7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/memoize.d.ts @@ -0,0 +1 @@ +export { memoize as default } from '../dist/compat/function/memoize.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/memoize.js b/tools/ui/node_modules/es-toolkit/compat/memoize.js new file mode 100644 index 0000000000000000000000000000000000000000..4d1bb9a75e4ee3d270781684919c167c0c500626 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/memoize.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/function/memoize.js').memoize; diff --git a/tools/ui/node_modules/es-toolkit/compat/merge.d.ts b/tools/ui/node_modules/es-toolkit/compat/merge.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5f28af298b90cc2eb2feee2c976deeace116061f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/merge.d.ts @@ -0,0 +1 @@ +export { merge as default } from '../dist/compat/object/merge.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/merge.js b/tools/ui/node_modules/es-toolkit/compat/merge.js new file mode 100644 index 0000000000000000000000000000000000000000..0bfbba512c6e085f53ff78206c8bb792645353e8 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/merge.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/merge.js').merge; diff --git a/tools/ui/node_modules/es-toolkit/compat/mergeWith.d.ts b/tools/ui/node_modules/es-toolkit/compat/mergeWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..185c9a30f0ce598ebe7167a3ddfe1bd5a5203add --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/mergeWith.d.ts @@ -0,0 +1 @@ +export { mergeWith as default } from '../dist/compat/object/mergeWith.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/mergeWith.js b/tools/ui/node_modules/es-toolkit/compat/mergeWith.js new file mode 100644 index 0000000000000000000000000000000000000000..61e91c9d1b52c0af0b93d3489a5417de05a79778 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/mergeWith.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/mergeWith.js').mergeWith; diff --git a/tools/ui/node_modules/es-toolkit/compat/method.d.ts b/tools/ui/node_modules/es-toolkit/compat/method.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b5ece0d048b5eb657c2aeb3f878f8913871c01a9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/method.d.ts @@ -0,0 +1 @@ +export { method as default } from '../dist/compat/util/method.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/method.js b/tools/ui/node_modules/es-toolkit/compat/method.js new file mode 100644 index 0000000000000000000000000000000000000000..70fdd1877fb7cd455b65885fee8893266e0bb359 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/method.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/method.js').method; diff --git a/tools/ui/node_modules/es-toolkit/compat/methodOf.d.ts b/tools/ui/node_modules/es-toolkit/compat/methodOf.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3c6036431fdce5bbe21f28020a652b3025fcb845 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/methodOf.d.ts @@ -0,0 +1 @@ +export { methodOf as default } from '../dist/compat/util/methodOf.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/methodOf.js b/tools/ui/node_modules/es-toolkit/compat/methodOf.js new file mode 100644 index 0000000000000000000000000000000000000000..e938636f6869757bec4c4c850e8ba802bc813bda --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/methodOf.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/methodOf.js').methodOf; diff --git a/tools/ui/node_modules/es-toolkit/compat/min.d.ts b/tools/ui/node_modules/es-toolkit/compat/min.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..07137c6b61163a52cbba27671014052025c9b8bd --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/min.d.ts @@ -0,0 +1 @@ +export { min as default } from '../dist/compat/math/min.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/min.js b/tools/ui/node_modules/es-toolkit/compat/min.js new file mode 100644 index 0000000000000000000000000000000000000000..104a89201b4b61a5cb5512aa6ae830551c1f1fd7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/min.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/math/min.js').min; diff --git a/tools/ui/node_modules/es-toolkit/compat/minBy.d.ts b/tools/ui/node_modules/es-toolkit/compat/minBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..35c21ed25ec93811460ead8a888a6707aae054e5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/minBy.d.ts @@ -0,0 +1 @@ +export { minBy as default } from '../dist/compat/math/minBy.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/minBy.js b/tools/ui/node_modules/es-toolkit/compat/minBy.js new file mode 100644 index 0000000000000000000000000000000000000000..eee93877009e9266dcad6bc8b82041ba3e39479a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/minBy.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/math/minBy.js').minBy; diff --git a/tools/ui/node_modules/es-toolkit/compat/multiply.d.ts b/tools/ui/node_modules/es-toolkit/compat/multiply.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fd4875665bc611d9dbb2c208c9c584f4645bff18 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/multiply.d.ts @@ -0,0 +1 @@ +export { multiply as default } from '../dist/compat/math/multiply.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/multiply.js b/tools/ui/node_modules/es-toolkit/compat/multiply.js new file mode 100644 index 0000000000000000000000000000000000000000..6f5e6bd4f6bf7e05997b9aa3a847152b03e01d60 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/multiply.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/math/multiply.js').multiply; diff --git a/tools/ui/node_modules/es-toolkit/compat/negate.d.ts b/tools/ui/node_modules/es-toolkit/compat/negate.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..942a6e7265658c0e007230ab8a3e4e7c8a736a28 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/negate.d.ts @@ -0,0 +1 @@ +export { negate as default } from '../dist/compat/function/negate.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/negate.js b/tools/ui/node_modules/es-toolkit/compat/negate.js new file mode 100644 index 0000000000000000000000000000000000000000..4b11fa354a6af80b6b06bfd07e1ae754297293a7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/negate.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/function/negate.js').negate; diff --git a/tools/ui/node_modules/es-toolkit/compat/noop.d.ts b/tools/ui/node_modules/es-toolkit/compat/noop.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c4ce7b461ca55b1d856739c6f94a857ab767bda1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/noop.d.ts @@ -0,0 +1 @@ +export { noop as default } from '../dist/function/noop.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/noop.js b/tools/ui/node_modules/es-toolkit/compat/noop.js new file mode 100644 index 0000000000000000000000000000000000000000..2e1fa8d2b92be751adda1fbb98d939bb894c2d60 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/noop.js @@ -0,0 +1 @@ +module.exports = require('../dist/function/noop.js').noop; diff --git a/tools/ui/node_modules/es-toolkit/compat/now.d.ts b/tools/ui/node_modules/es-toolkit/compat/now.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9ab491cf90ff96bb6565ff5477dfcd177e429ee4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/now.d.ts @@ -0,0 +1 @@ +export { now as default } from '../dist/compat/util/now.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/now.js b/tools/ui/node_modules/es-toolkit/compat/now.js new file mode 100644 index 0000000000000000000000000000000000000000..386ba47fad8177f3473ea382646edc35ba98f3d4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/now.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/now.js').now; diff --git a/tools/ui/node_modules/es-toolkit/compat/nth.d.ts b/tools/ui/node_modules/es-toolkit/compat/nth.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fea35dfc00423da9304ec7cc9993ebabc605751f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/nth.d.ts @@ -0,0 +1 @@ +export { nth as default } from '../dist/compat/array/nth.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/nth.js b/tools/ui/node_modules/es-toolkit/compat/nth.js new file mode 100644 index 0000000000000000000000000000000000000000..2f83fd33dd400657eb0666116156b2ac2742701f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/nth.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/nth.js').nth; diff --git a/tools/ui/node_modules/es-toolkit/compat/nthArg.d.ts b/tools/ui/node_modules/es-toolkit/compat/nthArg.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..856129fddca3596278723a7c8f57990be2175043 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/nthArg.d.ts @@ -0,0 +1 @@ +export { nthArg as default } from '../dist/compat/function/nthArg.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/nthArg.js b/tools/ui/node_modules/es-toolkit/compat/nthArg.js new file mode 100644 index 0000000000000000000000000000000000000000..16a4fbaf33babeb625115be73e86b51eea7b4ee4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/nthArg.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/function/nthArg.js').nthArg; diff --git a/tools/ui/node_modules/es-toolkit/compat/omit.d.ts b/tools/ui/node_modules/es-toolkit/compat/omit.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6fd0987c59f6b7cce5dd0b6f283cfa8f78714594 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/omit.d.ts @@ -0,0 +1 @@ +export { omit as default } from '../dist/compat/object/omit.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/omit.js b/tools/ui/node_modules/es-toolkit/compat/omit.js new file mode 100644 index 0000000000000000000000000000000000000000..4bcf2119ffe13c129eafb54a7c8b95c52a604f0e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/omit.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/omit.js').omit; diff --git a/tools/ui/node_modules/es-toolkit/compat/omitBy.d.ts b/tools/ui/node_modules/es-toolkit/compat/omitBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..160cc4768ca1154cc3b086c2e02d1918201ef7a5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/omitBy.d.ts @@ -0,0 +1 @@ +export { omitBy as default } from '../dist/compat/object/omitBy.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/omitBy.js b/tools/ui/node_modules/es-toolkit/compat/omitBy.js new file mode 100644 index 0000000000000000000000000000000000000000..8aa14178cef1dbdcbb389a444f1a1803611988a5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/omitBy.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/omitBy.js').omitBy; diff --git a/tools/ui/node_modules/es-toolkit/compat/once.d.ts b/tools/ui/node_modules/es-toolkit/compat/once.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ae057a1044fb7737a3470e9734970816ef76d737 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/once.d.ts @@ -0,0 +1 @@ +export { once as default } from '../dist/function/once.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/once.js b/tools/ui/node_modules/es-toolkit/compat/once.js new file mode 100644 index 0000000000000000000000000000000000000000..f8e9b760bf1627e887ad2ec30cc1e72c16c9e870 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/once.js @@ -0,0 +1 @@ +module.exports = require('../dist/function/once.js').once; diff --git a/tools/ui/node_modules/es-toolkit/compat/orderBy.d.ts b/tools/ui/node_modules/es-toolkit/compat/orderBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc3dac3419ac8761184de829fb5b0d04e8936627 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/orderBy.d.ts @@ -0,0 +1 @@ +export { orderBy as default } from '../dist/compat/array/orderBy.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/orderBy.js b/tools/ui/node_modules/es-toolkit/compat/orderBy.js new file mode 100644 index 0000000000000000000000000000000000000000..1586f48615c7a7c641514753fb6f18a064b2b3d4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/orderBy.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/orderBy.js').orderBy; diff --git a/tools/ui/node_modules/es-toolkit/compat/over.d.ts b/tools/ui/node_modules/es-toolkit/compat/over.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..40b9a1c4058ecaf3f95d81059d6a5d9e75d89285 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/over.d.ts @@ -0,0 +1 @@ +export { over as default } from '../dist/compat/util/over.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/over.js b/tools/ui/node_modules/es-toolkit/compat/over.js new file mode 100644 index 0000000000000000000000000000000000000000..29f30bcbb9820f7a03602b44ca48360647b447dc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/over.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/over.js').over; diff --git a/tools/ui/node_modules/es-toolkit/compat/overArgs.d.ts b/tools/ui/node_modules/es-toolkit/compat/overArgs.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6abaf97de36c9a6b6d1f4f311717507d4c7cf3d5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/overArgs.d.ts @@ -0,0 +1 @@ +export { overArgs as default } from '../dist/compat/function/overArgs.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/overArgs.js b/tools/ui/node_modules/es-toolkit/compat/overArgs.js new file mode 100644 index 0000000000000000000000000000000000000000..95faee1196d64949d18f65988bf3f0305727b509 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/overArgs.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/function/overArgs.js').overArgs; diff --git a/tools/ui/node_modules/es-toolkit/compat/overEvery.d.ts b/tools/ui/node_modules/es-toolkit/compat/overEvery.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6a9919ab723a2ea60d735066606870c051418965 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/overEvery.d.ts @@ -0,0 +1 @@ +export { overEvery as default } from '../dist/compat/util/overEvery.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/overEvery.js b/tools/ui/node_modules/es-toolkit/compat/overEvery.js new file mode 100644 index 0000000000000000000000000000000000000000..42c32f41f1fb6194755e85dcdec53736b637278a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/overEvery.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/overEvery.js').overEvery; diff --git a/tools/ui/node_modules/es-toolkit/compat/overSome.d.ts b/tools/ui/node_modules/es-toolkit/compat/overSome.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d43a266cf65a9063dc22e28a6549cb0e8ff13f30 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/overSome.d.ts @@ -0,0 +1 @@ +export { overSome as default } from '../dist/compat/util/overSome.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/overSome.js b/tools/ui/node_modules/es-toolkit/compat/overSome.js new file mode 100644 index 0000000000000000000000000000000000000000..d9bae69204fd511be726189e128e2d6bd14c4901 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/overSome.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/overSome.js').overSome; diff --git a/tools/ui/node_modules/es-toolkit/compat/pad.d.ts b/tools/ui/node_modules/es-toolkit/compat/pad.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2cbe7b038918d5d41402ad14efec96af064bac24 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/pad.d.ts @@ -0,0 +1 @@ +export { pad as default } from '../dist/compat/string/pad.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/pad.js b/tools/ui/node_modules/es-toolkit/compat/pad.js new file mode 100644 index 0000000000000000000000000000000000000000..459dd97c2b88e605192c3844aa4295b755cf71d3 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/pad.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/pad.js').pad; diff --git a/tools/ui/node_modules/es-toolkit/compat/padEnd.d.ts b/tools/ui/node_modules/es-toolkit/compat/padEnd.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..132d7b08ce951c245394602426b54127c53428ab --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/padEnd.d.ts @@ -0,0 +1 @@ +export { padEnd as default } from '../dist/compat/string/padEnd.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/padEnd.js b/tools/ui/node_modules/es-toolkit/compat/padEnd.js new file mode 100644 index 0000000000000000000000000000000000000000..14baa9bffc700f5a2a46069a9b9617b56dbe22a8 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/padEnd.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/padEnd.js').padEnd; diff --git a/tools/ui/node_modules/es-toolkit/compat/padStart.d.ts b/tools/ui/node_modules/es-toolkit/compat/padStart.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f5cb9f079812aa51f27bf3a4f0fbdafae9865e84 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/padStart.d.ts @@ -0,0 +1 @@ +export { padStart as default } from '../dist/compat/string/padStart.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/padStart.js b/tools/ui/node_modules/es-toolkit/compat/padStart.js new file mode 100644 index 0000000000000000000000000000000000000000..2653e7bee9b1543bad30f443c204de5e54fc94db --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/padStart.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/padStart.js').padStart; diff --git a/tools/ui/node_modules/es-toolkit/compat/parseInt.d.ts b/tools/ui/node_modules/es-toolkit/compat/parseInt.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bb69bbcfb64b245fb19c5ab523fd668fc71630d9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/parseInt.d.ts @@ -0,0 +1 @@ +export { parseInt as default } from '../dist/compat/math/parseInt.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/parseInt.js b/tools/ui/node_modules/es-toolkit/compat/parseInt.js new file mode 100644 index 0000000000000000000000000000000000000000..9dd14281fcb8bbdbad20fe822cc71d2768e66456 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/parseInt.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/math/parseInt.js').parseInt; diff --git a/tools/ui/node_modules/es-toolkit/compat/partial.d.ts b/tools/ui/node_modules/es-toolkit/compat/partial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c2d3c66c9dd33ac5d1877ebd27b0f33bef0d429a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/partial.d.ts @@ -0,0 +1 @@ +export { partial as default } from '../dist/compat/function/partial.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/partial.js b/tools/ui/node_modules/es-toolkit/compat/partial.js new file mode 100644 index 0000000000000000000000000000000000000000..87a33d1ef6ecbb6dd2e8dd83704f471a85577c1c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/partial.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/function/partial.js').partial; diff --git a/tools/ui/node_modules/es-toolkit/compat/partialRight.d.ts b/tools/ui/node_modules/es-toolkit/compat/partialRight.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..428c6f1417cd60cef2ac492670443ee7595b9276 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/partialRight.d.ts @@ -0,0 +1 @@ +export { partialRight as default } from '../dist/compat/function/partialRight.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/partialRight.js b/tools/ui/node_modules/es-toolkit/compat/partialRight.js new file mode 100644 index 0000000000000000000000000000000000000000..2581d82ad9c3af25cb0468f06be77713b5e693a2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/partialRight.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/function/partialRight.js').partialRight; diff --git a/tools/ui/node_modules/es-toolkit/compat/partition.d.ts b/tools/ui/node_modules/es-toolkit/compat/partition.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7d70e2e2b92aefa442974ecfd7e5d201597f6a2a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/partition.d.ts @@ -0,0 +1 @@ +export { partition as default } from '../dist/compat/array/partition.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/partition.js b/tools/ui/node_modules/es-toolkit/compat/partition.js new file mode 100644 index 0000000000000000000000000000000000000000..a0485755e7f47dd2033253d729c45be009c63954 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/partition.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/partition.js').partition; diff --git a/tools/ui/node_modules/es-toolkit/compat/pick.d.ts b/tools/ui/node_modules/es-toolkit/compat/pick.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..96990ad7c4663be7034c57f18260b78097ec9099 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/pick.d.ts @@ -0,0 +1 @@ +export { pick as default } from '../dist/compat/object/pick.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/pick.js b/tools/ui/node_modules/es-toolkit/compat/pick.js new file mode 100644 index 0000000000000000000000000000000000000000..cbce86b8ca397e667bc3142e384796aef23c88db --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/pick.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/pick.js').pick; diff --git a/tools/ui/node_modules/es-toolkit/compat/pickBy.d.ts b/tools/ui/node_modules/es-toolkit/compat/pickBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..87aed15b886bc8efb9c11cbbc19d40750458009b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/pickBy.d.ts @@ -0,0 +1 @@ +export { pickBy as default } from '../dist/compat/object/pickBy.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/pickBy.js b/tools/ui/node_modules/es-toolkit/compat/pickBy.js new file mode 100644 index 0000000000000000000000000000000000000000..37844ad4973a6caac1297cf8f8e9682290822fb1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/pickBy.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/pickBy.js').pickBy; diff --git a/tools/ui/node_modules/es-toolkit/compat/property.d.ts b/tools/ui/node_modules/es-toolkit/compat/property.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..92bcf62907a6ddbf0c56477f31dd1eab83bab4a4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/property.d.ts @@ -0,0 +1 @@ +export { property as default } from '../dist/compat/object/property.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/property.js b/tools/ui/node_modules/es-toolkit/compat/property.js new file mode 100644 index 0000000000000000000000000000000000000000..097969176ea9f3823fd3392b07b0cc434e467067 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/property.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/property.js').property; diff --git a/tools/ui/node_modules/es-toolkit/compat/propertyOf.d.ts b/tools/ui/node_modules/es-toolkit/compat/propertyOf.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9399176bc9b98bf2f4765dfdfe8eab899b49fcb7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/propertyOf.d.ts @@ -0,0 +1 @@ +export { propertyOf as default } from '../dist/compat/object/propertyOf.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/propertyOf.js b/tools/ui/node_modules/es-toolkit/compat/propertyOf.js new file mode 100644 index 0000000000000000000000000000000000000000..cec80005539702946ee799de5a5cbfb85296acf4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/propertyOf.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/propertyOf.js').propertyOf; diff --git a/tools/ui/node_modules/es-toolkit/compat/pull.d.ts b/tools/ui/node_modules/es-toolkit/compat/pull.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..513e14ffecaa0638e55ef65bf2ac8a0f14b80ef3 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/pull.d.ts @@ -0,0 +1 @@ +export { pull as default } from '../dist/compat/array/pull.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/pull.js b/tools/ui/node_modules/es-toolkit/compat/pull.js new file mode 100644 index 0000000000000000000000000000000000000000..6d7b5626f1bac72fc66b7e68532d7606f252eb27 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/pull.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/pull.js').pull; diff --git a/tools/ui/node_modules/es-toolkit/compat/pullAll.d.ts b/tools/ui/node_modules/es-toolkit/compat/pullAll.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f782bb83b3a7c255e11d276ac4d0821170b2d301 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/pullAll.d.ts @@ -0,0 +1 @@ +export { pullAll as default } from '../dist/compat/array/pullAll.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/pullAll.js b/tools/ui/node_modules/es-toolkit/compat/pullAll.js new file mode 100644 index 0000000000000000000000000000000000000000..74b7119cec2c7d8ef2cf59a3f4beadee0b62121f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/pullAll.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/pullAll.js').pullAll; diff --git a/tools/ui/node_modules/es-toolkit/compat/pullAllBy.d.ts b/tools/ui/node_modules/es-toolkit/compat/pullAllBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7c5f977137b1b0cb0ac8623df6d03a24b4756fb0 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/pullAllBy.d.ts @@ -0,0 +1 @@ +export { pullAllBy as default } from '../dist/compat/array/pullAllBy.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/pullAllBy.js b/tools/ui/node_modules/es-toolkit/compat/pullAllBy.js new file mode 100644 index 0000000000000000000000000000000000000000..67cbbc50fc5d15c74f609ccce3323e3ed76bdf11 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/pullAllBy.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/pullAllBy.js').pullAllBy; diff --git a/tools/ui/node_modules/es-toolkit/compat/pullAllWith.d.ts b/tools/ui/node_modules/es-toolkit/compat/pullAllWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..405f773d6c541e5e884eb22c78a53f6dbbb7c5cd --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/pullAllWith.d.ts @@ -0,0 +1 @@ +export { pullAllWith as default } from '../dist/compat/array/pullAllWith.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/pullAllWith.js b/tools/ui/node_modules/es-toolkit/compat/pullAllWith.js new file mode 100644 index 0000000000000000000000000000000000000000..21f2d67c8b297bf23922f1536f963e61eb7e9cdf --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/pullAllWith.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/pullAllWith.js').pullAllWith; diff --git a/tools/ui/node_modules/es-toolkit/compat/pullAt.d.ts b/tools/ui/node_modules/es-toolkit/compat/pullAt.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3e89b0e1973ee2fba53f7c8ffe6ac6717c8cc7b4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/pullAt.d.ts @@ -0,0 +1 @@ +export { pullAt as default } from '../dist/compat/array/pullAt.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/pullAt.js b/tools/ui/node_modules/es-toolkit/compat/pullAt.js new file mode 100644 index 0000000000000000000000000000000000000000..165f5609d9799ebc1b3d281c45c4b8367477c00a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/pullAt.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/pullAt.js').pullAt; diff --git a/tools/ui/node_modules/es-toolkit/compat/random.d.ts b/tools/ui/node_modules/es-toolkit/compat/random.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bd03d9deb7e5d0895bd18283ecbcc2d3865101dc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/random.d.ts @@ -0,0 +1 @@ +export { random as default } from '../dist/compat/math/random.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/random.js b/tools/ui/node_modules/es-toolkit/compat/random.js new file mode 100644 index 0000000000000000000000000000000000000000..0311ff2f1a5d2d75aa8102ce7d517836b67116d7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/random.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/math/random.js').random; diff --git a/tools/ui/node_modules/es-toolkit/compat/range.d.ts b/tools/ui/node_modules/es-toolkit/compat/range.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..57c0bf060a14913803bc896a5a6903d62cd20fae --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/range.d.ts @@ -0,0 +1 @@ +export { range as default } from '../dist/compat/math/range.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/range.js b/tools/ui/node_modules/es-toolkit/compat/range.js new file mode 100644 index 0000000000000000000000000000000000000000..11df1306a38cfd38dd3a2fe8582732a59d90a7d7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/range.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/math/range.js').range; diff --git a/tools/ui/node_modules/es-toolkit/compat/rangeRight.d.ts b/tools/ui/node_modules/es-toolkit/compat/rangeRight.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..beb5a7cce9ce6fb361e8846e1ae25e5be7a92607 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/rangeRight.d.ts @@ -0,0 +1 @@ +export { rangeRight as default } from '../dist/compat/math/rangeRight.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/rangeRight.js b/tools/ui/node_modules/es-toolkit/compat/rangeRight.js new file mode 100644 index 0000000000000000000000000000000000000000..e78efb8323dc8bb8a322ab78e0d8443edd4ac0c0 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/rangeRight.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/math/rangeRight.js').rangeRight; diff --git a/tools/ui/node_modules/es-toolkit/compat/rearg.d.ts b/tools/ui/node_modules/es-toolkit/compat/rearg.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3da0599e35ccc57e88d4fc9bfe1c6e6600a467a7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/rearg.d.ts @@ -0,0 +1 @@ +export { rearg as default } from '../dist/compat/function/rearg.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/rearg.js b/tools/ui/node_modules/es-toolkit/compat/rearg.js new file mode 100644 index 0000000000000000000000000000000000000000..4e626c528714eed8125fe82f99326c63a97d164f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/rearg.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/function/rearg.js').rearg; diff --git a/tools/ui/node_modules/es-toolkit/compat/reduce.d.ts b/tools/ui/node_modules/es-toolkit/compat/reduce.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..18af9640e3fb712b1bbf88cc8211c067038be578 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/reduce.d.ts @@ -0,0 +1 @@ +export { reduce as default } from '../dist/compat/array/reduce.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/reduce.js b/tools/ui/node_modules/es-toolkit/compat/reduce.js new file mode 100644 index 0000000000000000000000000000000000000000..3efd4e7f9fab40b707cd042118bd530c495de1e9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/reduce.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/reduce.js').reduce; diff --git a/tools/ui/node_modules/es-toolkit/compat/reduceRight.d.ts b/tools/ui/node_modules/es-toolkit/compat/reduceRight.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bf94a64c62795398d5ecd26368945b895468b366 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/reduceRight.d.ts @@ -0,0 +1 @@ +export { reduceRight as default } from '../dist/compat/array/reduceRight.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/reduceRight.js b/tools/ui/node_modules/es-toolkit/compat/reduceRight.js new file mode 100644 index 0000000000000000000000000000000000000000..a4ac52958d48f7b0569770c9815f25c087de84eb --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/reduceRight.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/reduceRight.js').reduceRight; diff --git a/tools/ui/node_modules/es-toolkit/compat/reject.d.ts b/tools/ui/node_modules/es-toolkit/compat/reject.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c04da12f6da1a330331319b2f1e8a5cc1964927b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/reject.d.ts @@ -0,0 +1 @@ +export { reject as default } from '../dist/compat/array/reject.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/reject.js b/tools/ui/node_modules/es-toolkit/compat/reject.js new file mode 100644 index 0000000000000000000000000000000000000000..d70874d995279292a35bacb9a88b7babe45b54c7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/reject.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/reject.js').reject; diff --git a/tools/ui/node_modules/es-toolkit/compat/remove.d.ts b/tools/ui/node_modules/es-toolkit/compat/remove.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..064fa3f3e750cd5639a0b4a79fcbea66d75e0eb5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/remove.d.ts @@ -0,0 +1 @@ +export { remove as default } from '../dist/compat/array/remove.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/remove.js b/tools/ui/node_modules/es-toolkit/compat/remove.js new file mode 100644 index 0000000000000000000000000000000000000000..dbf3a154c0a6641d9f2de2267eed07dcd7f9a2c2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/remove.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/remove.js').remove; diff --git a/tools/ui/node_modules/es-toolkit/compat/repeat.d.ts b/tools/ui/node_modules/es-toolkit/compat/repeat.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e29fe3a5bcd92273b051f7a6a16633dbdbbdd274 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/repeat.d.ts @@ -0,0 +1 @@ +export { repeat as default } from '../dist/compat/string/repeat.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/repeat.js b/tools/ui/node_modules/es-toolkit/compat/repeat.js new file mode 100644 index 0000000000000000000000000000000000000000..455a103aff1c04d7c559da96a31cd889f74a8b01 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/repeat.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/repeat.js').repeat; diff --git a/tools/ui/node_modules/es-toolkit/compat/replace.d.ts b/tools/ui/node_modules/es-toolkit/compat/replace.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a47c96ced7ebca7f13c937b1a43e03f0282f475f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/replace.d.ts @@ -0,0 +1 @@ +export { replace as default } from '../dist/compat/string/replace.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/replace.js b/tools/ui/node_modules/es-toolkit/compat/replace.js new file mode 100644 index 0000000000000000000000000000000000000000..cb7b35633db17400d0160a5e6ae506e98c5be0e7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/replace.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/replace.js').replace; diff --git a/tools/ui/node_modules/es-toolkit/compat/rest.d.ts b/tools/ui/node_modules/es-toolkit/compat/rest.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c862f952f0181f021dc8e55a3df5ea42b39e4999 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/rest.d.ts @@ -0,0 +1 @@ +export { rest as default } from '../dist/compat/function/rest.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/rest.js b/tools/ui/node_modules/es-toolkit/compat/rest.js new file mode 100644 index 0000000000000000000000000000000000000000..f306f6a34db94c70a1f62bd3dbc23c4bca5edff6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/rest.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/function/rest.js').rest; diff --git a/tools/ui/node_modules/es-toolkit/compat/result.d.ts b/tools/ui/node_modules/es-toolkit/compat/result.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3a974e11bc012a0aa463db738caccc8b2e74ccd6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/result.d.ts @@ -0,0 +1 @@ +export { result as default } from '../dist/compat/object/result.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/result.js b/tools/ui/node_modules/es-toolkit/compat/result.js new file mode 100644 index 0000000000000000000000000000000000000000..257a89f64ef45ca77b425f668923573c014cd177 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/result.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/result.js').result; diff --git a/tools/ui/node_modules/es-toolkit/compat/reverse.d.ts b/tools/ui/node_modules/es-toolkit/compat/reverse.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..72980fa5c1f03adfb608d72cba83b2ea9e047e6a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/reverse.d.ts @@ -0,0 +1 @@ +export { reverse as default } from '../dist/compat/array/reverse.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/reverse.js b/tools/ui/node_modules/es-toolkit/compat/reverse.js new file mode 100644 index 0000000000000000000000000000000000000000..d4bcc9048a938d6a2cdbeb6eaf82a4f9b2e5eeb9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/reverse.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/reverse.js').reverse; diff --git a/tools/ui/node_modules/es-toolkit/compat/round.d.ts b/tools/ui/node_modules/es-toolkit/compat/round.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bc3ffc2a5d3f16602804afcaef08947315ae429a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/round.d.ts @@ -0,0 +1 @@ +export { round as default } from '../dist/compat/math/round.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/round.js b/tools/ui/node_modules/es-toolkit/compat/round.js new file mode 100644 index 0000000000000000000000000000000000000000..a6771377844fe34bbf18c1a7dfaaddd2100cac55 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/round.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/math/round.js').round; diff --git a/tools/ui/node_modules/es-toolkit/compat/sample.d.ts b/tools/ui/node_modules/es-toolkit/compat/sample.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..982693f7a955455a0214b748ecc8099fa8cd21d9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sample.d.ts @@ -0,0 +1 @@ +export { sample as default } from '../dist/compat/array/sample.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/sample.js b/tools/ui/node_modules/es-toolkit/compat/sample.js new file mode 100644 index 0000000000000000000000000000000000000000..303d021cf3d139433f376bd51d15a9ba36688ead --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sample.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/sample.js').sample; diff --git a/tools/ui/node_modules/es-toolkit/compat/sampleSize.d.ts b/tools/ui/node_modules/es-toolkit/compat/sampleSize.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c72b45e4be098a0f07cbede53c20dc44d4e5b469 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sampleSize.d.ts @@ -0,0 +1 @@ +export { sampleSize as default } from '../dist/compat/array/sampleSize.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/sampleSize.js b/tools/ui/node_modules/es-toolkit/compat/sampleSize.js new file mode 100644 index 0000000000000000000000000000000000000000..3d7cb5d405e24b6c1fde70d1e99f7f2337dc898e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sampleSize.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/sampleSize.js').sampleSize; diff --git a/tools/ui/node_modules/es-toolkit/compat/set.d.ts b/tools/ui/node_modules/es-toolkit/compat/set.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2331a9d99f81dacd8a2380a5d653d8a501dcbb8e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/set.d.ts @@ -0,0 +1 @@ +export { set as default } from '../dist/compat/object/set.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/set.js b/tools/ui/node_modules/es-toolkit/compat/set.js new file mode 100644 index 0000000000000000000000000000000000000000..d81682b5aeb5d1641d53c0d8124a7a6daad753c1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/set.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/set.js').set; diff --git a/tools/ui/node_modules/es-toolkit/compat/setWith.d.ts b/tools/ui/node_modules/es-toolkit/compat/setWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f48f1149dada894057e1817b47f4cf471cc37670 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/setWith.d.ts @@ -0,0 +1 @@ +export { setWith as default } from '../dist/compat/object/setWith.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/setWith.js b/tools/ui/node_modules/es-toolkit/compat/setWith.js new file mode 100644 index 0000000000000000000000000000000000000000..40c536ec14554f96af7c645082970d1ee8ee067b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/setWith.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/setWith.js').setWith; diff --git a/tools/ui/node_modules/es-toolkit/compat/shuffle.d.ts b/tools/ui/node_modules/es-toolkit/compat/shuffle.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7b0a941553c9b89755e3bf3b513858a9e9ad1d5d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/shuffle.d.ts @@ -0,0 +1 @@ +export { shuffle as default } from '../dist/compat/array/shuffle.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/shuffle.js b/tools/ui/node_modules/es-toolkit/compat/shuffle.js new file mode 100644 index 0000000000000000000000000000000000000000..2f8edfd64e97796ba75b56bbe568c17b643ebd2c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/shuffle.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/shuffle.js').shuffle; diff --git a/tools/ui/node_modules/es-toolkit/compat/size.d.ts b/tools/ui/node_modules/es-toolkit/compat/size.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9ff6f608cefde963d861301920fd3ecbab75cbcc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/size.d.ts @@ -0,0 +1 @@ +export { size as default } from '../dist/compat/array/size.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/size.js b/tools/ui/node_modules/es-toolkit/compat/size.js new file mode 100644 index 0000000000000000000000000000000000000000..37d2a7419c8f8dd488dc012df27946a02275e786 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/size.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/size.js').size; diff --git a/tools/ui/node_modules/es-toolkit/compat/slice.d.ts b/tools/ui/node_modules/es-toolkit/compat/slice.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f93c7b93099c579ed991246d06ee8248abd8e975 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/slice.d.ts @@ -0,0 +1 @@ +export { slice as default } from '../dist/compat/array/slice.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/slice.js b/tools/ui/node_modules/es-toolkit/compat/slice.js new file mode 100644 index 0000000000000000000000000000000000000000..43f7c0cc617f2f7531cd76065a94e8c903344e4e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/slice.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/slice.js').slice; diff --git a/tools/ui/node_modules/es-toolkit/compat/snakeCase.d.ts b/tools/ui/node_modules/es-toolkit/compat/snakeCase.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6ae9fd1dec28a292431f0a2f1e67a9882d419a35 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/snakeCase.d.ts @@ -0,0 +1 @@ +export { snakeCase as default } from '../dist/compat/string/snakeCase.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/snakeCase.js b/tools/ui/node_modules/es-toolkit/compat/snakeCase.js new file mode 100644 index 0000000000000000000000000000000000000000..e68134877f361cd9955338a6f2db5e6f979d73ba --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/snakeCase.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/snakeCase.js').snakeCase; diff --git a/tools/ui/node_modules/es-toolkit/compat/some.d.ts b/tools/ui/node_modules/es-toolkit/compat/some.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cd7a126aa6e79b8613c5f37d0fcd77c919bce671 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/some.d.ts @@ -0,0 +1 @@ +export { some as default } from '../dist/compat/array/some.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/some.js b/tools/ui/node_modules/es-toolkit/compat/some.js new file mode 100644 index 0000000000000000000000000000000000000000..2fd9a06cd3201e803ae2c0dc854082bb72857b53 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/some.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/some.js').some; diff --git a/tools/ui/node_modules/es-toolkit/compat/sortBy.d.ts b/tools/ui/node_modules/es-toolkit/compat/sortBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..19bb251c66e55f668e3405615571f0dd07e18e52 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sortBy.d.ts @@ -0,0 +1 @@ +export { sortBy as default } from '../dist/compat/array/sortBy.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/sortBy.js b/tools/ui/node_modules/es-toolkit/compat/sortBy.js new file mode 100644 index 0000000000000000000000000000000000000000..c7b8c8c80196f61ca6685b4591af07f7a0ee1444 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sortBy.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/sortBy.js').sortBy; diff --git a/tools/ui/node_modules/es-toolkit/compat/sortedIndex.d.ts b/tools/ui/node_modules/es-toolkit/compat/sortedIndex.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2977e1e7a9592e98ac6fa62ebc3cba39ee85ae80 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sortedIndex.d.ts @@ -0,0 +1 @@ +export { sortedIndex as default } from '../dist/compat/array/sortedIndex.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/sortedIndex.js b/tools/ui/node_modules/es-toolkit/compat/sortedIndex.js new file mode 100644 index 0000000000000000000000000000000000000000..a24030df05f328c1cd8824e4eb3bee398bb83f9f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sortedIndex.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/sortedIndex.js').sortedIndex; diff --git a/tools/ui/node_modules/es-toolkit/compat/sortedIndexBy.d.ts b/tools/ui/node_modules/es-toolkit/compat/sortedIndexBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d74ccf4849f12c315cbfbe95cfda38ada7a583aa --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sortedIndexBy.d.ts @@ -0,0 +1 @@ +export { sortedIndexBy as default } from '../dist/compat/array/sortedIndexBy.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/sortedIndexBy.js b/tools/ui/node_modules/es-toolkit/compat/sortedIndexBy.js new file mode 100644 index 0000000000000000000000000000000000000000..1417ca16239214fd4d405c51eb5c3d12764688b1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sortedIndexBy.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/sortedIndexBy.js').sortedIndexBy; diff --git a/tools/ui/node_modules/es-toolkit/compat/sortedIndexOf.d.ts b/tools/ui/node_modules/es-toolkit/compat/sortedIndexOf.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..695468b94ebb1f6724494f570d8a38c85119d3ee --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sortedIndexOf.d.ts @@ -0,0 +1 @@ +export { sortedIndexOf as default } from '../dist/compat/array/sortedIndexOf.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/sortedIndexOf.js b/tools/ui/node_modules/es-toolkit/compat/sortedIndexOf.js new file mode 100644 index 0000000000000000000000000000000000000000..89784a9ff007b3a36293dea8cc787ebdc28b4e6b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sortedIndexOf.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/sortedIndexOf.js').sortedIndexOf; diff --git a/tools/ui/node_modules/es-toolkit/compat/sortedLastIndex.d.ts b/tools/ui/node_modules/es-toolkit/compat/sortedLastIndex.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..59c4ee050d79a021f6cde743fc55b351615dd43a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sortedLastIndex.d.ts @@ -0,0 +1 @@ +export { sortedLastIndex as default } from '../dist/compat/array/sortedLastIndex.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/sortedLastIndex.js b/tools/ui/node_modules/es-toolkit/compat/sortedLastIndex.js new file mode 100644 index 0000000000000000000000000000000000000000..b0028c33a02bdfc0680467f003828c361c74d3f3 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sortedLastIndex.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/sortedLastIndex.js').sortedLastIndex; diff --git a/tools/ui/node_modules/es-toolkit/compat/sortedLastIndexBy.d.ts b/tools/ui/node_modules/es-toolkit/compat/sortedLastIndexBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7b4d67791c9e73509cb8e1d3a1db1934a722fc0d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sortedLastIndexBy.d.ts @@ -0,0 +1 @@ +export { sortedLastIndexBy as default } from '../dist/compat/array/sortedLastIndexBy.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/sortedLastIndexBy.js b/tools/ui/node_modules/es-toolkit/compat/sortedLastIndexBy.js new file mode 100644 index 0000000000000000000000000000000000000000..d86c26bdfb89a8f8b7a548ec9d8d60e0ff5beb5b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sortedLastIndexBy.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/sortedLastIndexBy.js').sortedLastIndexBy; diff --git a/tools/ui/node_modules/es-toolkit/compat/sortedLastIndexOf.d.ts b/tools/ui/node_modules/es-toolkit/compat/sortedLastIndexOf.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..73a7796186b089e0d5c2e7d06a9eaeebdfb21fc2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sortedLastIndexOf.d.ts @@ -0,0 +1 @@ +export { sortedLastIndexOf as default } from '../dist/compat/array/sortedLastIndexOf.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/sortedLastIndexOf.js b/tools/ui/node_modules/es-toolkit/compat/sortedLastIndexOf.js new file mode 100644 index 0000000000000000000000000000000000000000..3a99b19806f010bdeec01e28b1069c29d3f3b041 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sortedLastIndexOf.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/sortedLastIndexOf.js').sortedLastIndexOf; diff --git a/tools/ui/node_modules/es-toolkit/compat/split.d.ts b/tools/ui/node_modules/es-toolkit/compat/split.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ea83627d2f4b867b18bd677abb1d66b4086fbd97 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/split.d.ts @@ -0,0 +1 @@ +export { split as default } from '../dist/compat/string/split.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/split.js b/tools/ui/node_modules/es-toolkit/compat/split.js new file mode 100644 index 0000000000000000000000000000000000000000..9d23ed3907d97415afe3e04e697fa951db3e5718 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/split.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/split.js').split; diff --git a/tools/ui/node_modules/es-toolkit/compat/spread.d.ts b/tools/ui/node_modules/es-toolkit/compat/spread.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8f4125d909f9a31da1f4d513618acb9e4fce4b60 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/spread.d.ts @@ -0,0 +1 @@ +export { spread as default } from '../dist/compat/function/spread.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/spread.js b/tools/ui/node_modules/es-toolkit/compat/spread.js new file mode 100644 index 0000000000000000000000000000000000000000..9e7d58ec20df5fea323b9c5ddea4cbd202710f65 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/spread.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/function/spread.js').spread; diff --git a/tools/ui/node_modules/es-toolkit/compat/startCase.d.ts b/tools/ui/node_modules/es-toolkit/compat/startCase.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0a0ff2eb092ec877fc9073eaf8b37199d76d04c8 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/startCase.d.ts @@ -0,0 +1 @@ +export { startCase as default } from '../dist/compat/string/startCase.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/startCase.js b/tools/ui/node_modules/es-toolkit/compat/startCase.js new file mode 100644 index 0000000000000000000000000000000000000000..4a4f6da959dca0298bd0fa6ae1b6d803456dfe48 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/startCase.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/startCase.js').startCase; diff --git a/tools/ui/node_modules/es-toolkit/compat/startsWith.d.ts b/tools/ui/node_modules/es-toolkit/compat/startsWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..045ba5a23b3d1bb6ecdbd59ffa0ed794e39d3b37 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/startsWith.d.ts @@ -0,0 +1 @@ +export { startsWith as default } from '../dist/compat/string/startsWith.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/startsWith.js b/tools/ui/node_modules/es-toolkit/compat/startsWith.js new file mode 100644 index 0000000000000000000000000000000000000000..955b1c9da1d0787208545b7ecaa026bdbcef9872 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/startsWith.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/startsWith.js').startsWith; diff --git a/tools/ui/node_modules/es-toolkit/compat/stubArray.d.ts b/tools/ui/node_modules/es-toolkit/compat/stubArray.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2ca7bfc6d82a4c877cefa9cde1a5fe89c864b563 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/stubArray.d.ts @@ -0,0 +1 @@ +export { stubArray as default } from '../dist/compat/util/stubArray.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/stubArray.js b/tools/ui/node_modules/es-toolkit/compat/stubArray.js new file mode 100644 index 0000000000000000000000000000000000000000..c7ab651ee61b4fca8c11690eb4a01113a3309bbd --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/stubArray.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/stubArray.js').stubArray; diff --git a/tools/ui/node_modules/es-toolkit/compat/stubFalse.d.ts b/tools/ui/node_modules/es-toolkit/compat/stubFalse.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..34d79bf9cfc8d9b3c39514cf350138754f6ad85a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/stubFalse.d.ts @@ -0,0 +1 @@ +export { stubFalse as default } from '../dist/compat/util/stubFalse.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/stubFalse.js b/tools/ui/node_modules/es-toolkit/compat/stubFalse.js new file mode 100644 index 0000000000000000000000000000000000000000..e8729a92ed713cf61893ce23d9840793939ddab9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/stubFalse.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/stubFalse.js').stubFalse; diff --git a/tools/ui/node_modules/es-toolkit/compat/stubObject.d.ts b/tools/ui/node_modules/es-toolkit/compat/stubObject.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7f7022a7e9f355af15c77c05d8e295d2fce31bff --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/stubObject.d.ts @@ -0,0 +1 @@ +export { stubObject as default } from '../dist/compat/util/stubObject.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/stubObject.js b/tools/ui/node_modules/es-toolkit/compat/stubObject.js new file mode 100644 index 0000000000000000000000000000000000000000..e9cfc7ed539ed3aa5218576c94fd01ba69862619 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/stubObject.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/stubObject.js').stubObject; diff --git a/tools/ui/node_modules/es-toolkit/compat/stubString.d.ts b/tools/ui/node_modules/es-toolkit/compat/stubString.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..80d7ed51bcc2bd35885d1296b89f9ece70bcd928 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/stubString.d.ts @@ -0,0 +1 @@ +export { stubString as default } from '../dist/compat/util/stubString.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/stubString.js b/tools/ui/node_modules/es-toolkit/compat/stubString.js new file mode 100644 index 0000000000000000000000000000000000000000..de98be922c11997ffe32641468f0f88f9d5f1c71 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/stubString.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/stubString.js').stubString; diff --git a/tools/ui/node_modules/es-toolkit/compat/stubTrue.d.ts b/tools/ui/node_modules/es-toolkit/compat/stubTrue.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dac1d68ebf5ae08151e0a9fdc9ec4934cf980aac --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/stubTrue.d.ts @@ -0,0 +1 @@ +export { stubTrue as default } from '../dist/compat/util/stubTrue.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/stubTrue.js b/tools/ui/node_modules/es-toolkit/compat/stubTrue.js new file mode 100644 index 0000000000000000000000000000000000000000..283b3b2cb3a9d484d0806156479df07e44f37d6f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/stubTrue.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/stubTrue.js').stubTrue; diff --git a/tools/ui/node_modules/es-toolkit/compat/subtract.d.ts b/tools/ui/node_modules/es-toolkit/compat/subtract.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f7d1288c1f568ad4ea1adb66fae55fb48edb9a76 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/subtract.d.ts @@ -0,0 +1 @@ +export { subtract as default } from '../dist/compat/math/subtract.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/subtract.js b/tools/ui/node_modules/es-toolkit/compat/subtract.js new file mode 100644 index 0000000000000000000000000000000000000000..797b728f1ee70740f0d588c5f175ec2f75524c21 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/subtract.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/math/subtract.js').subtract; diff --git a/tools/ui/node_modules/es-toolkit/compat/sum.d.ts b/tools/ui/node_modules/es-toolkit/compat/sum.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..986fe02a7ed18cd79fb9c1081ebd6ca6d5db76fc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sum.d.ts @@ -0,0 +1 @@ +export { sum as default } from '../dist/compat/math/sum.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/sum.js b/tools/ui/node_modules/es-toolkit/compat/sum.js new file mode 100644 index 0000000000000000000000000000000000000000..cbabc918a07117faf11e9a6f91d1f3b6bed8e1b9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sum.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/math/sum.js').sum; diff --git a/tools/ui/node_modules/es-toolkit/compat/sumBy.d.ts b/tools/ui/node_modules/es-toolkit/compat/sumBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..04a679c48b303554fd07e35f7eadb58494ee3bd3 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sumBy.d.ts @@ -0,0 +1 @@ +export { sumBy as default } from '../dist/compat/math/sumBy.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/sumBy.js b/tools/ui/node_modules/es-toolkit/compat/sumBy.js new file mode 100644 index 0000000000000000000000000000000000000000..3bb12d43dfe140f4a728dd6dab929262f6287a72 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/sumBy.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/math/sumBy.js').sumBy; diff --git a/tools/ui/node_modules/es-toolkit/compat/tail.d.ts b/tools/ui/node_modules/es-toolkit/compat/tail.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bb2a11e26d95c262cf3baf2adaf790470939ce48 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/tail.d.ts @@ -0,0 +1 @@ +export { tail as default } from '../dist/compat/array/tail.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/tail.js b/tools/ui/node_modules/es-toolkit/compat/tail.js new file mode 100644 index 0000000000000000000000000000000000000000..857cae49cef69dbd1fa95e1dae74644456620fe3 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/tail.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/tail.js').tail; diff --git a/tools/ui/node_modules/es-toolkit/compat/take.d.ts b/tools/ui/node_modules/es-toolkit/compat/take.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..39eef6dea7f3f546de057b47f77e992cfc8035d1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/take.d.ts @@ -0,0 +1 @@ +export { take as default } from '../dist/compat/array/take.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/take.js b/tools/ui/node_modules/es-toolkit/compat/take.js new file mode 100644 index 0000000000000000000000000000000000000000..e839acfe6b645a4f083ddea61afccbdf2b74b4b7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/take.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/take.js').take; diff --git a/tools/ui/node_modules/es-toolkit/compat/takeRight.d.ts b/tools/ui/node_modules/es-toolkit/compat/takeRight.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..166a8af5d58fe86cd6b98ae1aaea2849d1025435 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/takeRight.d.ts @@ -0,0 +1 @@ +export { takeRight as default } from '../dist/compat/array/takeRight.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/takeRight.js b/tools/ui/node_modules/es-toolkit/compat/takeRight.js new file mode 100644 index 0000000000000000000000000000000000000000..159f9f3a0e922aaf6c9c5fed19516dd8d66cb6fa --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/takeRight.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/takeRight.js').takeRight; diff --git a/tools/ui/node_modules/es-toolkit/compat/takeRightWhile.d.ts b/tools/ui/node_modules/es-toolkit/compat/takeRightWhile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b47c1db94883aa0ac9008dfc06ed68aaf9df7feb --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/takeRightWhile.d.ts @@ -0,0 +1 @@ +export { takeRightWhile as default } from '../dist/compat/array/takeRightWhile.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/takeRightWhile.js b/tools/ui/node_modules/es-toolkit/compat/takeRightWhile.js new file mode 100644 index 0000000000000000000000000000000000000000..d8a8c1e8a51e74e3f75bfad53ca67c3d07a1d377 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/takeRightWhile.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/takeRightWhile.js').takeRightWhile; diff --git a/tools/ui/node_modules/es-toolkit/compat/takeWhile.d.ts b/tools/ui/node_modules/es-toolkit/compat/takeWhile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..286e83b6ef0ed047f8c05d0cca3fb882de1e9322 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/takeWhile.d.ts @@ -0,0 +1 @@ +export { takeWhile as default } from '../dist/compat/array/takeWhile.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/takeWhile.js b/tools/ui/node_modules/es-toolkit/compat/takeWhile.js new file mode 100644 index 0000000000000000000000000000000000000000..77ccab63c3f20e856d4c0ef0f7c4894ede44d7d6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/takeWhile.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/takeWhile.js').takeWhile; diff --git a/tools/ui/node_modules/es-toolkit/compat/template.d.ts b/tools/ui/node_modules/es-toolkit/compat/template.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b9fe5e399253f4a91dfd3d35f698b2c7f57303e0 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/template.d.ts @@ -0,0 +1 @@ +export { template as default } from '../dist/compat/string/template.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/template.js b/tools/ui/node_modules/es-toolkit/compat/template.js new file mode 100644 index 0000000000000000000000000000000000000000..b14c31ea7ca8d2c7504bb04742a86f7f01dea663 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/template.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/template.js').template; diff --git a/tools/ui/node_modules/es-toolkit/compat/templateSettings.d.ts b/tools/ui/node_modules/es-toolkit/compat/templateSettings.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0ef95640dd4069a26355bb177c682e8278f5e796 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/templateSettings.d.ts @@ -0,0 +1 @@ +export { templateSettings as default } from '../dist/compat/string/templateSettings.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/templateSettings.js b/tools/ui/node_modules/es-toolkit/compat/templateSettings.js new file mode 100644 index 0000000000000000000000000000000000000000..358d7129a5a316eca038ffbf57802b667bd10422 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/templateSettings.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/templateSettings.js').templateSettings; diff --git a/tools/ui/node_modules/es-toolkit/compat/throttle.d.ts b/tools/ui/node_modules/es-toolkit/compat/throttle.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d541b24c09c51cbd49b694791fbbc7db73af38a2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/throttle.d.ts @@ -0,0 +1 @@ +export { throttle as default } from '../dist/compat/function/throttle.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/throttle.js b/tools/ui/node_modules/es-toolkit/compat/throttle.js new file mode 100644 index 0000000000000000000000000000000000000000..1bde2c23208facbd449cd506e28f432874ec7abb --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/throttle.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/function/throttle.js').throttle; diff --git a/tools/ui/node_modules/es-toolkit/compat/times.d.ts b/tools/ui/node_modules/es-toolkit/compat/times.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d3ecd94579097f68fee931bc7785f37695a276df --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/times.d.ts @@ -0,0 +1 @@ +export { times as default } from '../dist/compat/util/times.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/times.js b/tools/ui/node_modules/es-toolkit/compat/times.js new file mode 100644 index 0000000000000000000000000000000000000000..6bc05c0aca67377bbc6cec4942fdf8261f6f8525 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/times.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/times.js').times; diff --git a/tools/ui/node_modules/es-toolkit/compat/toArray.d.ts b/tools/ui/node_modules/es-toolkit/compat/toArray.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6d4e0cd46a50c78ce643895cc4584df5336e4102 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toArray.d.ts @@ -0,0 +1 @@ +export { toArray as default } from '../dist/compat/util/toArray.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/toArray.js b/tools/ui/node_modules/es-toolkit/compat/toArray.js new file mode 100644 index 0000000000000000000000000000000000000000..b4a488889607bdc8471d976c27fb84201f6fcfb5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toArray.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/toArray.js').toArray; diff --git a/tools/ui/node_modules/es-toolkit/compat/toDefaulted.d.ts b/tools/ui/node_modules/es-toolkit/compat/toDefaulted.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..428c1202fe91da9d3f04b5519b9838812c0cd0fc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toDefaulted.d.ts @@ -0,0 +1 @@ +export { toDefaulted as default } from '../dist/compat/object/toDefaulted.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/toDefaulted.js b/tools/ui/node_modules/es-toolkit/compat/toDefaulted.js new file mode 100644 index 0000000000000000000000000000000000000000..a68c209ae4785d2f44c6a1e01ac1b4d690e9d7be --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toDefaulted.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/toDefaulted.js').toDefaulted; diff --git a/tools/ui/node_modules/es-toolkit/compat/toFinite.d.ts b/tools/ui/node_modules/es-toolkit/compat/toFinite.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6117405e863baaa7d891ea58619f69580672d4d7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toFinite.d.ts @@ -0,0 +1 @@ +export { toFinite as default } from '../dist/compat/util/toFinite.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/toFinite.js b/tools/ui/node_modules/es-toolkit/compat/toFinite.js new file mode 100644 index 0000000000000000000000000000000000000000..eadf074f591c9226a3e01c0b6107011342d8cc55 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toFinite.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/toFinite.js').toFinite; diff --git a/tools/ui/node_modules/es-toolkit/compat/toInteger.d.ts b/tools/ui/node_modules/es-toolkit/compat/toInteger.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aa2a0214c03bace642c7383e50cd1fd1dd58e4cd --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toInteger.d.ts @@ -0,0 +1 @@ +export { toInteger as default } from '../dist/compat/util/toInteger.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/toInteger.js b/tools/ui/node_modules/es-toolkit/compat/toInteger.js new file mode 100644 index 0000000000000000000000000000000000000000..74b23b1024b846b1be7afbce6237d0306b792453 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toInteger.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/toInteger.js').toInteger; diff --git a/tools/ui/node_modules/es-toolkit/compat/toLength.d.ts b/tools/ui/node_modules/es-toolkit/compat/toLength.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e7de8e6fc095f7548db557bccd2ddc0680ffa133 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toLength.d.ts @@ -0,0 +1 @@ +export { toLength as default } from '../dist/compat/util/toLength.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/toLength.js b/tools/ui/node_modules/es-toolkit/compat/toLength.js new file mode 100644 index 0000000000000000000000000000000000000000..ad7c11de2955d126ca17e4ba32c9567d5bd388e6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toLength.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/toLength.js').toLength; diff --git a/tools/ui/node_modules/es-toolkit/compat/toLower.d.ts b/tools/ui/node_modules/es-toolkit/compat/toLower.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1f3e5df99dd024303bd661c7e21812cc7500e8aa --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toLower.d.ts @@ -0,0 +1 @@ +export { toLower as default } from '../dist/compat/string/toLower.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/toLower.js b/tools/ui/node_modules/es-toolkit/compat/toLower.js new file mode 100644 index 0000000000000000000000000000000000000000..283e933c09f65ee7ff1ffd6592d778b5d2511e6a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toLower.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/toLower.js').toLower; diff --git a/tools/ui/node_modules/es-toolkit/compat/toNumber.d.ts b/tools/ui/node_modules/es-toolkit/compat/toNumber.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..24db69c25f9e9381d49fb12758f20b63fbced45e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toNumber.d.ts @@ -0,0 +1 @@ +export { toNumber as default } from '../dist/compat/util/toNumber.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/toNumber.js b/tools/ui/node_modules/es-toolkit/compat/toNumber.js new file mode 100644 index 0000000000000000000000000000000000000000..483474a0b979a6baea9e1886084f1066a6e3a551 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toNumber.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/toNumber.js').toNumber; diff --git a/tools/ui/node_modules/es-toolkit/compat/toPairs.d.ts b/tools/ui/node_modules/es-toolkit/compat/toPairs.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3feec39e301478bce6fd0d8e86b9816d5f72a4fa --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toPairs.d.ts @@ -0,0 +1 @@ +export { toPairs as default } from '../dist/compat/object/toPairs.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/toPairs.js b/tools/ui/node_modules/es-toolkit/compat/toPairs.js new file mode 100644 index 0000000000000000000000000000000000000000..71b15c2c6383aab8c71401d8d7cd57c6b03c8459 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toPairs.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/toPairs.js').toPairs; diff --git a/tools/ui/node_modules/es-toolkit/compat/toPairsIn.d.ts b/tools/ui/node_modules/es-toolkit/compat/toPairsIn.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c06db4f5524c58eb6c7f6fc06f850ec185d09b5e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toPairsIn.d.ts @@ -0,0 +1 @@ +export { toPairsIn as default } from '../dist/compat/object/toPairsIn.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/toPairsIn.js b/tools/ui/node_modules/es-toolkit/compat/toPairsIn.js new file mode 100644 index 0000000000000000000000000000000000000000..1308fa7b81b3d53bcaa96537d846e06ccc1f7fce --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toPairsIn.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/toPairsIn.js').toPairsIn; diff --git a/tools/ui/node_modules/es-toolkit/compat/toPath.d.ts b/tools/ui/node_modules/es-toolkit/compat/toPath.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..84192bfe9eb554419a144078aa02727a188607eb --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toPath.d.ts @@ -0,0 +1 @@ +export { toPath as default } from '../dist/compat/util/toPath.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/toPath.js b/tools/ui/node_modules/es-toolkit/compat/toPath.js new file mode 100644 index 0000000000000000000000000000000000000000..4dfb79e20dfdb703588d6121dfa1ddeccc2b1601 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toPath.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/toPath.js').toPath; diff --git a/tools/ui/node_modules/es-toolkit/compat/toPlainObject.d.ts b/tools/ui/node_modules/es-toolkit/compat/toPlainObject.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..527bf0540847960104f8ea03d0e50575af698e53 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toPlainObject.d.ts @@ -0,0 +1 @@ +export { toPlainObject as default } from '../dist/compat/util/toPlainObject.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/toPlainObject.js b/tools/ui/node_modules/es-toolkit/compat/toPlainObject.js new file mode 100644 index 0000000000000000000000000000000000000000..7a3b508a32078852580328257c4fac6fabdd2e9b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toPlainObject.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/toPlainObject.js').toPlainObject; diff --git a/tools/ui/node_modules/es-toolkit/compat/toSafeInteger.d.ts b/tools/ui/node_modules/es-toolkit/compat/toSafeInteger.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1ec10a2b89176131cd26a3674af801ba05229bf8 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toSafeInteger.d.ts @@ -0,0 +1 @@ +export { toSafeInteger as default } from '../dist/compat/util/toSafeInteger.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/toSafeInteger.js b/tools/ui/node_modules/es-toolkit/compat/toSafeInteger.js new file mode 100644 index 0000000000000000000000000000000000000000..bdd137ebbdbc2d11ad6ab772de80675074ee93dc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toSafeInteger.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/toSafeInteger.js').toSafeInteger; diff --git a/tools/ui/node_modules/es-toolkit/compat/toString.d.ts b/tools/ui/node_modules/es-toolkit/compat/toString.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ab6ad7cc3c9df6c49f5db9c14389431c6f6ee22a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toString.d.ts @@ -0,0 +1 @@ +export { toString as default } from '../dist/compat/util/toString.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/toString.js b/tools/ui/node_modules/es-toolkit/compat/toString.js new file mode 100644 index 0000000000000000000000000000000000000000..8ec882cd7e01e54871731a06162c38e6bfb18b43 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toString.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/toString.js').toString; diff --git a/tools/ui/node_modules/es-toolkit/compat/toUpper.d.ts b/tools/ui/node_modules/es-toolkit/compat/toUpper.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..13e08814f4a5e32558adb240ec4ce1c4865c04fb --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toUpper.d.ts @@ -0,0 +1 @@ +export { toUpper as default } from '../dist/compat/string/toUpper.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/toUpper.js b/tools/ui/node_modules/es-toolkit/compat/toUpper.js new file mode 100644 index 0000000000000000000000000000000000000000..84d109d68b6293e755cf19f1adb3075414c956f9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/toUpper.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/toUpper.js').toUpper; diff --git a/tools/ui/node_modules/es-toolkit/compat/transform.d.ts b/tools/ui/node_modules/es-toolkit/compat/transform.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..33e10e404182f9def8c8d5ef5fd6f015a201b4d6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/transform.d.ts @@ -0,0 +1 @@ +export { transform as default } from '../dist/compat/object/transform.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/transform.js b/tools/ui/node_modules/es-toolkit/compat/transform.js new file mode 100644 index 0000000000000000000000000000000000000000..b9388aefe2c4804f25cd60bea5c023f2107cb6d2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/transform.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/transform.js').transform; diff --git a/tools/ui/node_modules/es-toolkit/compat/trim.d.ts b/tools/ui/node_modules/es-toolkit/compat/trim.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b81263e613c5c84cee3cbf11d00c551f55b1c5a8 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/trim.d.ts @@ -0,0 +1 @@ +export { trim as default } from '../dist/compat/string/trim.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/trim.js b/tools/ui/node_modules/es-toolkit/compat/trim.js new file mode 100644 index 0000000000000000000000000000000000000000..8888b16ed6af5b618d642829d8e7f20f7a147384 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/trim.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/trim.js').trim; diff --git a/tools/ui/node_modules/es-toolkit/compat/trimEnd.d.ts b/tools/ui/node_modules/es-toolkit/compat/trimEnd.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..16181de64a4b08251f79a77225658da6789eb06e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/trimEnd.d.ts @@ -0,0 +1 @@ +export { trimEnd as default } from '../dist/compat/string/trimEnd.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/trimEnd.js b/tools/ui/node_modules/es-toolkit/compat/trimEnd.js new file mode 100644 index 0000000000000000000000000000000000000000..8fedeaab52f937580330351c5d639d350ffd5f67 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/trimEnd.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/trimEnd.js').trimEnd; diff --git a/tools/ui/node_modules/es-toolkit/compat/trimStart.d.ts b/tools/ui/node_modules/es-toolkit/compat/trimStart.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ceb2b5e39910891d532bcf810b393d5dd7b367ab --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/trimStart.d.ts @@ -0,0 +1 @@ +export { trimStart as default } from '../dist/compat/string/trimStart.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/trimStart.js b/tools/ui/node_modules/es-toolkit/compat/trimStart.js new file mode 100644 index 0000000000000000000000000000000000000000..a1a65f4c0cbd4a2c9df1a8f04d1cafd887227cdb --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/trimStart.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/trimStart.js').trimStart; diff --git a/tools/ui/node_modules/es-toolkit/compat/truncate.d.ts b/tools/ui/node_modules/es-toolkit/compat/truncate.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9302a1caf0a487be455c17cfb796a3d023075f58 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/truncate.d.ts @@ -0,0 +1 @@ +export { truncate as default } from '../dist/compat/string/truncate.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/truncate.js b/tools/ui/node_modules/es-toolkit/compat/truncate.js new file mode 100644 index 0000000000000000000000000000000000000000..0edd2ebd66637821f7cb90e62e53494b4f1fe6ac --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/truncate.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/truncate.js').truncate; diff --git a/tools/ui/node_modules/es-toolkit/compat/unary.d.ts b/tools/ui/node_modules/es-toolkit/compat/unary.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..35b078cd7b793488ce3a9ceca94d4a151ab87aed --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/unary.d.ts @@ -0,0 +1 @@ +export { unary as default } from '../dist/function/unary.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/unary.js b/tools/ui/node_modules/es-toolkit/compat/unary.js new file mode 100644 index 0000000000000000000000000000000000000000..4f101f79fba249c3527202e6b9d6f4217ebd4303 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/unary.js @@ -0,0 +1 @@ +module.exports = require('../dist/function/unary.js').unary; diff --git a/tools/ui/node_modules/es-toolkit/compat/unescape.d.ts b/tools/ui/node_modules/es-toolkit/compat/unescape.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..964a324f01d054640f1ec8fa98aa86fb05648931 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/unescape.d.ts @@ -0,0 +1 @@ +export { unescape as default } from '../dist/compat/string/unescape.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/unescape.js b/tools/ui/node_modules/es-toolkit/compat/unescape.js new file mode 100644 index 0000000000000000000000000000000000000000..334b158328ba8a8099fb203abb578e7b8e506ac4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/unescape.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/unescape.js').unescape; diff --git a/tools/ui/node_modules/es-toolkit/compat/union.d.ts b/tools/ui/node_modules/es-toolkit/compat/union.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ee0ac077321d50ede928b36affcecb7471d43f28 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/union.d.ts @@ -0,0 +1 @@ +export { union as default } from '../dist/compat/array/union.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/union.js b/tools/ui/node_modules/es-toolkit/compat/union.js new file mode 100644 index 0000000000000000000000000000000000000000..23e4423ff0c80df1864f7c6e8ed5917d27458e6c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/union.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/union.js').union; diff --git a/tools/ui/node_modules/es-toolkit/compat/unionBy.d.ts b/tools/ui/node_modules/es-toolkit/compat/unionBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d80ecdfc5826ff3bcc68d5464b9728431b2f7ce1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/unionBy.d.ts @@ -0,0 +1 @@ +export { unionBy as default } from '../dist/compat/array/unionBy.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/unionBy.js b/tools/ui/node_modules/es-toolkit/compat/unionBy.js new file mode 100644 index 0000000000000000000000000000000000000000..59ee26c7d3b557aeb77db1ff57b12309c02848c3 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/unionBy.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/unionBy.js').unionBy; diff --git a/tools/ui/node_modules/es-toolkit/compat/unionWith.d.ts b/tools/ui/node_modules/es-toolkit/compat/unionWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aae589b0ccccd950cd3752f8f4258fea87420ef0 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/unionWith.d.ts @@ -0,0 +1 @@ +export { unionWith as default } from '../dist/compat/array/unionWith.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/unionWith.js b/tools/ui/node_modules/es-toolkit/compat/unionWith.js new file mode 100644 index 0000000000000000000000000000000000000000..7e486ac9b04d7dfc240f62b580d1cc388fda3a83 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/unionWith.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/unionWith.js').unionWith; diff --git a/tools/ui/node_modules/es-toolkit/compat/uniq.d.ts b/tools/ui/node_modules/es-toolkit/compat/uniq.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c614482c40cc8dd2c943fb12903855e6929d2fee --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/uniq.d.ts @@ -0,0 +1 @@ +export { uniq as default } from '../dist/compat/array/uniq.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/uniq.js b/tools/ui/node_modules/es-toolkit/compat/uniq.js new file mode 100644 index 0000000000000000000000000000000000000000..fe9cf67b722ee82f679b2ad9f4194dc18435bd5a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/uniq.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/uniq.js').uniq; diff --git a/tools/ui/node_modules/es-toolkit/compat/uniqBy.d.ts b/tools/ui/node_modules/es-toolkit/compat/uniqBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7e470eb7f44f68602d7d04397a955316f73ece6d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/uniqBy.d.ts @@ -0,0 +1 @@ +export { uniqBy as default } from '../dist/compat/array/uniqBy.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/uniqBy.js b/tools/ui/node_modules/es-toolkit/compat/uniqBy.js new file mode 100644 index 0000000000000000000000000000000000000000..9f1174d0767c1e4fbb653ac05570bd6a59fd0769 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/uniqBy.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/uniqBy.js').uniqBy; diff --git a/tools/ui/node_modules/es-toolkit/compat/uniqWith.d.ts b/tools/ui/node_modules/es-toolkit/compat/uniqWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a0271c1532d21a2cdf372672296c87202c2f678c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/uniqWith.d.ts @@ -0,0 +1 @@ +export { uniqWith as default } from '../dist/compat/array/uniqWith.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/uniqWith.js b/tools/ui/node_modules/es-toolkit/compat/uniqWith.js new file mode 100644 index 0000000000000000000000000000000000000000..158a67ac38091e27bba06887d113c6ea8678b479 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/uniqWith.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/uniqWith.js').uniqWith; diff --git a/tools/ui/node_modules/es-toolkit/compat/uniqueId.d.ts b/tools/ui/node_modules/es-toolkit/compat/uniqueId.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1635f8af10887475b51fc9e3d474fe9dca592165 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/uniqueId.d.ts @@ -0,0 +1 @@ +export { uniqueId as default } from '../dist/compat/util/uniqueId.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/uniqueId.js b/tools/ui/node_modules/es-toolkit/compat/uniqueId.js new file mode 100644 index 0000000000000000000000000000000000000000..71b7525a1c32bcdb3b4a70b3376e4849fa6bf091 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/uniqueId.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/util/uniqueId.js').uniqueId; diff --git a/tools/ui/node_modules/es-toolkit/compat/unset.d.ts b/tools/ui/node_modules/es-toolkit/compat/unset.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b83b5d5e2ecbe8829ffdebc29554cc7851368852 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/unset.d.ts @@ -0,0 +1 @@ +export { unset as default } from '../dist/compat/object/unset.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/unset.js b/tools/ui/node_modules/es-toolkit/compat/unset.js new file mode 100644 index 0000000000000000000000000000000000000000..88e734e8563837db933396570de5df9eca9c3b99 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/unset.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/unset.js').unset; diff --git a/tools/ui/node_modules/es-toolkit/compat/unzip.d.ts b/tools/ui/node_modules/es-toolkit/compat/unzip.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b104cd1bb07d709c632f7222b1b40f9bc032f0e2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/unzip.d.ts @@ -0,0 +1 @@ +export { unzip as default } from '../dist/compat/array/unzip.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/unzip.js b/tools/ui/node_modules/es-toolkit/compat/unzip.js new file mode 100644 index 0000000000000000000000000000000000000000..6ed37e20103ffa2c89e17da0b67425185979e3af --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/unzip.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/unzip.js').unzip; diff --git a/tools/ui/node_modules/es-toolkit/compat/unzipWith.d.ts b/tools/ui/node_modules/es-toolkit/compat/unzipWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bcdbfa98218358c5d0ddc7ffb3814b468c450402 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/unzipWith.d.ts @@ -0,0 +1 @@ +export { unzipWith as default } from '../dist/compat/array/unzipWith.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/unzipWith.js b/tools/ui/node_modules/es-toolkit/compat/unzipWith.js new file mode 100644 index 0000000000000000000000000000000000000000..9fefaba223a096de57dff2f53c9ded82982368d0 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/unzipWith.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/unzipWith.js').unzipWith; diff --git a/tools/ui/node_modules/es-toolkit/compat/update.d.ts b/tools/ui/node_modules/es-toolkit/compat/update.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..01f5ff723a8e4e5fbe1ba1d631a71044f45bf7fc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/update.d.ts @@ -0,0 +1 @@ +export { update as default } from '../dist/compat/object/update.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/update.js b/tools/ui/node_modules/es-toolkit/compat/update.js new file mode 100644 index 0000000000000000000000000000000000000000..96cf555334454a75781864b8b77a2d151b6fca5b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/update.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/update.js').update; diff --git a/tools/ui/node_modules/es-toolkit/compat/updateWith.d.ts b/tools/ui/node_modules/es-toolkit/compat/updateWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ccc99cb59181847b0e02459bb7f7fb67e3f5a671 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/updateWith.d.ts @@ -0,0 +1 @@ +export { updateWith as default } from '../dist/compat/object/updateWith.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/updateWith.js b/tools/ui/node_modules/es-toolkit/compat/updateWith.js new file mode 100644 index 0000000000000000000000000000000000000000..6f43baba38a48fcba880263796786563ef37e0cc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/updateWith.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/updateWith.js').updateWith; diff --git a/tools/ui/node_modules/es-toolkit/compat/upperCase.d.ts b/tools/ui/node_modules/es-toolkit/compat/upperCase.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..67cbbca08836a433fc0704d54a88f34ef30383bc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/upperCase.d.ts @@ -0,0 +1 @@ +export { upperCase as default } from '../dist/compat/string/upperCase.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/upperCase.js b/tools/ui/node_modules/es-toolkit/compat/upperCase.js new file mode 100644 index 0000000000000000000000000000000000000000..bfa4d7f4217ceb17ed26a73adfaf33d765e09183 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/upperCase.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/upperCase.js').upperCase; diff --git a/tools/ui/node_modules/es-toolkit/compat/upperFirst.d.ts b/tools/ui/node_modules/es-toolkit/compat/upperFirst.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a5960330d227b9a47db01c389ae61ff46877e4f8 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/upperFirst.d.ts @@ -0,0 +1 @@ +export { upperFirst as default } from '../dist/compat/string/upperFirst.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/upperFirst.js b/tools/ui/node_modules/es-toolkit/compat/upperFirst.js new file mode 100644 index 0000000000000000000000000000000000000000..f4638223f923e2cbb12fef9790e609e9264a3ea5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/upperFirst.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/upperFirst.js').upperFirst; diff --git a/tools/ui/node_modules/es-toolkit/compat/values.d.ts b/tools/ui/node_modules/es-toolkit/compat/values.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..165db9dc98f6a59aabea27f2a238f4cf5684b088 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/values.d.ts @@ -0,0 +1 @@ +export { values as default } from '../dist/compat/object/values.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/values.js b/tools/ui/node_modules/es-toolkit/compat/values.js new file mode 100644 index 0000000000000000000000000000000000000000..1b7466788c05ddc14ff6d74b60cd7dc5242a6642 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/values.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/values.js').values; diff --git a/tools/ui/node_modules/es-toolkit/compat/valuesIn.d.ts b/tools/ui/node_modules/es-toolkit/compat/valuesIn.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..83134af7d77e4222e4f39e4b373f5e52ed701cb1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/valuesIn.d.ts @@ -0,0 +1 @@ +export { valuesIn as default } from '../dist/compat/object/valuesIn.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/valuesIn.js b/tools/ui/node_modules/es-toolkit/compat/valuesIn.js new file mode 100644 index 0000000000000000000000000000000000000000..ad9dc4cc6de5a2a0aa2f9fa4a3d6f2e0faa2011c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/valuesIn.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/object/valuesIn.js').valuesIn; diff --git a/tools/ui/node_modules/es-toolkit/compat/without.d.ts b/tools/ui/node_modules/es-toolkit/compat/without.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7c6fbeb6c7909506c0757f625425b8903a297396 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/without.d.ts @@ -0,0 +1 @@ +export { without as default } from '../dist/compat/array/without.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/without.js b/tools/ui/node_modules/es-toolkit/compat/without.js new file mode 100644 index 0000000000000000000000000000000000000000..bbc76e076a571f746aab65a5325553291d57b650 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/without.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/without.js').without; diff --git a/tools/ui/node_modules/es-toolkit/compat/words.d.ts b/tools/ui/node_modules/es-toolkit/compat/words.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e9aeaf628ea941f95213c636f227a499e2cbd3ef --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/words.d.ts @@ -0,0 +1 @@ +export { words as default } from '../dist/compat/string/words.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/words.js b/tools/ui/node_modules/es-toolkit/compat/words.js new file mode 100644 index 0000000000000000000000000000000000000000..692d4eea2928a34832fa1b73c0f03f31aa244568 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/words.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/string/words.js').words; diff --git a/tools/ui/node_modules/es-toolkit/compat/wrap.d.ts b/tools/ui/node_modules/es-toolkit/compat/wrap.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3d4ecdba32ff32487cc5f8110958d91f5d75ffc5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/wrap.d.ts @@ -0,0 +1 @@ +export { wrap as default } from '../dist/compat/function/wrap.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/wrap.js b/tools/ui/node_modules/es-toolkit/compat/wrap.js new file mode 100644 index 0000000000000000000000000000000000000000..72186d995f994df9fae416345a33af7cf803ab3d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/wrap.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/function/wrap.js').wrap; diff --git a/tools/ui/node_modules/es-toolkit/compat/xor.d.ts b/tools/ui/node_modules/es-toolkit/compat/xor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0df42f89b4a66c57d29a218ee5b3cbb5423c5542 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/xor.d.ts @@ -0,0 +1 @@ +export { xor as default } from '../dist/compat/array/xor.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/xor.js b/tools/ui/node_modules/es-toolkit/compat/xor.js new file mode 100644 index 0000000000000000000000000000000000000000..b678b10e8ef3a78d2022c9298fe022df9cab75e7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/xor.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/xor.js').xor; diff --git a/tools/ui/node_modules/es-toolkit/compat/xorBy.d.ts b/tools/ui/node_modules/es-toolkit/compat/xorBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b971238c91666f326f1931ded8c2a33db5722b2c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/xorBy.d.ts @@ -0,0 +1 @@ +export { xorBy as default } from '../dist/compat/array/xorBy.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/xorBy.js b/tools/ui/node_modules/es-toolkit/compat/xorBy.js new file mode 100644 index 0000000000000000000000000000000000000000..24e76475be85e3f6ecb0644efe0000ce1acb6706 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/xorBy.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/xorBy.js').xorBy; diff --git a/tools/ui/node_modules/es-toolkit/compat/xorWith.d.ts b/tools/ui/node_modules/es-toolkit/compat/xorWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ae202d54854401f93ee5d3df2d285fcc8ff73c42 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/xorWith.d.ts @@ -0,0 +1 @@ +export { xorWith as default } from '../dist/compat/array/xorWith.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/xorWith.js b/tools/ui/node_modules/es-toolkit/compat/xorWith.js new file mode 100644 index 0000000000000000000000000000000000000000..32bf76f60c766b4468e5e67dcd4df8ae0ead3c1e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/xorWith.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/xorWith.js').xorWith; diff --git a/tools/ui/node_modules/es-toolkit/compat/zip.d.ts b/tools/ui/node_modules/es-toolkit/compat/zip.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6598138a57adf2b2963ed95c914d42df05f6a6d6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/zip.d.ts @@ -0,0 +1 @@ +export { zip as default } from '../dist/compat/array/zip.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/zip.js b/tools/ui/node_modules/es-toolkit/compat/zip.js new file mode 100644 index 0000000000000000000000000000000000000000..d92843311f1e1c463d239bb8abd8361676afe02c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/zip.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/zip.js').zip; diff --git a/tools/ui/node_modules/es-toolkit/compat/zipObject.d.ts b/tools/ui/node_modules/es-toolkit/compat/zipObject.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e9dd14aab93b2a4405518bccfe9b2c4aaaacbbf1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/zipObject.d.ts @@ -0,0 +1 @@ +export { zipObject as default } from '../dist/compat/array/zipObject.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/zipObject.js b/tools/ui/node_modules/es-toolkit/compat/zipObject.js new file mode 100644 index 0000000000000000000000000000000000000000..679828dfa7d54198660d9265cae88ec4ed8cf5a6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/zipObject.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/zipObject.js').zipObject; diff --git a/tools/ui/node_modules/es-toolkit/compat/zipObjectDeep.d.ts b/tools/ui/node_modules/es-toolkit/compat/zipObjectDeep.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0ad24d7112c31d04450c1647505325ce45dde49 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/zipObjectDeep.d.ts @@ -0,0 +1 @@ +export { zipObjectDeep as default } from '../dist/compat/array/zipObjectDeep.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/zipObjectDeep.js b/tools/ui/node_modules/es-toolkit/compat/zipObjectDeep.js new file mode 100644 index 0000000000000000000000000000000000000000..b9cfe4ccfcc8cb6566b355b3732fb962b08dadf8 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/zipObjectDeep.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/zipObjectDeep.js').zipObjectDeep; diff --git a/tools/ui/node_modules/es-toolkit/compat/zipWith.d.ts b/tools/ui/node_modules/es-toolkit/compat/zipWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..808a89b01281190dc4d6693a87e4c89ffc3a42b6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/zipWith.d.ts @@ -0,0 +1 @@ +export { zipWith as default } from '../dist/compat/array/zipWith.js'; diff --git a/tools/ui/node_modules/es-toolkit/compat/zipWith.js b/tools/ui/node_modules/es-toolkit/compat/zipWith.js new file mode 100644 index 0000000000000000000000000000000000000000..03f2f8c92f2199b87f5f84ab0d521d835029640b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/compat/zipWith.js @@ -0,0 +1 @@ +module.exports = require('../dist/compat/array/zipWith.js').zipWith; diff --git a/tools/ui/node_modules/es-toolkit/dist/_internal/DOMException.d.mts b/tools/ui/node_modules/es-toolkit/dist/_internal/DOMException.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..aa524046c8f207f887f80297839f1a23426cba4c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/_internal/DOMException.d.mts @@ -0,0 +1,6 @@ +import { globalThis_ } from "./globalThis.mjs"; + +//#region src/_internal/DOMException.d.ts +declare const DOMException: typeof globalThis_.DOMException; +//#endregion +export { DOMException }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/_internal/DOMException.d.ts b/tools/ui/node_modules/es-toolkit/dist/_internal/DOMException.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6a0d4b5b6a39c9792595a49c3b97a411e07d939f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/_internal/DOMException.d.ts @@ -0,0 +1,6 @@ +import { globalThis_ } from "./globalThis.js"; + +//#region src/_internal/DOMException.d.ts +declare const DOMException: typeof globalThis_.DOMException; +//#endregion +export { DOMException }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/_internal/DOMException.js b/tools/ui/node_modules/es-toolkit/dist/_internal/DOMException.js new file mode 100644 index 0000000000000000000000000000000000000000..220ae8f1a414924ae4b86360b320ea53e91646b5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/_internal/DOMException.js @@ -0,0 +1,5 @@ +const require_globalThis = require("./globalThis.js"); +//#region src/_internal/DOMException.ts +const DOMException = typeof require_globalThis.globalThis_.DOMException !== "undefined" ? require_globalThis.globalThis_.DOMException : Error; +//#endregion +exports.DOMException = DOMException; diff --git a/tools/ui/node_modules/es-toolkit/dist/_internal/DOMException.mjs b/tools/ui/node_modules/es-toolkit/dist/_internal/DOMException.mjs new file mode 100644 index 0000000000000000000000000000000000000000..2593fcd8c3eb0448ae65147aeb69929b776dd749 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/_internal/DOMException.mjs @@ -0,0 +1,5 @@ +import { globalThis_ } from "./globalThis.mjs"; +//#region src/_internal/DOMException.ts +const DOMException = typeof globalThis_.DOMException !== "undefined" ? globalThis_.DOMException : Error; +//#endregion +export { DOMException }; diff --git a/tools/ui/node_modules/es-toolkit/dist/_internal/compareValues.js b/tools/ui/node_modules/es-toolkit/dist/_internal/compareValues.js new file mode 100644 index 0000000000000000000000000000000000000000..04308d27db1041da83f9386dce1500751c4bf3ce --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/_internal/compareValues.js @@ -0,0 +1,8 @@ +//#region src/_internal/compareValues.ts +function compareValues(a, b, order) { + if (a < b) return order === "asc" ? -1 : 1; + if (a > b) return order === "asc" ? 1 : -1; + return 0; +} +//#endregion +exports.compareValues = compareValues; diff --git a/tools/ui/node_modules/es-toolkit/dist/_internal/compareValues.mjs b/tools/ui/node_modules/es-toolkit/dist/_internal/compareValues.mjs new file mode 100644 index 0000000000000000000000000000000000000000..3067625b2da4dec83cd162cc66529c0a83f50ea9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/_internal/compareValues.mjs @@ -0,0 +1,8 @@ +//#region src/_internal/compareValues.ts +function compareValues(a, b, order) { + if (a < b) return order === "asc" ? -1 : 1; + if (a > b) return order === "asc" ? 1 : -1; + return 0; +} +//#endregion +export { compareValues }; diff --git a/tools/ui/node_modules/es-toolkit/dist/_internal/globalThis.d.mts b/tools/ui/node_modules/es-toolkit/dist/_internal/globalThis.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..b974fc12957113c4759a6bd7398e273734750eef --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/_internal/globalThis.d.mts @@ -0,0 +1,4 @@ +//#region src/_internal/globalThis.d.ts +declare const globalThis_: typeof globalThis; +//#endregion +export { globalThis_ }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/_internal/globalThis.d.ts b/tools/ui/node_modules/es-toolkit/dist/_internal/globalThis.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b974fc12957113c4759a6bd7398e273734750eef --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/_internal/globalThis.d.ts @@ -0,0 +1,4 @@ +//#region src/_internal/globalThis.d.ts +declare const globalThis_: typeof globalThis; +//#endregion +export { globalThis_ }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/_internal/globalThis.js b/tools/ui/node_modules/es-toolkit/dist/_internal/globalThis.js new file mode 100644 index 0000000000000000000000000000000000000000..8d4aa8e8dcb2794c2323619ed6ab5355101ad982 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/_internal/globalThis.js @@ -0,0 +1,6 @@ +//#region src/_internal/globalThis.ts +const globalThis_ = typeof globalThis === "object" && globalThis || typeof window === "object" && window || typeof self === "object" && self || typeof global === "object" && global || (function() { + return this; +})() || Function("return this")(); +//#endregion +exports.globalThis_ = globalThis_; diff --git a/tools/ui/node_modules/es-toolkit/dist/_internal/globalThis.mjs b/tools/ui/node_modules/es-toolkit/dist/_internal/globalThis.mjs new file mode 100644 index 0000000000000000000000000000000000000000..2aac5766949bc0d825c91250d829cafdb8087d20 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/_internal/globalThis.mjs @@ -0,0 +1,6 @@ +//#region src/_internal/globalThis.ts +const globalThis_ = typeof globalThis === "object" && globalThis || typeof window === "object" && window || typeof self === "object" && self || typeof global === "object" && global || (function() { + return this; +})() || Function("return this")(); +//#endregion +export { globalThis_ }; diff --git a/tools/ui/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.d.mts b/tools/ui/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..5b8b7fe588d72927d493152e77283c2ea241e9dd --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.d.mts @@ -0,0 +1,17 @@ +//#region src/_internal/isEqualsSameValueZero.d.ts +/** + * Performs a `SameValueZero` comparison between two values to determine if they are equivalent. + * + * @param {any} value - The value to compare. + * @param {any} other - The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * + * @example + * eq(1, 1); // true + * eq(0, -0); // true + * eq(NaN, NaN); // true + * eq('a', Object('a')); // false + */ +declare function isEqualsSameValueZero(value: any, other: any): boolean; +//#endregion +export { isEqualsSameValueZero }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.d.ts b/tools/ui/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5b8b7fe588d72927d493152e77283c2ea241e9dd --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.d.ts @@ -0,0 +1,17 @@ +//#region src/_internal/isEqualsSameValueZero.d.ts +/** + * Performs a `SameValueZero` comparison between two values to determine if they are equivalent. + * + * @param {any} value - The value to compare. + * @param {any} other - The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * + * @example + * eq(1, 1); // true + * eq(0, -0); // true + * eq(NaN, NaN); // true + * eq('a', Object('a')); // false + */ +declare function isEqualsSameValueZero(value: any, other: any): boolean; +//#endregion +export { isEqualsSameValueZero }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.js b/tools/ui/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.js new file mode 100644 index 0000000000000000000000000000000000000000..bf437bd9ed6256693cc8492b9a03c4313463028e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.js @@ -0,0 +1,19 @@ +//#region src/_internal/isEqualsSameValueZero.ts +/** +* Performs a `SameValueZero` comparison between two values to determine if they are equivalent. +* +* @param {any} value - The value to compare. +* @param {any} other - The other value to compare. +* @returns {boolean} Returns `true` if the values are equivalent, else `false`. +* +* @example +* eq(1, 1); // true +* eq(0, -0); // true +* eq(NaN, NaN); // true +* eq('a', Object('a')); // false +*/ +function isEqualsSameValueZero(value, other) { + return value === other || Number.isNaN(value) && Number.isNaN(other); +} +//#endregion +exports.isEqualsSameValueZero = isEqualsSameValueZero; diff --git a/tools/ui/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.mjs b/tools/ui/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.mjs new file mode 100644 index 0000000000000000000000000000000000000000..01e9ff5c6712ffcf17a9c42f267367e9a12adc4a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.mjs @@ -0,0 +1,19 @@ +//#region src/_internal/isEqualsSameValueZero.ts +/** +* Performs a `SameValueZero` comparison between two values to determine if they are equivalent. +* +* @param {any} value - The value to compare. +* @param {any} other - The other value to compare. +* @returns {boolean} Returns `true` if the values are equivalent, else `false`. +* +* @example +* eq(1, 1); // true +* eq(0, -0); // true +* eq(NaN, NaN); // true +* eq('a', Object('a')); // false +*/ +function isEqualsSameValueZero(value, other) { + return value === other || Number.isNaN(value) && Number.isNaN(other); +} +//#endregion +export { isEqualsSameValueZero }; diff --git a/tools/ui/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js b/tools/ui/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js new file mode 100644 index 0000000000000000000000000000000000000000..8c0a8ed2a47651734061912566139817806802e8 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js @@ -0,0 +1,16 @@ +//#region src/_internal/isUnsafeProperty.ts +/** +* Checks if a property key is unsafe to modify directly. +* +* This function is used in functions like `merge` to prevent prototype pollution attacks +* by identifying property keys that could modify the object's prototype chain or constructor. +* +* @param key - The property key to check +* @returns `true` if the property is unsafe to modify directly, `false` otherwise +* @internal +*/ +function isUnsafeProperty(key) { + return key === "__proto__"; +} +//#endregion +exports.isUnsafeProperty = isUnsafeProperty; diff --git a/tools/ui/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs b/tools/ui/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs new file mode 100644 index 0000000000000000000000000000000000000000..a761df30aef3c299ac91e70e7d7e4507ca510f36 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs @@ -0,0 +1,16 @@ +//#region src/_internal/isUnsafeProperty.ts +/** +* Checks if a property key is unsafe to modify directly. +* +* This function is used in functions like `merge` to prevent prototype pollution attacks +* by identifying property keys that could modify the object's prototype chain or constructor. +* +* @param key - The property key to check +* @returns `true` if the property is unsafe to modify directly, `false` otherwise +* @internal +*/ +function isUnsafeProperty(key) { + return key === "__proto__"; +} +//#endregion +export { isUnsafeProperty }; diff --git a/tools/ui/node_modules/es-toolkit/dist/_virtual/_rolldown/runtime.js b/tools/ui/node_modules/es-toolkit/dist/_virtual/_rolldown/runtime.js new file mode 100644 index 0000000000000000000000000000000000000000..a78d9b85d4e925b0db18432fba8d0de5f9faf760 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/_virtual/_rolldown/runtime.js @@ -0,0 +1,13 @@ +//#region \0rolldown/runtime.js +var __defProp = Object.defineProperty; +var __exportAll = (all, no_symbols) => { + let target = {}; + for (var name in all) __defProp(target, name, { + get: all[name], + enumerable: true + }); + if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" }); + return target; +}; +//#endregion +exports.__exportAll = __exportAll; diff --git a/tools/ui/node_modules/es-toolkit/dist/_virtual/_rolldown/runtime.mjs b/tools/ui/node_modules/es-toolkit/dist/_virtual/_rolldown/runtime.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d326bb2aaeb936d75a18893ce27b9eaddb8002f9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/_virtual/_rolldown/runtime.mjs @@ -0,0 +1,13 @@ +//#region \0rolldown/runtime.js +var __defProp = Object.defineProperty; +var __exportAll = (all, no_symbols) => { + let target = {}; + for (var name in all) __defProp(target, name, { + get: all[name], + enumerable: true + }); + if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" }); + return target; +}; +//#endregion +export { __exportAll }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/at.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/at.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..b5640c7d691662ee9d861e01cce1a157f5580630 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/at.d.mts @@ -0,0 +1,19 @@ +//#region src/array/at.d.ts +/** + * Retrieves elements from an array at the specified indices. + * + * This function supports negative indices, which count from the end of the array. + * + * @template T + * @param {readonly T[]} arr - The array to retrieve elements from. + * @param {number[]} indices - An array of indices specifying the positions of elements to retrieve. + * @returns {T[]} A new array containing the elements at the specified indices. + * + * @example + * const numbers = [10, 20, 30, 40, 50]; + * const result = at(numbers, [1, 3, 4]); + * console.log(result); // [20, 40, 50] + */ +declare function at(arr: readonly T[], indices: number[]): T[]; +//#endregion +export { at }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/at.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/at.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b5640c7d691662ee9d861e01cce1a157f5580630 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/at.d.ts @@ -0,0 +1,19 @@ +//#region src/array/at.d.ts +/** + * Retrieves elements from an array at the specified indices. + * + * This function supports negative indices, which count from the end of the array. + * + * @template T + * @param {readonly T[]} arr - The array to retrieve elements from. + * @param {number[]} indices - An array of indices specifying the positions of elements to retrieve. + * @returns {T[]} A new array containing the elements at the specified indices. + * + * @example + * const numbers = [10, 20, 30, 40, 50]; + * const result = at(numbers, [1, 3, 4]); + * console.log(result); // [20, 40, 50] + */ +declare function at(arr: readonly T[], indices: number[]): T[]; +//#endregion +export { at }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/at.js b/tools/ui/node_modules/es-toolkit/dist/array/at.js new file mode 100644 index 0000000000000000000000000000000000000000..b3990944585618fea5bce177945683b373ee771b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/at.js @@ -0,0 +1,29 @@ +//#region src/array/at.ts +/** +* Retrieves elements from an array at the specified indices. +* +* This function supports negative indices, which count from the end of the array. +* +* @template T +* @param {readonly T[]} arr - The array to retrieve elements from. +* @param {number[]} indices - An array of indices specifying the positions of elements to retrieve. +* @returns {T[]} A new array containing the elements at the specified indices. +* +* @example +* const numbers = [10, 20, 30, 40, 50]; +* const result = at(numbers, [1, 3, 4]); +* console.log(result); // [20, 40, 50] +*/ +function at(arr, indices) { + const result = new Array(indices.length); + const length = arr.length; + for (let i = 0; i < indices.length; i++) { + let index = indices[i]; + index = Number.isInteger(index) ? index : Math.trunc(index) || 0; + if (index < 0) index += length; + result[i] = arr[index]; + } + return result; +} +//#endregion +exports.at = at; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/at.mjs b/tools/ui/node_modules/es-toolkit/dist/array/at.mjs new file mode 100644 index 0000000000000000000000000000000000000000..bd55a33af91f7e7cb22c576d3b726d7494cbfb24 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/at.mjs @@ -0,0 +1,29 @@ +//#region src/array/at.ts +/** +* Retrieves elements from an array at the specified indices. +* +* This function supports negative indices, which count from the end of the array. +* +* @template T +* @param {readonly T[]} arr - The array to retrieve elements from. +* @param {number[]} indices - An array of indices specifying the positions of elements to retrieve. +* @returns {T[]} A new array containing the elements at the specified indices. +* +* @example +* const numbers = [10, 20, 30, 40, 50]; +* const result = at(numbers, [1, 3, 4]); +* console.log(result); // [20, 40, 50] +*/ +function at(arr, indices) { + const result = new Array(indices.length); + const length = arr.length; + for (let i = 0; i < indices.length; i++) { + let index = indices[i]; + index = Number.isInteger(index) ? index : Math.trunc(index) || 0; + if (index < 0) index += length; + result[i] = arr[index]; + } + return result; +} +//#endregion +export { at }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/cartesianProduct.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/cartesianProduct.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..71cf945902d9bb3ef035d6be7cb1dc25d84df3bc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/cartesianProduct.d.mts @@ -0,0 +1,75 @@ +//#region src/array/cartesianProduct.d.ts +/** + * Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays. + * + * @template T + * @param {readonly T[]} arr1 - The array to take the product of. + * @returns {Array<[T]>} An array of single-element tuples. + */ +declare function cartesianProduct(arr1: readonly T[]): Array<[T]>; +/** + * Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays. + * + * @template T, U + * @param {readonly T[]} arr1 - The first array to take the product of. + * @param {readonly U[]} arr2 - The second array to take the product of. + * @returns {Array<[T, U]>} An array of tuples representing the Cartesian product. + * + * @example + * cartesianProduct([1, 2], ['a', 'b']); + * // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] + */ +declare function cartesianProduct(arr1: readonly T[], arr2: readonly U[]): Array<[T, U]>; +/** + * Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays. + * + * @template T, U, V + * @param {readonly T[]} arr1 - The first array to take the product of. + * @param {readonly U[]} arr2 - The second array to take the product of. + * @param {readonly V[]} arr3 - The third array to take the product of. + * @returns {Array<[T, U, V]>} An array of tuples representing the Cartesian product. + */ +declare function cartesianProduct(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[]): Array<[T, U, V]>; +/** + * Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays. + * + * @template T, U, V, W + * @param {readonly T[]} arr1 - The first array to take the product of. + * @param {readonly U[]} arr2 - The second array to take the product of. + * @param {readonly V[]} arr3 - The third array to take the product of. + * @param {readonly W[]} arr4 - The fourth array to take the product of. + * @returns {Array<[T, U, V, W]>} An array of tuples representing the Cartesian product. + */ +declare function cartesianProduct(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[], arr4: readonly W[]): Array<[T, U, V, W]>; +/** + * Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays. + * + * Returns every possible tuple formed by picking one element from each input array, in lexicographic order. + * The rightmost array advances fastest, like the digits of an odometer. + * + * If no arrays are passed, the result is `[[]]` (a single empty tuple). + * If any input array is empty, the result is `[]`. + * + * @template T + * @param {Array} arrs - The arrays to take the product of. + * @returns {T[][]} An array of tuples representing the Cartesian product. + * + * @example + * cartesianProduct([1, 2], ['a', 'b']); + * // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] + * + * @example + * cartesianProduct([0, 1], [0, 1], [0, 1]); + * // => [[0,0,0], [0,0,1], [0,1,0], [0,1,1], [1,0,0], [1,0,1], [1,1,0], [1,1,1]] + * + * @example + * cartesianProduct([1, 2, 3], []); + * // => [] + * + * @example + * cartesianProduct(); + * // => [[]] + */ +declare function cartesianProduct(...arrs: Array): T[][]; +//#endregion +export { cartesianProduct }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/cartesianProduct.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/cartesianProduct.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..71cf945902d9bb3ef035d6be7cb1dc25d84df3bc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/cartesianProduct.d.ts @@ -0,0 +1,75 @@ +//#region src/array/cartesianProduct.d.ts +/** + * Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays. + * + * @template T + * @param {readonly T[]} arr1 - The array to take the product of. + * @returns {Array<[T]>} An array of single-element tuples. + */ +declare function cartesianProduct(arr1: readonly T[]): Array<[T]>; +/** + * Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays. + * + * @template T, U + * @param {readonly T[]} arr1 - The first array to take the product of. + * @param {readonly U[]} arr2 - The second array to take the product of. + * @returns {Array<[T, U]>} An array of tuples representing the Cartesian product. + * + * @example + * cartesianProduct([1, 2], ['a', 'b']); + * // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] + */ +declare function cartesianProduct(arr1: readonly T[], arr2: readonly U[]): Array<[T, U]>; +/** + * Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays. + * + * @template T, U, V + * @param {readonly T[]} arr1 - The first array to take the product of. + * @param {readonly U[]} arr2 - The second array to take the product of. + * @param {readonly V[]} arr3 - The third array to take the product of. + * @returns {Array<[T, U, V]>} An array of tuples representing the Cartesian product. + */ +declare function cartesianProduct(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[]): Array<[T, U, V]>; +/** + * Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays. + * + * @template T, U, V, W + * @param {readonly T[]} arr1 - The first array to take the product of. + * @param {readonly U[]} arr2 - The second array to take the product of. + * @param {readonly V[]} arr3 - The third array to take the product of. + * @param {readonly W[]} arr4 - The fourth array to take the product of. + * @returns {Array<[T, U, V, W]>} An array of tuples representing the Cartesian product. + */ +declare function cartesianProduct(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[], arr4: readonly W[]): Array<[T, U, V, W]>; +/** + * Computes the [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the input arrays. + * + * Returns every possible tuple formed by picking one element from each input array, in lexicographic order. + * The rightmost array advances fastest, like the digits of an odometer. + * + * If no arrays are passed, the result is `[[]]` (a single empty tuple). + * If any input array is empty, the result is `[]`. + * + * @template T + * @param {Array} arrs - The arrays to take the product of. + * @returns {T[][]} An array of tuples representing the Cartesian product. + * + * @example + * cartesianProduct([1, 2], ['a', 'b']); + * // => [[1, 'a'], [1, 'b'], [2, 'a'], [2, 'b']] + * + * @example + * cartesianProduct([0, 1], [0, 1], [0, 1]); + * // => [[0,0,0], [0,0,1], [0,1,0], [0,1,1], [1,0,0], [1,0,1], [1,1,0], [1,1,1]] + * + * @example + * cartesianProduct([1, 2, 3], []); + * // => [] + * + * @example + * cartesianProduct(); + * // => [[]] + */ +declare function cartesianProduct(...arrs: Array): T[][]; +//#endregion +export { cartesianProduct }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/cartesianProduct.js b/tools/ui/node_modules/es-toolkit/dist/array/cartesianProduct.js new file mode 100644 index 0000000000000000000000000000000000000000..9c12be0d2aa1a8e8028593386b66a363660273f8 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/cartesianProduct.js @@ -0,0 +1,23 @@ +//#region src/array/cartesianProduct.ts +function cartesianProduct(...arrs) { + if (arrs.length === 0) return [[]]; + let total = 1; + for (let i = 0; i < arrs.length; i++) total *= arrs[i].length; + if (total === 0) return []; + const n = arrs.length; + const result = Array(total); + for (let i = 0; i < total; i++) { + const tuple = Array(n); + let idx = i; + for (let j = n - 1; j >= 0; j--) { + const arr = arrs[j]; + const len = arr.length; + tuple[j] = arr[idx % len]; + idx = Math.floor(idx / len); + } + result[i] = tuple; + } + return result; +} +//#endregion +exports.cartesianProduct = cartesianProduct; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/cartesianProduct.mjs b/tools/ui/node_modules/es-toolkit/dist/array/cartesianProduct.mjs new file mode 100644 index 0000000000000000000000000000000000000000..1b4fc6b9a45b88f46c21020a4704cdb1bc97185f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/cartesianProduct.mjs @@ -0,0 +1,23 @@ +//#region src/array/cartesianProduct.ts +function cartesianProduct(...arrs) { + if (arrs.length === 0) return [[]]; + let total = 1; + for (let i = 0; i < arrs.length; i++) total *= arrs[i].length; + if (total === 0) return []; + const n = arrs.length; + const result = Array(total); + for (let i = 0; i < total; i++) { + const tuple = Array(n); + let idx = i; + for (let j = n - 1; j >= 0; j--) { + const arr = arrs[j]; + const len = arr.length; + tuple[j] = arr[idx % len]; + idx = Math.floor(idx / len); + } + result[i] = tuple; + } + return result; +} +//#endregion +export { cartesianProduct }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/chunk.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/chunk.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..9569e5e18ec381d95a54be3083cc32b6a8dc6af4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/chunk.d.mts @@ -0,0 +1,27 @@ +//#region src/array/chunk.d.ts +/** + * Splits an array into smaller arrays of a specified length. + * + * This function takes an input array and divides it into multiple smaller arrays, + * each of a specified length. If the input array cannot be evenly divided, + * the final sub-array will contain the remaining elements. + * + * @template T The type of elements in the array. + * @param {T[]} arr - The array to be chunked into smaller arrays. + * @param {number} size - The size of each smaller array. Must be a positive integer. + * @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`. + * @throws {Error} Throws an error if `size` is not a positive integer. + * + * @example + * // Splits an array of numbers into sub-arrays of length 2 + * chunk([1, 2, 3, 4, 5], 2); + * // Returns: [[1, 2], [3, 4], [5]] + * + * @example + * // Splits an array of strings into sub-arrays of length 3 + * chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3); + * // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']] + */ +declare function chunk(arr: readonly T[], size: number): T[][]; +//#endregion +export { chunk }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/chunk.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/chunk.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9569e5e18ec381d95a54be3083cc32b6a8dc6af4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/chunk.d.ts @@ -0,0 +1,27 @@ +//#region src/array/chunk.d.ts +/** + * Splits an array into smaller arrays of a specified length. + * + * This function takes an input array and divides it into multiple smaller arrays, + * each of a specified length. If the input array cannot be evenly divided, + * the final sub-array will contain the remaining elements. + * + * @template T The type of elements in the array. + * @param {T[]} arr - The array to be chunked into smaller arrays. + * @param {number} size - The size of each smaller array. Must be a positive integer. + * @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`. + * @throws {Error} Throws an error if `size` is not a positive integer. + * + * @example + * // Splits an array of numbers into sub-arrays of length 2 + * chunk([1, 2, 3, 4, 5], 2); + * // Returns: [[1, 2], [3, 4], [5]] + * + * @example + * // Splits an array of strings into sub-arrays of length 3 + * chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3); + * // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']] + */ +declare function chunk(arr: readonly T[], size: number): T[][]; +//#endregion +export { chunk }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/chunk.js b/tools/ui/node_modules/es-toolkit/dist/array/chunk.js new file mode 100644 index 0000000000000000000000000000000000000000..8d2850eae141a9ca55bcb5c184877679758aec21 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/chunk.js @@ -0,0 +1,37 @@ +//#region src/array/chunk.ts +/** +* Splits an array into smaller arrays of a specified length. +* +* This function takes an input array and divides it into multiple smaller arrays, +* each of a specified length. If the input array cannot be evenly divided, +* the final sub-array will contain the remaining elements. +* +* @template T The type of elements in the array. +* @param {T[]} arr - The array to be chunked into smaller arrays. +* @param {number} size - The size of each smaller array. Must be a positive integer. +* @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`. +* @throws {Error} Throws an error if `size` is not a positive integer. +* +* @example +* // Splits an array of numbers into sub-arrays of length 2 +* chunk([1, 2, 3, 4, 5], 2); +* // Returns: [[1, 2], [3, 4], [5]] +* +* @example +* // Splits an array of strings into sub-arrays of length 3 +* chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3); +* // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']] +*/ +function chunk(arr, size) { + if (!Number.isInteger(size) || size <= 0) throw new Error("Size must be an integer greater than zero."); + const chunkLength = Math.ceil(arr.length / size); + const result = Array(chunkLength); + for (let index = 0; index < chunkLength; index++) { + const start = index * size; + const end = start + size; + result[index] = arr.slice(start, end); + } + return result; +} +//#endregion +exports.chunk = chunk; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/chunk.mjs b/tools/ui/node_modules/es-toolkit/dist/array/chunk.mjs new file mode 100644 index 0000000000000000000000000000000000000000..5153f54cd1d2b90ccffd0b4ba157c05e25b7c7e4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/chunk.mjs @@ -0,0 +1,37 @@ +//#region src/array/chunk.ts +/** +* Splits an array into smaller arrays of a specified length. +* +* This function takes an input array and divides it into multiple smaller arrays, +* each of a specified length. If the input array cannot be evenly divided, +* the final sub-array will contain the remaining elements. +* +* @template T The type of elements in the array. +* @param {T[]} arr - The array to be chunked into smaller arrays. +* @param {number} size - The size of each smaller array. Must be a positive integer. +* @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`. +* @throws {Error} Throws an error if `size` is not a positive integer. +* +* @example +* // Splits an array of numbers into sub-arrays of length 2 +* chunk([1, 2, 3, 4, 5], 2); +* // Returns: [[1, 2], [3, 4], [5]] +* +* @example +* // Splits an array of strings into sub-arrays of length 3 +* chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3); +* // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']] +*/ +function chunk(arr, size) { + if (!Number.isInteger(size) || size <= 0) throw new Error("Size must be an integer greater than zero."); + const chunkLength = Math.ceil(arr.length / size); + const result = Array(chunkLength); + for (let index = 0; index < chunkLength; index++) { + const start = index * size; + const end = start + size; + result[index] = arr.slice(start, end); + } + return result; +} +//#endregion +export { chunk }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/combinations.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/combinations.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..97e3ba3e4a4dc2b991da91332f8e884406957576 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/combinations.d.mts @@ -0,0 +1,35 @@ +//#region src/array/combinations.d.ts +/** + * Returns all `r`-length combinations of elements from the input array. + * + * Combinations are emitted in lexicographic order based on the position of elements in the input array. + * Elements are treated as unique by position, not by value, so duplicates in the input may produce + * combinations that look identical. + * + * The number of combinations is `n! / r! / (n - r)!` when `0 <= r <= n`, and zero when `r > n`. + * + * @template T + * @param {readonly T[]} arr - The input array. + * @param {number} r - The length of each combination. Must be a non-negative integer. + * @returns {T[][]} An array of `r`-length combinations. + * @throws {Error} If `r` is not a non-negative integer. + * + * @example + * combinations(['A', 'B', 'C', 'D'], 2); + * // => [['A','B'], ['A','C'], ['A','D'], ['B','C'], ['B','D'], ['C','D']] + * + * @example + * combinations([1, 2, 3, 4], 3); + * // => [[1,2,3], [1,2,4], [1,3,4], [2,3,4]] + * + * @example + * combinations([1, 2, 3], 0); + * // => [[]] + * + * @example + * combinations([1, 2], 5); + * // => [] + */ +declare function combinations(arr: readonly T[], r: number): T[][]; +//#endregion +export { combinations }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/combinations.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/combinations.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..97e3ba3e4a4dc2b991da91332f8e884406957576 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/combinations.d.ts @@ -0,0 +1,35 @@ +//#region src/array/combinations.d.ts +/** + * Returns all `r`-length combinations of elements from the input array. + * + * Combinations are emitted in lexicographic order based on the position of elements in the input array. + * Elements are treated as unique by position, not by value, so duplicates in the input may produce + * combinations that look identical. + * + * The number of combinations is `n! / r! / (n - r)!` when `0 <= r <= n`, and zero when `r > n`. + * + * @template T + * @param {readonly T[]} arr - The input array. + * @param {number} r - The length of each combination. Must be a non-negative integer. + * @returns {T[][]} An array of `r`-length combinations. + * @throws {Error} If `r` is not a non-negative integer. + * + * @example + * combinations(['A', 'B', 'C', 'D'], 2); + * // => [['A','B'], ['A','C'], ['A','D'], ['B','C'], ['B','D'], ['C','D']] + * + * @example + * combinations([1, 2, 3, 4], 3); + * // => [[1,2,3], [1,2,4], [1,3,4], [2,3,4]] + * + * @example + * combinations([1, 2, 3], 0); + * // => [[]] + * + * @example + * combinations([1, 2], 5); + * // => [] + */ +declare function combinations(arr: readonly T[], r: number): T[][]; +//#endregion +export { combinations }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/combinations.js b/tools/ui/node_modules/es-toolkit/dist/array/combinations.js new file mode 100644 index 0000000000000000000000000000000000000000..1a308511d1602486425cbd6125bc9b9862a9ac69 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/combinations.js @@ -0,0 +1,53 @@ +//#region src/array/combinations.ts +/** +* Returns all `r`-length combinations of elements from the input array. +* +* Combinations are emitted in lexicographic order based on the position of elements in the input array. +* Elements are treated as unique by position, not by value, so duplicates in the input may produce +* combinations that look identical. +* +* The number of combinations is `n! / r! / (n - r)!` when `0 <= r <= n`, and zero when `r > n`. +* +* @template T +* @param {readonly T[]} arr - The input array. +* @param {number} r - The length of each combination. Must be a non-negative integer. +* @returns {T[][]} An array of `r`-length combinations. +* @throws {Error} If `r` is not a non-negative integer. +* +* @example +* combinations(['A', 'B', 'C', 'D'], 2); +* // => [['A','B'], ['A','C'], ['A','D'], ['B','C'], ['B','D'], ['C','D']] +* +* @example +* combinations([1, 2, 3, 4], 3); +* // => [[1,2,3], [1,2,4], [1,3,4], [2,3,4]] +* +* @example +* combinations([1, 2, 3], 0); +* // => [[]] +* +* @example +* combinations([1, 2], 5); +* // => [] +*/ +function combinations(arr, r) { + if (!Number.isInteger(r) || r < 0) throw new Error("r must be a non-negative integer."); + const n = arr.length; + if (r > n) return []; + if (r === 0) return [[]]; + const indices = Array(r); + for (let i = 0; i < r; i++) indices[i] = i; + const result = []; + while (true) { + const tuple = Array(r); + for (let i = 0; i < r; i++) tuple[i] = arr[indices[i]]; + result.push(tuple); + let i = r - 1; + while (i >= 0 && indices[i] === i + n - r) i--; + if (i < 0) return result; + indices[i]++; + for (let j = i + 1; j < r; j++) indices[j] = indices[j - 1] + 1; + } +} +//#endregion +exports.combinations = combinations; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/combinations.mjs b/tools/ui/node_modules/es-toolkit/dist/array/combinations.mjs new file mode 100644 index 0000000000000000000000000000000000000000..bca7433cec2042eecc0a5a8204ed615ade21d260 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/combinations.mjs @@ -0,0 +1,53 @@ +//#region src/array/combinations.ts +/** +* Returns all `r`-length combinations of elements from the input array. +* +* Combinations are emitted in lexicographic order based on the position of elements in the input array. +* Elements are treated as unique by position, not by value, so duplicates in the input may produce +* combinations that look identical. +* +* The number of combinations is `n! / r! / (n - r)!` when `0 <= r <= n`, and zero when `r > n`. +* +* @template T +* @param {readonly T[]} arr - The input array. +* @param {number} r - The length of each combination. Must be a non-negative integer. +* @returns {T[][]} An array of `r`-length combinations. +* @throws {Error} If `r` is not a non-negative integer. +* +* @example +* combinations(['A', 'B', 'C', 'D'], 2); +* // => [['A','B'], ['A','C'], ['A','D'], ['B','C'], ['B','D'], ['C','D']] +* +* @example +* combinations([1, 2, 3, 4], 3); +* // => [[1,2,3], [1,2,4], [1,3,4], [2,3,4]] +* +* @example +* combinations([1, 2, 3], 0); +* // => [[]] +* +* @example +* combinations([1, 2], 5); +* // => [] +*/ +function combinations(arr, r) { + if (!Number.isInteger(r) || r < 0) throw new Error("r must be a non-negative integer."); + const n = arr.length; + if (r > n) return []; + if (r === 0) return [[]]; + const indices = Array(r); + for (let i = 0; i < r; i++) indices[i] = i; + const result = []; + while (true) { + const tuple = Array(r); + for (let i = 0; i < r; i++) tuple[i] = arr[indices[i]]; + result.push(tuple); + let i = r - 1; + while (i >= 0 && indices[i] === i + n - r) i--; + if (i < 0) return result; + indices[i]++; + for (let j = i + 1; j < r; j++) indices[j] = indices[j - 1] + 1; + } +} +//#endregion +export { combinations }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/compact.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/compact.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..b3da235b3607eb25f1d50e40694f454551a637ba --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/compact.d.mts @@ -0,0 +1,16 @@ +//#region src/array/compact.d.ts +type NotFalsey = Exclude; +/** + * Removes falsey values (false, null, 0, -0, 0n, '', undefined, NaN) from an array. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The input array to remove falsey values. + * @returns {Array>} - A new array with all falsey values removed. + * + * @example + * compact([0, -0, 0n, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]); + * Returns: [1, 2, 3, 4, 5] + */ +declare function compact(arr: readonly T[]): Array>; +//#endregion +export { compact }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/compact.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/compact.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b3da235b3607eb25f1d50e40694f454551a637ba --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/compact.d.ts @@ -0,0 +1,16 @@ +//#region src/array/compact.d.ts +type NotFalsey = Exclude; +/** + * Removes falsey values (false, null, 0, -0, 0n, '', undefined, NaN) from an array. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The input array to remove falsey values. + * @returns {Array>} - A new array with all falsey values removed. + * + * @example + * compact([0, -0, 0n, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]); + * Returns: [1, 2, 3, 4, 5] + */ +declare function compact(arr: readonly T[]): Array>; +//#endregion +export { compact }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/compact.js b/tools/ui/node_modules/es-toolkit/dist/array/compact.js new file mode 100644 index 0000000000000000000000000000000000000000..c8bd744e8b6baa9f38aa69ae54839397137c6be9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/compact.js @@ -0,0 +1,22 @@ +//#region src/array/compact.ts +/** +* Removes falsey values (false, null, 0, -0, 0n, '', undefined, NaN) from an array. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The input array to remove falsey values. +* @returns {Array>} - A new array with all falsey values removed. +* +* @example +* compact([0, -0, 0n, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]); +* Returns: [1, 2, 3, 4, 5] +*/ +function compact(arr) { + const result = []; + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + if (item) result.push(item); + } + return result; +} +//#endregion +exports.compact = compact; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/compact.mjs b/tools/ui/node_modules/es-toolkit/dist/array/compact.mjs new file mode 100644 index 0000000000000000000000000000000000000000..5dca590d3f21aaabc19059387b5e3bceedd7c48e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/compact.mjs @@ -0,0 +1,22 @@ +//#region src/array/compact.ts +/** +* Removes falsey values (false, null, 0, -0, 0n, '', undefined, NaN) from an array. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The input array to remove falsey values. +* @returns {Array>} - A new array with all falsey values removed. +* +* @example +* compact([0, -0, 0n, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]); +* Returns: [1, 2, 3, 4, 5] +*/ +function compact(arr) { + const result = []; + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + if (item) result.push(item); + } + return result; +} +//#endregion +export { compact }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/countBy.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/countBy.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..dc75224d08e068a55223152e288e99474ead07e6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/countBy.d.mts @@ -0,0 +1,37 @@ +//#region src/array/countBy.d.ts +/** + * Count the occurrences of each item in an array + * based on a transformation function. + * + * This function takes an array and a transformation function + * that converts each item in the array to a key. It then + * counts the occurrences of each transformed item and returns + * an object with the transformed items as keys and the counts + * as values. + * + * @template T - The type of the items in the input array. + * @template K - The type of keys. + * @param {T[]} arr - The input array to count occurrences. + * @param {(item: T, index: number, array: readonly T[]) => K} mapper - The transformation function that maps each item, its index, and the array to a key. + * @returns {Record} An object containing the transformed items as keys and the + * counts as values. + * + * @example + * const array = ['a', 'b', 'c', 'a', 'b', 'a']; + * const result = countBy(array, x => x); + * // result will be { a: 3, b: 2, c: 1 } + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const result = countBy(array, item => item % 2 === 0 ? 'even' : 'odd'); + * // result will be { odd: 3, even: 2 } + * + * @example + * // Using index parameter + * const array = ['a', 'b', 'c', 'd']; + * const result = countBy(array, (item, index) => index < 2 ? 'first' : 'rest'); + * // result will be { first: 2, rest: 2 } + */ +declare function countBy(arr: readonly T[], mapper: (item: T, index: number, array: readonly T[]) => K): Record; +//#endregion +export { countBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/countBy.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/countBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dc75224d08e068a55223152e288e99474ead07e6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/countBy.d.ts @@ -0,0 +1,37 @@ +//#region src/array/countBy.d.ts +/** + * Count the occurrences of each item in an array + * based on a transformation function. + * + * This function takes an array and a transformation function + * that converts each item in the array to a key. It then + * counts the occurrences of each transformed item and returns + * an object with the transformed items as keys and the counts + * as values. + * + * @template T - The type of the items in the input array. + * @template K - The type of keys. + * @param {T[]} arr - The input array to count occurrences. + * @param {(item: T, index: number, array: readonly T[]) => K} mapper - The transformation function that maps each item, its index, and the array to a key. + * @returns {Record} An object containing the transformed items as keys and the + * counts as values. + * + * @example + * const array = ['a', 'b', 'c', 'a', 'b', 'a']; + * const result = countBy(array, x => x); + * // result will be { a: 3, b: 2, c: 1 } + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const result = countBy(array, item => item % 2 === 0 ? 'even' : 'odd'); + * // result will be { odd: 3, even: 2 } + * + * @example + * // Using index parameter + * const array = ['a', 'b', 'c', 'd']; + * const result = countBy(array, (item, index) => index < 2 ? 'first' : 'rest'); + * // result will be { first: 2, rest: 2 } + */ +declare function countBy(arr: readonly T[], mapper: (item: T, index: number, array: readonly T[]) => K): Record; +//#endregion +export { countBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/countBy.js b/tools/ui/node_modules/es-toolkit/dist/array/countBy.js new file mode 100644 index 0000000000000000000000000000000000000000..f936729a3529c5d02af019ff16277e2e9e3932bd --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/countBy.js @@ -0,0 +1,45 @@ +//#region src/array/countBy.ts +/** +* Count the occurrences of each item in an array +* based on a transformation function. +* +* This function takes an array and a transformation function +* that converts each item in the array to a key. It then +* counts the occurrences of each transformed item and returns +* an object with the transformed items as keys and the counts +* as values. +* +* @template T - The type of the items in the input array. +* @template K - The type of keys. +* @param {T[]} arr - The input array to count occurrences. +* @param {(item: T, index: number, array: readonly T[]) => K} mapper - The transformation function that maps each item, its index, and the array to a key. +* @returns {Record} An object containing the transformed items as keys and the +* counts as values. +* +* @example +* const array = ['a', 'b', 'c', 'a', 'b', 'a']; +* const result = countBy(array, x => x); +* // result will be { a: 3, b: 2, c: 1 } +* +* @example +* const array = [1, 2, 3, 4, 5]; +* const result = countBy(array, item => item % 2 === 0 ? 'even' : 'odd'); +* // result will be { odd: 3, even: 2 } +* +* @example +* // Using index parameter +* const array = ['a', 'b', 'c', 'd']; +* const result = countBy(array, (item, index) => index < 2 ? 'first' : 'rest'); +* // result will be { first: 2, rest: 2 } +*/ +function countBy(arr, mapper) { + const result = {}; + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + const key = mapper(item, i, arr); + result[key] = (result[key] ?? 0) + 1; + } + return result; +} +//#endregion +exports.countBy = countBy; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/countBy.mjs b/tools/ui/node_modules/es-toolkit/dist/array/countBy.mjs new file mode 100644 index 0000000000000000000000000000000000000000..e319af5bb2a58aecce42d4a0c977adfc88535ccb --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/countBy.mjs @@ -0,0 +1,45 @@ +//#region src/array/countBy.ts +/** +* Count the occurrences of each item in an array +* based on a transformation function. +* +* This function takes an array and a transformation function +* that converts each item in the array to a key. It then +* counts the occurrences of each transformed item and returns +* an object with the transformed items as keys and the counts +* as values. +* +* @template T - The type of the items in the input array. +* @template K - The type of keys. +* @param {T[]} arr - The input array to count occurrences. +* @param {(item: T, index: number, array: readonly T[]) => K} mapper - The transformation function that maps each item, its index, and the array to a key. +* @returns {Record} An object containing the transformed items as keys and the +* counts as values. +* +* @example +* const array = ['a', 'b', 'c', 'a', 'b', 'a']; +* const result = countBy(array, x => x); +* // result will be { a: 3, b: 2, c: 1 } +* +* @example +* const array = [1, 2, 3, 4, 5]; +* const result = countBy(array, item => item % 2 === 0 ? 'even' : 'odd'); +* // result will be { odd: 3, even: 2 } +* +* @example +* // Using index parameter +* const array = ['a', 'b', 'c', 'd']; +* const result = countBy(array, (item, index) => index < 2 ? 'first' : 'rest'); +* // result will be { first: 2, rest: 2 } +*/ +function countBy(arr, mapper) { + const result = {}; + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + const key = mapper(item, i, arr); + result[key] = (result[key] ?? 0) + 1; + } + return result; +} +//#endregion +export { countBy }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/difference.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/difference.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..97a3b0694ca815db6c3d66ceea89cecac9ec9c4f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/difference.d.mts @@ -0,0 +1,26 @@ +//#region src/array/difference.d.ts +/** + * Computes the difference between two arrays. + * + * This function takes two arrays and returns a new array containing the elements + * that are present in the first array but not in the second array. It effectively + * filters out any elements from the first array that also appear in the second array. + * + * @template T + * @param {T[]} firstArr - The array from which to derive the difference. This is the primary array + * from which elements will be compared and filtered. + * @param {T[]} secondArr - The array containing elements to be excluded from the first array. + * Each element in this array will be checked against the first array, and if a match is found, + * that element will be excluded from the result. + * @returns {T[]} A new array containing the elements that are present in the first array but not + * in the second array. + * + * @example + * const array1 = [1, 2, 3, 4, 5]; + * const array2 = [2, 4]; + * const result = difference(array1, array2); + * // result will be [1, 3, 5] since 2 and 4 are in both arrays and are excluded from the result. + */ +declare function difference(firstArr: readonly T[], secondArr: readonly T[]): T[]; +//#endregion +export { difference }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/difference.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/difference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..97a3b0694ca815db6c3d66ceea89cecac9ec9c4f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/difference.d.ts @@ -0,0 +1,26 @@ +//#region src/array/difference.d.ts +/** + * Computes the difference between two arrays. + * + * This function takes two arrays and returns a new array containing the elements + * that are present in the first array but not in the second array. It effectively + * filters out any elements from the first array that also appear in the second array. + * + * @template T + * @param {T[]} firstArr - The array from which to derive the difference. This is the primary array + * from which elements will be compared and filtered. + * @param {T[]} secondArr - The array containing elements to be excluded from the first array. + * Each element in this array will be checked against the first array, and if a match is found, + * that element will be excluded from the result. + * @returns {T[]} A new array containing the elements that are present in the first array but not + * in the second array. + * + * @example + * const array1 = [1, 2, 3, 4, 5]; + * const array2 = [2, 4]; + * const result = difference(array1, array2); + * // result will be [1, 3, 5] since 2 and 4 are in both arrays and are excluded from the result. + */ +declare function difference(firstArr: readonly T[], secondArr: readonly T[]): T[]; +//#endregion +export { difference }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/difference.js b/tools/ui/node_modules/es-toolkit/dist/array/difference.js new file mode 100644 index 0000000000000000000000000000000000000000..8002d16eba6eae1560888c4c2b39b282ed33b098 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/difference.js @@ -0,0 +1,29 @@ +//#region src/array/difference.ts +/** +* Computes the difference between two arrays. +* +* This function takes two arrays and returns a new array containing the elements +* that are present in the first array but not in the second array. It effectively +* filters out any elements from the first array that also appear in the second array. +* +* @template T +* @param {T[]} firstArr - The array from which to derive the difference. This is the primary array +* from which elements will be compared and filtered. +* @param {T[]} secondArr - The array containing elements to be excluded from the first array. +* Each element in this array will be checked against the first array, and if a match is found, +* that element will be excluded from the result. +* @returns {T[]} A new array containing the elements that are present in the first array but not +* in the second array. +* +* @example +* const array1 = [1, 2, 3, 4, 5]; +* const array2 = [2, 4]; +* const result = difference(array1, array2); +* // result will be [1, 3, 5] since 2 and 4 are in both arrays and are excluded from the result. +*/ +function difference(firstArr, secondArr) { + const secondSet = new Set(secondArr); + return firstArr.filter((item) => !secondSet.has(item)); +} +//#endregion +exports.difference = difference; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/difference.mjs b/tools/ui/node_modules/es-toolkit/dist/array/difference.mjs new file mode 100644 index 0000000000000000000000000000000000000000..225ee874ff5ae13d0b841da39a9333a778f07a9e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/difference.mjs @@ -0,0 +1,29 @@ +//#region src/array/difference.ts +/** +* Computes the difference between two arrays. +* +* This function takes two arrays and returns a new array containing the elements +* that are present in the first array but not in the second array. It effectively +* filters out any elements from the first array that also appear in the second array. +* +* @template T +* @param {T[]} firstArr - The array from which to derive the difference. This is the primary array +* from which elements will be compared and filtered. +* @param {T[]} secondArr - The array containing elements to be excluded from the first array. +* Each element in this array will be checked against the first array, and if a match is found, +* that element will be excluded from the result. +* @returns {T[]} A new array containing the elements that are present in the first array but not +* in the second array. +* +* @example +* const array1 = [1, 2, 3, 4, 5]; +* const array2 = [2, 4]; +* const result = difference(array1, array2); +* // result will be [1, 3, 5] since 2 and 4 are in both arrays and are excluded from the result. +*/ +function difference(firstArr, secondArr) { + const secondSet = new Set(secondArr); + return firstArr.filter((item) => !secondSet.has(item)); +} +//#endregion +export { difference }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/differenceBy.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/differenceBy.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..0162e76862cdbbec379695245abefe0436fabc39 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/differenceBy.d.mts @@ -0,0 +1,36 @@ +//#region src/array/differenceBy.d.ts +/** + * Computes the difference between two arrays after mapping their elements through a provided function. + * + * This function takes two arrays and a mapper function. It returns a new array containing the elements + * that are present in the first array but not in the second array, based on the identity calculated + * by the mapper function. + * + * Essentially, it filters out any elements from the first array that, when + * mapped, match an element in the mapped version of the second array. + * + * @template T, U + * @param {T[]} firstArr - The primary array from which to derive the difference. + * @param {U[]} secondArr - The array containing elements to be excluded from the first array. + * @param {(value: T | U) => unknown} mapper - The function to map the elements of both arrays. This function + * is applied to each element in both arrays, and the comparison is made based on the mapped values. + * @returns {T[]} A new array containing the elements from the first array that do not have a corresponding + * mapped identity in the second array. + * + * @example + * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const array2 = [{ id: 2 }, { id: 4 }]; + * const mapper = item => item.id; + * const result = differenceBy(array1, array2, mapper); + * // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are in both arrays and are excluded from the result. + * + * @example + * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const array2 = [2, 4]; + * const mapper = item => (typeof item === 'object' ? item.id : item); + * const result = differenceBy(array1, array2, mapper); + * // result will be [{ id: 1 }, { id: 3 }] since 2 is present in both arrays after mapping, and is excluded from the result. + */ +declare function differenceBy(firstArr: readonly T[], secondArr: readonly U[], mapper: (value: T | U) => unknown): T[]; +//#endregion +export { differenceBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/differenceBy.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/differenceBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0162e76862cdbbec379695245abefe0436fabc39 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/differenceBy.d.ts @@ -0,0 +1,36 @@ +//#region src/array/differenceBy.d.ts +/** + * Computes the difference between two arrays after mapping their elements through a provided function. + * + * This function takes two arrays and a mapper function. It returns a new array containing the elements + * that are present in the first array but not in the second array, based on the identity calculated + * by the mapper function. + * + * Essentially, it filters out any elements from the first array that, when + * mapped, match an element in the mapped version of the second array. + * + * @template T, U + * @param {T[]} firstArr - The primary array from which to derive the difference. + * @param {U[]} secondArr - The array containing elements to be excluded from the first array. + * @param {(value: T | U) => unknown} mapper - The function to map the elements of both arrays. This function + * is applied to each element in both arrays, and the comparison is made based on the mapped values. + * @returns {T[]} A new array containing the elements from the first array that do not have a corresponding + * mapped identity in the second array. + * + * @example + * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const array2 = [{ id: 2 }, { id: 4 }]; + * const mapper = item => item.id; + * const result = differenceBy(array1, array2, mapper); + * // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are in both arrays and are excluded from the result. + * + * @example + * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const array2 = [2, 4]; + * const mapper = item => (typeof item === 'object' ? item.id : item); + * const result = differenceBy(array1, array2, mapper); + * // result will be [{ id: 1 }, { id: 3 }] since 2 is present in both arrays after mapping, and is excluded from the result. + */ +declare function differenceBy(firstArr: readonly T[], secondArr: readonly U[], mapper: (value: T | U) => unknown): T[]; +//#endregion +export { differenceBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/differenceBy.js b/tools/ui/node_modules/es-toolkit/dist/array/differenceBy.js new file mode 100644 index 0000000000000000000000000000000000000000..8e4e419f37d47d92bf3f65a7449bcbe2ce8bb238 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/differenceBy.js @@ -0,0 +1,41 @@ +//#region src/array/differenceBy.ts +/** +* Computes the difference between two arrays after mapping their elements through a provided function. +* +* This function takes two arrays and a mapper function. It returns a new array containing the elements +* that are present in the first array but not in the second array, based on the identity calculated +* by the mapper function. +* +* Essentially, it filters out any elements from the first array that, when +* mapped, match an element in the mapped version of the second array. +* +* @template T, U +* @param {T[]} firstArr - The primary array from which to derive the difference. +* @param {U[]} secondArr - The array containing elements to be excluded from the first array. +* @param {(value: T | U) => unknown} mapper - The function to map the elements of both arrays. This function +* is applied to each element in both arrays, and the comparison is made based on the mapped values. +* @returns {T[]} A new array containing the elements from the first array that do not have a corresponding +* mapped identity in the second array. +* +* @example +* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const array2 = [{ id: 2 }, { id: 4 }]; +* const mapper = item => item.id; +* const result = differenceBy(array1, array2, mapper); +* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are in both arrays and are excluded from the result. +* +* @example +* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const array2 = [2, 4]; +* const mapper = item => (typeof item === 'object' ? item.id : item); +* const result = differenceBy(array1, array2, mapper); +* // result will be [{ id: 1 }, { id: 3 }] since 2 is present in both arrays after mapping, and is excluded from the result. +*/ +function differenceBy(firstArr, secondArr, mapper) { + const mappedSecondSet = new Set(secondArr.map((item) => mapper(item))); + return firstArr.filter((item) => { + return !mappedSecondSet.has(mapper(item)); + }); +} +//#endregion +exports.differenceBy = differenceBy; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/differenceBy.mjs b/tools/ui/node_modules/es-toolkit/dist/array/differenceBy.mjs new file mode 100644 index 0000000000000000000000000000000000000000..64db33a7164a3177b4644f8cb91d0de1bfbc2787 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/differenceBy.mjs @@ -0,0 +1,41 @@ +//#region src/array/differenceBy.ts +/** +* Computes the difference between two arrays after mapping their elements through a provided function. +* +* This function takes two arrays and a mapper function. It returns a new array containing the elements +* that are present in the first array but not in the second array, based on the identity calculated +* by the mapper function. +* +* Essentially, it filters out any elements from the first array that, when +* mapped, match an element in the mapped version of the second array. +* +* @template T, U +* @param {T[]} firstArr - The primary array from which to derive the difference. +* @param {U[]} secondArr - The array containing elements to be excluded from the first array. +* @param {(value: T | U) => unknown} mapper - The function to map the elements of both arrays. This function +* is applied to each element in both arrays, and the comparison is made based on the mapped values. +* @returns {T[]} A new array containing the elements from the first array that do not have a corresponding +* mapped identity in the second array. +* +* @example +* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const array2 = [{ id: 2 }, { id: 4 }]; +* const mapper = item => item.id; +* const result = differenceBy(array1, array2, mapper); +* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are in both arrays and are excluded from the result. +* +* @example +* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const array2 = [2, 4]; +* const mapper = item => (typeof item === 'object' ? item.id : item); +* const result = differenceBy(array1, array2, mapper); +* // result will be [{ id: 1 }, { id: 3 }] since 2 is present in both arrays after mapping, and is excluded from the result. +*/ +function differenceBy(firstArr, secondArr, mapper) { + const mappedSecondSet = new Set(secondArr.map((item) => mapper(item))); + return firstArr.filter((item) => { + return !mappedSecondSet.has(mapper(item)); + }); +} +//#endregion +export { differenceBy }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/differenceWith.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/differenceWith.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..707500568f6349632becc5ad0dd2eb6b0eda497e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/differenceWith.d.mts @@ -0,0 +1,32 @@ +//#region src/array/differenceWith.d.ts +/** + * Computes the difference between two arrays based on a custom equality function. + * + * This function takes two arrays and a custom comparison function. It returns a new array containing + * the elements that are present in the first array but not in the second array. The comparison to determine + * if elements are equal is made using the provided custom function. + * + * @template T, U + * @param {T[]} firstArr - The array from which to get the difference. + * @param {U[]} secondArr - The array containing elements to exclude from the first array. + * @param {(x: T, y: U) => boolean} areItemsEqual - A function to determine if two items are equal. + * @returns {T[]} A new array containing the elements from the first array that do not match any elements in the second array + * according to the custom equality function. + * + * @example + * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const array2 = [{ id: 2 }, { id: 4 }]; + * const areItemsEqual = (a, b) => a.id === b.id; + * const result = differenceWith(array1, array2, areItemsEqual); + * // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are considered equal and are excluded from the result. + * + * @example + * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const array2 = [2, 4]; + * const areItemsEqual = (a, b) => a.id === b; + * const result = differenceWith(array1, array2, areItemsEqual); + * // result will be [{ id: 1 }, { id: 3 }] since the element with id 2 is considered equal to the second array's element and is excluded from the result. + */ +declare function differenceWith(firstArr: readonly T[], secondArr: readonly U[], areItemsEqual: (x: T, y: U) => boolean): T[]; +//#endregion +export { differenceWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/differenceWith.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/differenceWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..707500568f6349632becc5ad0dd2eb6b0eda497e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/differenceWith.d.ts @@ -0,0 +1,32 @@ +//#region src/array/differenceWith.d.ts +/** + * Computes the difference between two arrays based on a custom equality function. + * + * This function takes two arrays and a custom comparison function. It returns a new array containing + * the elements that are present in the first array but not in the second array. The comparison to determine + * if elements are equal is made using the provided custom function. + * + * @template T, U + * @param {T[]} firstArr - The array from which to get the difference. + * @param {U[]} secondArr - The array containing elements to exclude from the first array. + * @param {(x: T, y: U) => boolean} areItemsEqual - A function to determine if two items are equal. + * @returns {T[]} A new array containing the elements from the first array that do not match any elements in the second array + * according to the custom equality function. + * + * @example + * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const array2 = [{ id: 2 }, { id: 4 }]; + * const areItemsEqual = (a, b) => a.id === b.id; + * const result = differenceWith(array1, array2, areItemsEqual); + * // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are considered equal and are excluded from the result. + * + * @example + * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const array2 = [2, 4]; + * const areItemsEqual = (a, b) => a.id === b; + * const result = differenceWith(array1, array2, areItemsEqual); + * // result will be [{ id: 1 }, { id: 3 }] since the element with id 2 is considered equal to the second array's element and is excluded from the result. + */ +declare function differenceWith(firstArr: readonly T[], secondArr: readonly U[], areItemsEqual: (x: T, y: U) => boolean): T[]; +//#endregion +export { differenceWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/differenceWith.js b/tools/ui/node_modules/es-toolkit/dist/array/differenceWith.js new file mode 100644 index 0000000000000000000000000000000000000000..c4c1267aa7d7a88be9cecb1bdd12f86405c73b20 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/differenceWith.js @@ -0,0 +1,38 @@ +//#region src/array/differenceWith.ts +/** +* Computes the difference between two arrays based on a custom equality function. +* +* This function takes two arrays and a custom comparison function. It returns a new array containing +* the elements that are present in the first array but not in the second array. The comparison to determine +* if elements are equal is made using the provided custom function. +* +* @template T, U +* @param {T[]} firstArr - The array from which to get the difference. +* @param {U[]} secondArr - The array containing elements to exclude from the first array. +* @param {(x: T, y: U) => boolean} areItemsEqual - A function to determine if two items are equal. +* @returns {T[]} A new array containing the elements from the first array that do not match any elements in the second array +* according to the custom equality function. +* +* @example +* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const array2 = [{ id: 2 }, { id: 4 }]; +* const areItemsEqual = (a, b) => a.id === b.id; +* const result = differenceWith(array1, array2, areItemsEqual); +* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are considered equal and are excluded from the result. +* +* @example +* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const array2 = [2, 4]; +* const areItemsEqual = (a, b) => a.id === b; +* const result = differenceWith(array1, array2, areItemsEqual); +* // result will be [{ id: 1 }, { id: 3 }] since the element with id 2 is considered equal to the second array's element and is excluded from the result. +*/ +function differenceWith(firstArr, secondArr, areItemsEqual) { + return firstArr.filter((firstItem) => { + return secondArr.every((secondItem) => { + return !areItemsEqual(firstItem, secondItem); + }); + }); +} +//#endregion +exports.differenceWith = differenceWith; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/differenceWith.mjs b/tools/ui/node_modules/es-toolkit/dist/array/differenceWith.mjs new file mode 100644 index 0000000000000000000000000000000000000000..a04101354d9482933c0dde0b7089f675bd2a217c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/differenceWith.mjs @@ -0,0 +1,38 @@ +//#region src/array/differenceWith.ts +/** +* Computes the difference between two arrays based on a custom equality function. +* +* This function takes two arrays and a custom comparison function. It returns a new array containing +* the elements that are present in the first array but not in the second array. The comparison to determine +* if elements are equal is made using the provided custom function. +* +* @template T, U +* @param {T[]} firstArr - The array from which to get the difference. +* @param {U[]} secondArr - The array containing elements to exclude from the first array. +* @param {(x: T, y: U) => boolean} areItemsEqual - A function to determine if two items are equal. +* @returns {T[]} A new array containing the elements from the first array that do not match any elements in the second array +* according to the custom equality function. +* +* @example +* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const array2 = [{ id: 2 }, { id: 4 }]; +* const areItemsEqual = (a, b) => a.id === b.id; +* const result = differenceWith(array1, array2, areItemsEqual); +* // result will be [{ id: 1 }, { id: 3 }] since the elements with id 2 are considered equal and are excluded from the result. +* +* @example +* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const array2 = [2, 4]; +* const areItemsEqual = (a, b) => a.id === b; +* const result = differenceWith(array1, array2, areItemsEqual); +* // result will be [{ id: 1 }, { id: 3 }] since the element with id 2 is considered equal to the second array's element and is excluded from the result. +*/ +function differenceWith(firstArr, secondArr, areItemsEqual) { + return firstArr.filter((firstItem) => { + return secondArr.every((secondItem) => { + return !areItemsEqual(firstItem, secondItem); + }); + }); +} +//#endregion +export { differenceWith }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/drop.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/drop.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..6d221db144087a53e3626042ffd99e71f0619f79 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/drop.d.mts @@ -0,0 +1,20 @@ +//#region src/array/drop.d.ts +/** + * Removes a specified number of elements from the beginning of an array and returns the rest. + * + * This function takes an array and a number, and returns a new array with the specified number + * of elements removed from the start. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array from which to drop elements. + * @param {number} itemsCount - The number of elements to drop from the beginning of the array. + * @returns {T[]} A new array with the specified number of elements removed from the start. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const result = drop(array, 2); + * // result will be [3, 4, 5] since the first two elements are dropped. + */ +declare function drop(arr: readonly T[], itemsCount: number): T[]; +//#endregion +export { drop }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/drop.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/drop.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6d221db144087a53e3626042ffd99e71f0619f79 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/drop.d.ts @@ -0,0 +1,20 @@ +//#region src/array/drop.d.ts +/** + * Removes a specified number of elements from the beginning of an array and returns the rest. + * + * This function takes an array and a number, and returns a new array with the specified number + * of elements removed from the start. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array from which to drop elements. + * @param {number} itemsCount - The number of elements to drop from the beginning of the array. + * @returns {T[]} A new array with the specified number of elements removed from the start. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const result = drop(array, 2); + * // result will be [3, 4, 5] since the first two elements are dropped. + */ +declare function drop(arr: readonly T[], itemsCount: number): T[]; +//#endregion +export { drop }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/drop.js b/tools/ui/node_modules/es-toolkit/dist/array/drop.js new file mode 100644 index 0000000000000000000000000000000000000000..51cc88d2c61f1f87378667e72a506f7cb25d6bef --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/drop.js @@ -0,0 +1,23 @@ +//#region src/array/drop.ts +/** +* Removes a specified number of elements from the beginning of an array and returns the rest. +* +* This function takes an array and a number, and returns a new array with the specified number +* of elements removed from the start. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array from which to drop elements. +* @param {number} itemsCount - The number of elements to drop from the beginning of the array. +* @returns {T[]} A new array with the specified number of elements removed from the start. +* +* @example +* const array = [1, 2, 3, 4, 5]; +* const result = drop(array, 2); +* // result will be [3, 4, 5] since the first two elements are dropped. +*/ +function drop(arr, itemsCount) { + itemsCount = Math.max(itemsCount, 0); + return arr.slice(itemsCount); +} +//#endregion +exports.drop = drop; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/drop.mjs b/tools/ui/node_modules/es-toolkit/dist/array/drop.mjs new file mode 100644 index 0000000000000000000000000000000000000000..148ac2d2554c71bb3e2df089014ec2d1b7a1c1cd --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/drop.mjs @@ -0,0 +1,23 @@ +//#region src/array/drop.ts +/** +* Removes a specified number of elements from the beginning of an array and returns the rest. +* +* This function takes an array and a number, and returns a new array with the specified number +* of elements removed from the start. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array from which to drop elements. +* @param {number} itemsCount - The number of elements to drop from the beginning of the array. +* @returns {T[]} A new array with the specified number of elements removed from the start. +* +* @example +* const array = [1, 2, 3, 4, 5]; +* const result = drop(array, 2); +* // result will be [3, 4, 5] since the first two elements are dropped. +*/ +function drop(arr, itemsCount) { + itemsCount = Math.max(itemsCount, 0); + return arr.slice(itemsCount); +} +//#endregion +export { drop }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/dropRight.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/dropRight.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..ad79a8a3f5eb62f07febfa9132ee293b33f43f07 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/dropRight.d.mts @@ -0,0 +1,20 @@ +//#region src/array/dropRight.d.ts +/** + * Removes a specified number of elements from the end of an array and returns the rest. + * + * This function takes an array and a number, and returns a new array with the specified number + * of elements removed from the end. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array from which to drop elements. + * @param {number} itemsCount - The number of elements to drop from the end of the array. + * @returns {T[]} A new array with the specified number of elements removed from the end. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const result = dropRight(array, 2); + * // result will be [1, 2, 3] since the last two elements are dropped. + */ +declare function dropRight(arr: readonly T[], itemsCount: number): T[]; +//#endregion +export { dropRight }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/dropRight.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/dropRight.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ad79a8a3f5eb62f07febfa9132ee293b33f43f07 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/dropRight.d.ts @@ -0,0 +1,20 @@ +//#region src/array/dropRight.d.ts +/** + * Removes a specified number of elements from the end of an array and returns the rest. + * + * This function takes an array and a number, and returns a new array with the specified number + * of elements removed from the end. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array from which to drop elements. + * @param {number} itemsCount - The number of elements to drop from the end of the array. + * @returns {T[]} A new array with the specified number of elements removed from the end. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const result = dropRight(array, 2); + * // result will be [1, 2, 3] since the last two elements are dropped. + */ +declare function dropRight(arr: readonly T[], itemsCount: number): T[]; +//#endregion +export { dropRight }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/dropRight.js b/tools/ui/node_modules/es-toolkit/dist/array/dropRight.js new file mode 100644 index 0000000000000000000000000000000000000000..fd7291481517b6509edd5026bb906fbd56308e9a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/dropRight.js @@ -0,0 +1,24 @@ +//#region src/array/dropRight.ts +/** +* Removes a specified number of elements from the end of an array and returns the rest. +* +* This function takes an array and a number, and returns a new array with the specified number +* of elements removed from the end. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array from which to drop elements. +* @param {number} itemsCount - The number of elements to drop from the end of the array. +* @returns {T[]} A new array with the specified number of elements removed from the end. +* +* @example +* const array = [1, 2, 3, 4, 5]; +* const result = dropRight(array, 2); +* // result will be [1, 2, 3] since the last two elements are dropped. +*/ +function dropRight(arr, itemsCount) { + itemsCount = Math.min(-itemsCount, 0); + if (itemsCount === 0) return arr.slice(); + return arr.slice(0, itemsCount); +} +//#endregion +exports.dropRight = dropRight; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/dropRight.mjs b/tools/ui/node_modules/es-toolkit/dist/array/dropRight.mjs new file mode 100644 index 0000000000000000000000000000000000000000..eaf925b75c416d6ae8dae0f7aad4a0a7c4c32d09 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/dropRight.mjs @@ -0,0 +1,24 @@ +//#region src/array/dropRight.ts +/** +* Removes a specified number of elements from the end of an array and returns the rest. +* +* This function takes an array and a number, and returns a new array with the specified number +* of elements removed from the end. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array from which to drop elements. +* @param {number} itemsCount - The number of elements to drop from the end of the array. +* @returns {T[]} A new array with the specified number of elements removed from the end. +* +* @example +* const array = [1, 2, 3, 4, 5]; +* const result = dropRight(array, 2); +* // result will be [1, 2, 3] since the last two elements are dropped. +*/ +function dropRight(arr, itemsCount) { + itemsCount = Math.min(-itemsCount, 0); + if (itemsCount === 0) return arr.slice(); + return arr.slice(0, itemsCount); +} +//#endregion +export { dropRight }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/dropRightWhile.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/dropRightWhile.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..a2098cc36035376fe07f9f939151ec5b13bfd887 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/dropRightWhile.d.mts @@ -0,0 +1,22 @@ +//#region src/array/dropRightWhile.d.ts +/** + * Removes elements from the end of an array until the predicate returns false. + * + * This function iterates over an array from the end and drops elements until the provided + * predicate function returns false. It then returns a new array with the remaining elements. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array from which to drop elements. + * @param {(item: T, index: number, arr: T[]) => boolean} canContinueDropping - A predicate function that determines + * whether to continue dropping elements. The function is called with each element from the end, + * and dropping continues as long as it returns true. + * @returns {T[]} A new array with the elements remaining after the predicate returns false. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const result = dropRightWhile(array, x => x > 3); + * // result will be [1, 2, 3] since elements greater than 3 are dropped from the end. + */ +declare function dropRightWhile(arr: readonly T[], canContinueDropping: (item: T, index: number, arr: readonly T[]) => boolean): T[]; +//#endregion +export { dropRightWhile }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/dropRightWhile.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/dropRightWhile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a2098cc36035376fe07f9f939151ec5b13bfd887 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/dropRightWhile.d.ts @@ -0,0 +1,22 @@ +//#region src/array/dropRightWhile.d.ts +/** + * Removes elements from the end of an array until the predicate returns false. + * + * This function iterates over an array from the end and drops elements until the provided + * predicate function returns false. It then returns a new array with the remaining elements. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array from which to drop elements. + * @param {(item: T, index: number, arr: T[]) => boolean} canContinueDropping - A predicate function that determines + * whether to continue dropping elements. The function is called with each element from the end, + * and dropping continues as long as it returns true. + * @returns {T[]} A new array with the elements remaining after the predicate returns false. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const result = dropRightWhile(array, x => x > 3); + * // result will be [1, 2, 3] since elements greater than 3 are dropped from the end. + */ +declare function dropRightWhile(arr: readonly T[], canContinueDropping: (item: T, index: number, arr: readonly T[]) => boolean): T[]; +//#endregion +export { dropRightWhile }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/dropRightWhile.js b/tools/ui/node_modules/es-toolkit/dist/array/dropRightWhile.js new file mode 100644 index 0000000000000000000000000000000000000000..3e452a40312c7ad38febe305442a0aa692526b3d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/dropRightWhile.js @@ -0,0 +1,25 @@ +//#region src/array/dropRightWhile.ts +/** +* Removes elements from the end of an array until the predicate returns false. +* +* This function iterates over an array from the end and drops elements until the provided +* predicate function returns false. It then returns a new array with the remaining elements. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array from which to drop elements. +* @param {(item: T, index: number, arr: T[]) => boolean} canContinueDropping - A predicate function that determines +* whether to continue dropping elements. The function is called with each element from the end, +* and dropping continues as long as it returns true. +* @returns {T[]} A new array with the elements remaining after the predicate returns false. +* +* @example +* const array = [1, 2, 3, 4, 5]; +* const result = dropRightWhile(array, x => x > 3); +* // result will be [1, 2, 3] since elements greater than 3 are dropped from the end. +*/ +function dropRightWhile(arr, canContinueDropping) { + for (let i = arr.length - 1; i >= 0; i--) if (!canContinueDropping(arr[i], i, arr)) return arr.slice(0, i + 1); + return []; +} +//#endregion +exports.dropRightWhile = dropRightWhile; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/dropRightWhile.mjs b/tools/ui/node_modules/es-toolkit/dist/array/dropRightWhile.mjs new file mode 100644 index 0000000000000000000000000000000000000000..070a7fde41fca0e491c0b531371b895d3f3e402b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/dropRightWhile.mjs @@ -0,0 +1,25 @@ +//#region src/array/dropRightWhile.ts +/** +* Removes elements from the end of an array until the predicate returns false. +* +* This function iterates over an array from the end and drops elements until the provided +* predicate function returns false. It then returns a new array with the remaining elements. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array from which to drop elements. +* @param {(item: T, index: number, arr: T[]) => boolean} canContinueDropping - A predicate function that determines +* whether to continue dropping elements. The function is called with each element from the end, +* and dropping continues as long as it returns true. +* @returns {T[]} A new array with the elements remaining after the predicate returns false. +* +* @example +* const array = [1, 2, 3, 4, 5]; +* const result = dropRightWhile(array, x => x > 3); +* // result will be [1, 2, 3] since elements greater than 3 are dropped from the end. +*/ +function dropRightWhile(arr, canContinueDropping) { + for (let i = arr.length - 1; i >= 0; i--) if (!canContinueDropping(arr[i], i, arr)) return arr.slice(0, i + 1); + return []; +} +//#endregion +export { dropRightWhile }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/dropWhile.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/dropWhile.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..02fb09a16a5121e9d72f4a82a78508b6085307f2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/dropWhile.d.mts @@ -0,0 +1,22 @@ +//#region src/array/dropWhile.d.ts +/** + * Removes elements from the beginning of an array until the predicate returns false. + * + * This function iterates over an array and drops elements from the start until the provided + * predicate function returns false. It then returns a new array with the remaining elements. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array from which to drop elements. + * @param {(item: T, index: number, arr: T[]) => boolean} canContinueDropping - A predicate function that determines + * whether to continue dropping elements. The function is called with each element, and dropping + * continues as long as it returns true. + * @returns {T[]} A new array with the elements remaining after the predicate returns false. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const result = dropWhile(array, x => x < 3); + * // result will be [3, 4, 5] since elements less than 3 are dropped. + */ +declare function dropWhile(arr: readonly T[], canContinueDropping: (item: T, index: number, arr: readonly T[]) => boolean): T[]; +//#endregion +export { dropWhile }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/dropWhile.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/dropWhile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..02fb09a16a5121e9d72f4a82a78508b6085307f2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/dropWhile.d.ts @@ -0,0 +1,22 @@ +//#region src/array/dropWhile.d.ts +/** + * Removes elements from the beginning of an array until the predicate returns false. + * + * This function iterates over an array and drops elements from the start until the provided + * predicate function returns false. It then returns a new array with the remaining elements. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array from which to drop elements. + * @param {(item: T, index: number, arr: T[]) => boolean} canContinueDropping - A predicate function that determines + * whether to continue dropping elements. The function is called with each element, and dropping + * continues as long as it returns true. + * @returns {T[]} A new array with the elements remaining after the predicate returns false. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const result = dropWhile(array, x => x < 3); + * // result will be [3, 4, 5] since elements less than 3 are dropped. + */ +declare function dropWhile(arr: readonly T[], canContinueDropping: (item: T, index: number, arr: readonly T[]) => boolean): T[]; +//#endregion +export { dropWhile }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/dropWhile.js b/tools/ui/node_modules/es-toolkit/dist/array/dropWhile.js new file mode 100644 index 0000000000000000000000000000000000000000..3fc6d226e8753f96c34f6fc062060a0757f74a5b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/dropWhile.js @@ -0,0 +1,26 @@ +//#region src/array/dropWhile.ts +/** +* Removes elements from the beginning of an array until the predicate returns false. +* +* This function iterates over an array and drops elements from the start until the provided +* predicate function returns false. It then returns a new array with the remaining elements. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array from which to drop elements. +* @param {(item: T, index: number, arr: T[]) => boolean} canContinueDropping - A predicate function that determines +* whether to continue dropping elements. The function is called with each element, and dropping +* continues as long as it returns true. +* @returns {T[]} A new array with the elements remaining after the predicate returns false. +* +* @example +* const array = [1, 2, 3, 4, 5]; +* const result = dropWhile(array, x => x < 3); +* // result will be [3, 4, 5] since elements less than 3 are dropped. +*/ +function dropWhile(arr, canContinueDropping) { + const dropEndIndex = arr.findIndex((item, index, arr) => !canContinueDropping(item, index, arr)); + if (dropEndIndex === -1) return []; + return arr.slice(dropEndIndex); +} +//#endregion +exports.dropWhile = dropWhile; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/dropWhile.mjs b/tools/ui/node_modules/es-toolkit/dist/array/dropWhile.mjs new file mode 100644 index 0000000000000000000000000000000000000000..2cf06436e4675eed1b475b7613370787bef1a43d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/dropWhile.mjs @@ -0,0 +1,26 @@ +//#region src/array/dropWhile.ts +/** +* Removes elements from the beginning of an array until the predicate returns false. +* +* This function iterates over an array and drops elements from the start until the provided +* predicate function returns false. It then returns a new array with the remaining elements. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array from which to drop elements. +* @param {(item: T, index: number, arr: T[]) => boolean} canContinueDropping - A predicate function that determines +* whether to continue dropping elements. The function is called with each element, and dropping +* continues as long as it returns true. +* @returns {T[]} A new array with the elements remaining after the predicate returns false. +* +* @example +* const array = [1, 2, 3, 4, 5]; +* const result = dropWhile(array, x => x < 3); +* // result will be [3, 4, 5] since elements less than 3 are dropped. +*/ +function dropWhile(arr, canContinueDropping) { + const dropEndIndex = arr.findIndex((item, index, arr) => !canContinueDropping(item, index, arr)); + if (dropEndIndex === -1) return []; + return arr.slice(dropEndIndex); +} +//#endregion +export { dropWhile }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/fill.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/fill.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..496747b0b384edddf1ef35784e8a7f37f1838f2f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/fill.d.mts @@ -0,0 +1,86 @@ +//#region src/array/fill.d.ts +/** + * Fills the whole array with a specified value. + * + * This function mutates the original array and replaces its elements with the provided value, starting from the specified + * start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the + * entire array. + * + * @template T - The type of the value to fill the array with. + * @param {unknown[]} array - The array to fill. + * @param {T} value - The value to fill the array with. + * @returns {T[]} The array with the filled values. + * + * @example + * fill([1, 2, 3], 'a'); + * // => ['a', 'a', 'a'] + * + * fill(Array(3), 2); + * // => [2, 2, 2] + * + * fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + * + * fill([1, 2, 3], '*', -2, -1); + * // => [1, '*', 3] + */ +declare function fill(array: unknown[], value: T): T[]; +/** + * Fills elements of an array with a specified value from the start position up to the end of the array. + * + * This function mutates the original array and replaces its elements with the provided value, starting from the specified + * start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the + * entire array. + * + * @template T - The type of elements in the original array. + * @template U - The type of the value to fill the array with. + * @param {Array} array - The array to fill. + * @param {U} value - The value to fill the array with. + * @param {number} [start=0] - The start position. Defaults to 0. + * @returns {Array} The array with the filled values. + * + * @example + * fill([1, 2, 3], 'a'); + * // => ['a', 'a', 'a'] + * + * fill(Array(3), 2); + * // => [2, 2, 2] + * + * fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + * + * fill([1, 2, 3], '*', -2, -1); + * // => [1, '*', 3] + */ +declare function fill(array: Array, value: U, start: number): Array; +/** + * Fills elements of an array with a specified value from the start position up to, but not including, the end position. + * + * This function mutates the original array and replaces its elements with the provided value, starting from the specified + * start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the + * entire array. + * + * @template T - The type of elements in the original array. + * @template U - The type of the value to fill the array with. + * @param {Array} array - The array to fill. + * @param {U} value - The value to fill the array with. + * @param {number} [start=0] - The start position. Defaults to 0. + * @param {number} [end=arr.length] - The end position. Defaults to the array's length. + * @returns {Array} The array with the filled values. + * + * @example + * fill([1, 2, 3], 'a'); + * // => ['a', 'a', 'a'] + * + * fill(Array(3), 2); + * // => [2, 2, 2] + * + * fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + * + * fill([1, 2, 3], '*', -2, -1); + * // => [1, '*', 3] + */ +declare function fill(array: Array, value: U, start: number, end: number): Array; +//#endregion +export { fill }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/fill.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/fill.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..496747b0b384edddf1ef35784e8a7f37f1838f2f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/fill.d.ts @@ -0,0 +1,86 @@ +//#region src/array/fill.d.ts +/** + * Fills the whole array with a specified value. + * + * This function mutates the original array and replaces its elements with the provided value, starting from the specified + * start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the + * entire array. + * + * @template T - The type of the value to fill the array with. + * @param {unknown[]} array - The array to fill. + * @param {T} value - The value to fill the array with. + * @returns {T[]} The array with the filled values. + * + * @example + * fill([1, 2, 3], 'a'); + * // => ['a', 'a', 'a'] + * + * fill(Array(3), 2); + * // => [2, 2, 2] + * + * fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + * + * fill([1, 2, 3], '*', -2, -1); + * // => [1, '*', 3] + */ +declare function fill(array: unknown[], value: T): T[]; +/** + * Fills elements of an array with a specified value from the start position up to the end of the array. + * + * This function mutates the original array and replaces its elements with the provided value, starting from the specified + * start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the + * entire array. + * + * @template T - The type of elements in the original array. + * @template U - The type of the value to fill the array with. + * @param {Array} array - The array to fill. + * @param {U} value - The value to fill the array with. + * @param {number} [start=0] - The start position. Defaults to 0. + * @returns {Array} The array with the filled values. + * + * @example + * fill([1, 2, 3], 'a'); + * // => ['a', 'a', 'a'] + * + * fill(Array(3), 2); + * // => [2, 2, 2] + * + * fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + * + * fill([1, 2, 3], '*', -2, -1); + * // => [1, '*', 3] + */ +declare function fill(array: Array, value: U, start: number): Array; +/** + * Fills elements of an array with a specified value from the start position up to, but not including, the end position. + * + * This function mutates the original array and replaces its elements with the provided value, starting from the specified + * start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the + * entire array. + * + * @template T - The type of elements in the original array. + * @template U - The type of the value to fill the array with. + * @param {Array} array - The array to fill. + * @param {U} value - The value to fill the array with. + * @param {number} [start=0] - The start position. Defaults to 0. + * @param {number} [end=arr.length] - The end position. Defaults to the array's length. + * @returns {Array} The array with the filled values. + * + * @example + * fill([1, 2, 3], 'a'); + * // => ['a', 'a', 'a'] + * + * fill(Array(3), 2); + * // => [2, 2, 2] + * + * fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + * + * fill([1, 2, 3], '*', -2, -1); + * // => [1, '*', 3] + */ +declare function fill(array: Array, value: U, start: number, end: number): Array; +//#endregion +export { fill }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/fill.js b/tools/ui/node_modules/es-toolkit/dist/array/fill.js new file mode 100644 index 0000000000000000000000000000000000000000..51370aaa11ffac563f3fb1ff41b24a10fceaca81 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/fill.js @@ -0,0 +1,38 @@ +//#region src/array/fill.ts +/** +* Fills elements of an array with a specified value from the start position up to, but not including, the end position. +* +* This function mutates the original array and replaces its elements with the provided value, starting from the specified +* start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the +* entire array. +* +* @template T - The type of elements in the original array. +* @template U - The type of the value to fill the array with. +* @param {Array} array - The array to fill. +* @param {U} value - The value to fill the array with. +* @param {number} [start=0] - The start position. Defaults to 0. +* @param {number} [end=arr.length] - The end position. Defaults to the array's length. +* @returns {Array} The array with the filled values. +* +* @example +* fill([1, 2, 3], 'a'); +* // => ['a', 'a', 'a'] +* +* fill(Array(3), 2); +* // => [2, 2, 2] +* +* fill([4, 6, 8, 10], '*', 1, 3); +* // => [4, '*', '*', 10] +* +* fill([1, 2, 3], '*', -2, -1); +* // => [1, '*', 3] +*/ +function fill(array, value, start = 0, end = array.length) { + const length = array.length; + const finalStart = Math.max(start >= 0 ? start : length + start, 0); + const finalEnd = Math.min(end >= 0 ? end : length + end, length); + for (let i = finalStart; i < finalEnd; i++) array[i] = value; + return array; +} +//#endregion +exports.fill = fill; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/fill.mjs b/tools/ui/node_modules/es-toolkit/dist/array/fill.mjs new file mode 100644 index 0000000000000000000000000000000000000000..a895dbf4412e08e3604ad3463dff2d12c4efc1ea --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/fill.mjs @@ -0,0 +1,38 @@ +//#region src/array/fill.ts +/** +* Fills elements of an array with a specified value from the start position up to, but not including, the end position. +* +* This function mutates the original array and replaces its elements with the provided value, starting from the specified +* start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the +* entire array. +* +* @template T - The type of elements in the original array. +* @template U - The type of the value to fill the array with. +* @param {Array} array - The array to fill. +* @param {U} value - The value to fill the array with. +* @param {number} [start=0] - The start position. Defaults to 0. +* @param {number} [end=arr.length] - The end position. Defaults to the array's length. +* @returns {Array} The array with the filled values. +* +* @example +* fill([1, 2, 3], 'a'); +* // => ['a', 'a', 'a'] +* +* fill(Array(3), 2); +* // => [2, 2, 2] +* +* fill([4, 6, 8, 10], '*', 1, 3); +* // => [4, '*', '*', 10] +* +* fill([1, 2, 3], '*', -2, -1); +* // => [1, '*', 3] +*/ +function fill(array, value, start = 0, end = array.length) { + const length = array.length; + const finalStart = Math.max(start >= 0 ? start : length + start, 0); + const finalEnd = Math.min(end >= 0 ? end : length + end, length); + for (let i = finalStart; i < finalEnd; i++) array[i] = value; + return array; +} +//#endregion +export { fill }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/filterAsync.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/filterAsync.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..d5c32fc1412441c2f276685f7fe9e1876d264f7a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/filterAsync.d.mts @@ -0,0 +1,36 @@ +//#region src/array/filterAsync.d.ts +interface FilterAsyncOptions { + concurrency?: number; +} +/** + * Filters an array asynchronously using an async predicate function. + * + * Returns a promise that resolves to a new array containing only the elements + * for which the predicate function returns a truthy value. + * + * @template T - The type of elements in the array. + * @param {readonly T[]} array The array to filter. + * @param {(item: T, index: number, array: readonly T[]) => Promise} predicate An async function that tests each element. + * @param {FilterAsyncOptions} [options] Optional configuration object. + * @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently. + * @returns {Promise} A promise that resolves to the filtered array. + * @example + * const users = [{ id: 1, active: true }, { id: 2, active: false }, { id: 3, active: true }]; + * const activeUsers = await filterAsync(users, async (user) => { + * return await checkUserStatus(user.id); + * }); + * // Returns: [{ id: 1, active: true }, { id: 3, active: true }] + * + * @example + * // With concurrency limit + * const numbers = [1, 2, 3, 4, 5]; + * const evenNumbers = await filterAsync( + * numbers, + * async (n) => await isEvenAsync(n), + * { concurrency: 2 } + * ); + * // Processes at most 2 operations concurrently + */ +declare function filterAsync(array: readonly T[], predicate: (item: T, index: number, array: readonly T[]) => Promise, options?: FilterAsyncOptions): Promise; +//#endregion +export { filterAsync }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/filterAsync.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/filterAsync.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d5c32fc1412441c2f276685f7fe9e1876d264f7a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/filterAsync.d.ts @@ -0,0 +1,36 @@ +//#region src/array/filterAsync.d.ts +interface FilterAsyncOptions { + concurrency?: number; +} +/** + * Filters an array asynchronously using an async predicate function. + * + * Returns a promise that resolves to a new array containing only the elements + * for which the predicate function returns a truthy value. + * + * @template T - The type of elements in the array. + * @param {readonly T[]} array The array to filter. + * @param {(item: T, index: number, array: readonly T[]) => Promise} predicate An async function that tests each element. + * @param {FilterAsyncOptions} [options] Optional configuration object. + * @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently. + * @returns {Promise} A promise that resolves to the filtered array. + * @example + * const users = [{ id: 1, active: true }, { id: 2, active: false }, { id: 3, active: true }]; + * const activeUsers = await filterAsync(users, async (user) => { + * return await checkUserStatus(user.id); + * }); + * // Returns: [{ id: 1, active: true }, { id: 3, active: true }] + * + * @example + * // With concurrency limit + * const numbers = [1, 2, 3, 4, 5]; + * const evenNumbers = await filterAsync( + * numbers, + * async (n) => await isEvenAsync(n), + * { concurrency: 2 } + * ); + * // Processes at most 2 operations concurrently + */ +declare function filterAsync(array: readonly T[], predicate: (item: T, index: number, array: readonly T[]) => Promise, options?: FilterAsyncOptions): Promise; +//#endregion +export { filterAsync }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/filterAsync.js b/tools/ui/node_modules/es-toolkit/dist/array/filterAsync.js new file mode 100644 index 0000000000000000000000000000000000000000..7f310a8905bb4be0ad72205f1c639584aaad0270 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/filterAsync.js @@ -0,0 +1,38 @@ +const require_limitAsync = require("./limitAsync.js"); +//#region src/array/filterAsync.ts +/** +* Filters an array asynchronously using an async predicate function. +* +* Returns a promise that resolves to a new array containing only the elements +* for which the predicate function returns a truthy value. +* +* @template T - The type of elements in the array. +* @param {readonly T[]} array The array to filter. +* @param {(item: T, index: number, array: readonly T[]) => Promise} predicate An async function that tests each element. +* @param {FilterAsyncOptions} [options] Optional configuration object. +* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently. +* @returns {Promise} A promise that resolves to the filtered array. +* @example +* const users = [{ id: 1, active: true }, { id: 2, active: false }, { id: 3, active: true }]; +* const activeUsers = await filterAsync(users, async (user) => { +* return await checkUserStatus(user.id); +* }); +* // Returns: [{ id: 1, active: true }, { id: 3, active: true }] +* +* @example +* // With concurrency limit +* const numbers = [1, 2, 3, 4, 5]; +* const evenNumbers = await filterAsync( +* numbers, +* async (n) => await isEvenAsync(n), +* { concurrency: 2 } +* ); +* // Processes at most 2 operations concurrently +*/ +async function filterAsync(array, predicate, options) { + if (options?.concurrency != null) predicate = require_limitAsync.limitAsync(predicate, options.concurrency); + const results = await Promise.all(array.map(predicate)); + return array.filter((_, index) => results[index]); +} +//#endregion +exports.filterAsync = filterAsync; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/filterAsync.mjs b/tools/ui/node_modules/es-toolkit/dist/array/filterAsync.mjs new file mode 100644 index 0000000000000000000000000000000000000000..3263ac41f8de2a0e6a4c2ed9a8c22c43bdf441a3 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/filterAsync.mjs @@ -0,0 +1,38 @@ +import { limitAsync } from "./limitAsync.mjs"; +//#region src/array/filterAsync.ts +/** +* Filters an array asynchronously using an async predicate function. +* +* Returns a promise that resolves to a new array containing only the elements +* for which the predicate function returns a truthy value. +* +* @template T - The type of elements in the array. +* @param {readonly T[]} array The array to filter. +* @param {(item: T, index: number, array: readonly T[]) => Promise} predicate An async function that tests each element. +* @param {FilterAsyncOptions} [options] Optional configuration object. +* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently. +* @returns {Promise} A promise that resolves to the filtered array. +* @example +* const users = [{ id: 1, active: true }, { id: 2, active: false }, { id: 3, active: true }]; +* const activeUsers = await filterAsync(users, async (user) => { +* return await checkUserStatus(user.id); +* }); +* // Returns: [{ id: 1, active: true }, { id: 3, active: true }] +* +* @example +* // With concurrency limit +* const numbers = [1, 2, 3, 4, 5]; +* const evenNumbers = await filterAsync( +* numbers, +* async (n) => await isEvenAsync(n), +* { concurrency: 2 } +* ); +* // Processes at most 2 operations concurrently +*/ +async function filterAsync(array, predicate, options) { + if (options?.concurrency != null) predicate = limitAsync(predicate, options.concurrency); + const results = await Promise.all(array.map(predicate)); + return array.filter((_, index) => results[index]); +} +//#endregion +export { filterAsync }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flatMap.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/flatMap.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..fc290c724c61a41f7f67ea880a227fe2362f053a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flatMap.d.mts @@ -0,0 +1,24 @@ +//#region src/array/flatMap.d.ts +/** + * Maps each element in the array using the iteratee function and flattens the result up to the specified depth. + * + * @template T - The type of elements within the array. + * @template U - The type of elements within the returned array from the iteratee function. + * @template D - The depth to which the array should be flattened. + * @param {T[]} arr - The array to flatten. + * @param {(item: T, index: number, array: readonly T[]) => U} iteratee - The function that produces the new array elements. It receives the element, its index, and the array. + * @param {D} depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1. + * @returns {Array>} The new array with the mapped and flattened elements. + * + * @example + * const arr = [1, 2, 3]; + * + * flatMap(arr, (item: number) => [item, item]); + * // [1, 1, 2, 2, 3, 3] + * + * flatMap(arr, (item: number) => [[item, item]], 2); + * // [1, 1, 2, 2, 3, 3] + */ +declare function flatMap(arr: readonly T[], iteratee: (item: T, index: number, array: readonly T[]) => U, depth?: D): Array>; +//#endregion +export { flatMap }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flatMap.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/flatMap.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc290c724c61a41f7f67ea880a227fe2362f053a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flatMap.d.ts @@ -0,0 +1,24 @@ +//#region src/array/flatMap.d.ts +/** + * Maps each element in the array using the iteratee function and flattens the result up to the specified depth. + * + * @template T - The type of elements within the array. + * @template U - The type of elements within the returned array from the iteratee function. + * @template D - The depth to which the array should be flattened. + * @param {T[]} arr - The array to flatten. + * @param {(item: T, index: number, array: readonly T[]) => U} iteratee - The function that produces the new array elements. It receives the element, its index, and the array. + * @param {D} depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1. + * @returns {Array>} The new array with the mapped and flattened elements. + * + * @example + * const arr = [1, 2, 3]; + * + * flatMap(arr, (item: number) => [item, item]); + * // [1, 1, 2, 2, 3, 3] + * + * flatMap(arr, (item: number) => [[item, item]], 2); + * // [1, 1, 2, 2, 3, 3] + */ +declare function flatMap(arr: readonly T[], iteratee: (item: T, index: number, array: readonly T[]) => U, depth?: D): Array>; +//#endregion +export { flatMap }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flatMap.js b/tools/ui/node_modules/es-toolkit/dist/array/flatMap.js new file mode 100644 index 0000000000000000000000000000000000000000..502e2532a1a93340164e1fa300f047dc0638bd32 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flatMap.js @@ -0,0 +1,27 @@ +const require_flatten = require("./flatten.js"); +//#region src/array/flatMap.ts +/** +* Maps each element in the array using the iteratee function and flattens the result up to the specified depth. +* +* @template T - The type of elements within the array. +* @template U - The type of elements within the returned array from the iteratee function. +* @template D - The depth to which the array should be flattened. +* @param {T[]} arr - The array to flatten. +* @param {(item: T, index: number, array: readonly T[]) => U} iteratee - The function that produces the new array elements. It receives the element, its index, and the array. +* @param {D} depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1. +* @returns {Array>} The new array with the mapped and flattened elements. +* +* @example +* const arr = [1, 2, 3]; +* +* flatMap(arr, (item: number) => [item, item]); +* // [1, 1, 2, 2, 3, 3] +* +* flatMap(arr, (item: number) => [[item, item]], 2); +* // [1, 1, 2, 2, 3, 3] +*/ +function flatMap(arr, iteratee, depth = 1) { + return require_flatten.flatten(arr.map((item, index) => iteratee(item, index, arr)), depth); +} +//#endregion +exports.flatMap = flatMap; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flatMap.mjs b/tools/ui/node_modules/es-toolkit/dist/array/flatMap.mjs new file mode 100644 index 0000000000000000000000000000000000000000..62b4f88e7fd689dc627ec0ebefb9c65de0c90410 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flatMap.mjs @@ -0,0 +1,27 @@ +import { flatten } from "./flatten.mjs"; +//#region src/array/flatMap.ts +/** +* Maps each element in the array using the iteratee function and flattens the result up to the specified depth. +* +* @template T - The type of elements within the array. +* @template U - The type of elements within the returned array from the iteratee function. +* @template D - The depth to which the array should be flattened. +* @param {T[]} arr - The array to flatten. +* @param {(item: T, index: number, array: readonly T[]) => U} iteratee - The function that produces the new array elements. It receives the element, its index, and the array. +* @param {D} depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1. +* @returns {Array>} The new array with the mapped and flattened elements. +* +* @example +* const arr = [1, 2, 3]; +* +* flatMap(arr, (item: number) => [item, item]); +* // [1, 1, 2, 2, 3, 3] +* +* flatMap(arr, (item: number) => [[item, item]], 2); +* // [1, 1, 2, 2, 3, 3] +*/ +function flatMap(arr, iteratee, depth = 1) { + return flatten(arr.map((item, index) => iteratee(item, index, arr)), depth); +} +//#endregion +export { flatMap }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flatMapAsync.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/flatMapAsync.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..fb3430f8ddb36fc6abc31ac0df14c7d217939bb4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flatMapAsync.d.mts @@ -0,0 +1,38 @@ +//#region src/array/flatMapAsync.d.ts +interface FlatMapAsyncOptions { + concurrency?: number; +} +/** + * Maps each element in an array using an async callback function and flattens the result by one level. + * + * This is equivalent to calling `mapAsync` followed by `flat(1)`, but more efficient. + * Each callback should return an array, and all returned arrays are concatenated into + * a single output array. + * + * @template T - The type of elements in the input array. + * @template R - The type of elements in the arrays returned by the callback. + * @param {readonly T[]} array The array to transform. + * @param {(item: T, index: number, array: readonly T[]) => Promise} callback An async function that transforms each element into an array. + * @param {FlatMapAsyncOptions} [options] Optional configuration object. + * @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently. + * @returns {Promise} A promise that resolves to a flattened array of transformed values. + * @example + * const users = [{ id: 1 }, { id: 2 }]; + * const allPosts = await flatMapAsync(users, async (user) => { + * return await fetchUserPosts(user.id); + * }); + * // Returns: [post1, post2, post3, ...] (all posts from all users) + * + * @example + * // With concurrency limit + * const numbers = [1, 2, 3]; + * const results = await flatMapAsync( + * numbers, + * async (n) => await fetchRelatedItems(n), + * { concurrency: 2 } + * ); + * // Processes at most 2 operations concurrently + */ +declare function flatMapAsync(array: readonly T[], callback: (item: T, index: number, array: readonly T[]) => Promise, options?: FlatMapAsyncOptions): Promise; +//#endregion +export { flatMapAsync }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flatMapAsync.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/flatMapAsync.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fb3430f8ddb36fc6abc31ac0df14c7d217939bb4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flatMapAsync.d.ts @@ -0,0 +1,38 @@ +//#region src/array/flatMapAsync.d.ts +interface FlatMapAsyncOptions { + concurrency?: number; +} +/** + * Maps each element in an array using an async callback function and flattens the result by one level. + * + * This is equivalent to calling `mapAsync` followed by `flat(1)`, but more efficient. + * Each callback should return an array, and all returned arrays are concatenated into + * a single output array. + * + * @template T - The type of elements in the input array. + * @template R - The type of elements in the arrays returned by the callback. + * @param {readonly T[]} array The array to transform. + * @param {(item: T, index: number, array: readonly T[]) => Promise} callback An async function that transforms each element into an array. + * @param {FlatMapAsyncOptions} [options] Optional configuration object. + * @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently. + * @returns {Promise} A promise that resolves to a flattened array of transformed values. + * @example + * const users = [{ id: 1 }, { id: 2 }]; + * const allPosts = await flatMapAsync(users, async (user) => { + * return await fetchUserPosts(user.id); + * }); + * // Returns: [post1, post2, post3, ...] (all posts from all users) + * + * @example + * // With concurrency limit + * const numbers = [1, 2, 3]; + * const results = await flatMapAsync( + * numbers, + * async (n) => await fetchRelatedItems(n), + * { concurrency: 2 } + * ); + * // Processes at most 2 operations concurrently + */ +declare function flatMapAsync(array: readonly T[], callback: (item: T, index: number, array: readonly T[]) => Promise, options?: FlatMapAsyncOptions): Promise; +//#endregion +export { flatMapAsync }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flatMapAsync.js b/tools/ui/node_modules/es-toolkit/dist/array/flatMapAsync.js new file mode 100644 index 0000000000000000000000000000000000000000..a3b8e4aec521d365e7367965533c7b59c1585d4c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flatMapAsync.js @@ -0,0 +1,41 @@ +const require_limitAsync = require("./limitAsync.js"); +const require_flatten = require("./flatten.js"); +//#region src/array/flatMapAsync.ts +/** +* Maps each element in an array using an async callback function and flattens the result by one level. +* +* This is equivalent to calling `mapAsync` followed by `flat(1)`, but more efficient. +* Each callback should return an array, and all returned arrays are concatenated into +* a single output array. +* +* @template T - The type of elements in the input array. +* @template R - The type of elements in the arrays returned by the callback. +* @param {readonly T[]} array The array to transform. +* @param {(item: T, index: number, array: readonly T[]) => Promise} callback An async function that transforms each element into an array. +* @param {FlatMapAsyncOptions} [options] Optional configuration object. +* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently. +* @returns {Promise} A promise that resolves to a flattened array of transformed values. +* @example +* const users = [{ id: 1 }, { id: 2 }]; +* const allPosts = await flatMapAsync(users, async (user) => { +* return await fetchUserPosts(user.id); +* }); +* // Returns: [post1, post2, post3, ...] (all posts from all users) +* +* @example +* // With concurrency limit +* const numbers = [1, 2, 3]; +* const results = await flatMapAsync( +* numbers, +* async (n) => await fetchRelatedItems(n), +* { concurrency: 2 } +* ); +* // Processes at most 2 operations concurrently +*/ +async function flatMapAsync(array, callback, options) { + if (options?.concurrency != null) callback = require_limitAsync.limitAsync(callback, options.concurrency); + const results = await Promise.all(array.map(callback)); + return require_flatten.flatten(results); +} +//#endregion +exports.flatMapAsync = flatMapAsync; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flatMapAsync.mjs b/tools/ui/node_modules/es-toolkit/dist/array/flatMapAsync.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d5fab2a43d3d7c0e14e25cce8b1741b390e9aa01 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flatMapAsync.mjs @@ -0,0 +1,40 @@ +import { limitAsync } from "./limitAsync.mjs"; +import { flatten } from "./flatten.mjs"; +//#region src/array/flatMapAsync.ts +/** +* Maps each element in an array using an async callback function and flattens the result by one level. +* +* This is equivalent to calling `mapAsync` followed by `flat(1)`, but more efficient. +* Each callback should return an array, and all returned arrays are concatenated into +* a single output array. +* +* @template T - The type of elements in the input array. +* @template R - The type of elements in the arrays returned by the callback. +* @param {readonly T[]} array The array to transform. +* @param {(item: T, index: number, array: readonly T[]) => Promise} callback An async function that transforms each element into an array. +* @param {FlatMapAsyncOptions} [options] Optional configuration object. +* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently. +* @returns {Promise} A promise that resolves to a flattened array of transformed values. +* @example +* const users = [{ id: 1 }, { id: 2 }]; +* const allPosts = await flatMapAsync(users, async (user) => { +* return await fetchUserPosts(user.id); +* }); +* // Returns: [post1, post2, post3, ...] (all posts from all users) +* +* @example +* // With concurrency limit +* const numbers = [1, 2, 3]; +* const results = await flatMapAsync( +* numbers, +* async (n) => await fetchRelatedItems(n), +* { concurrency: 2 } +* ); +* // Processes at most 2 operations concurrently +*/ +async function flatMapAsync(array, callback, options) { + if (options?.concurrency != null) callback = limitAsync(callback, options.concurrency); + return flatten(await Promise.all(array.map(callback))); +} +//#endregion +export { flatMapAsync }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flatMapDeep.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/flatMapDeep.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..9511b83d9c61b4663992f095a9158a09b2da1504 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flatMapDeep.d.mts @@ -0,0 +1,19 @@ +import { ExtractNestedArrayType } from "./flattenDeep.mjs"; + +//#region src/array/flatMapDeep.d.ts +/** + * Recursively maps each element in an array using a provided iteratee function and then deeply flattens the resulting array. + * + * @template T - The type of elements within the array. + * @template U - The type of elements within the returned array from the iteratee function. + * @param {T[]} arr - The array to flatten. + * @param {(item: T, index: number, array: readonly T[]) => U} iteratee - The function that produces the new array elements. It receives the element, its index, and the array. + * @returns {Array>} A new array that has been flattened. + * + * @example + * const result = flatMapDeep([1, 2, 3], n => [[n, n]]); + * // [1, 1, 2, 2, 3, 3] + */ +declare function flatMapDeep(arr: readonly T[], iteratee: (item: T, index: number, array: readonly T[]) => U): Array>; +//#endregion +export { flatMapDeep }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flatMapDeep.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/flatMapDeep.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d588a1e9e2a3e51988ac297fbea593c0d1fcd69c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flatMapDeep.d.ts @@ -0,0 +1,19 @@ +import { ExtractNestedArrayType } from "./flattenDeep.js"; + +//#region src/array/flatMapDeep.d.ts +/** + * Recursively maps each element in an array using a provided iteratee function and then deeply flattens the resulting array. + * + * @template T - The type of elements within the array. + * @template U - The type of elements within the returned array from the iteratee function. + * @param {T[]} arr - The array to flatten. + * @param {(item: T, index: number, array: readonly T[]) => U} iteratee - The function that produces the new array elements. It receives the element, its index, and the array. + * @returns {Array>} A new array that has been flattened. + * + * @example + * const result = flatMapDeep([1, 2, 3], n => [[n, n]]); + * // [1, 1, 2, 2, 3, 3] + */ +declare function flatMapDeep(arr: readonly T[], iteratee: (item: T, index: number, array: readonly T[]) => U): Array>; +//#endregion +export { flatMapDeep }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flatMapDeep.js b/tools/ui/node_modules/es-toolkit/dist/array/flatMapDeep.js new file mode 100644 index 0000000000000000000000000000000000000000..6ddcb684f881bbb0a37c04b4873aec4593a958d6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flatMapDeep.js @@ -0,0 +1,20 @@ +const require_flattenDeep = require("./flattenDeep.js"); +//#region src/array/flatMapDeep.ts +/** +* Recursively maps each element in an array using a provided iteratee function and then deeply flattens the resulting array. +* +* @template T - The type of elements within the array. +* @template U - The type of elements within the returned array from the iteratee function. +* @param {T[]} arr - The array to flatten. +* @param {(item: T, index: number, array: readonly T[]) => U} iteratee - The function that produces the new array elements. It receives the element, its index, and the array. +* @returns {Array>} A new array that has been flattened. +* +* @example +* const result = flatMapDeep([1, 2, 3], n => [[n, n]]); +* // [1, 1, 2, 2, 3, 3] +*/ +function flatMapDeep(arr, iteratee) { + return require_flattenDeep.flattenDeep(arr.map((item, index) => iteratee(item, index, arr))); +} +//#endregion +exports.flatMapDeep = flatMapDeep; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flatMapDeep.mjs b/tools/ui/node_modules/es-toolkit/dist/array/flatMapDeep.mjs new file mode 100644 index 0000000000000000000000000000000000000000..0d9c77a418d4280f7aa8abb380bf123d00c8f20f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flatMapDeep.mjs @@ -0,0 +1,20 @@ +import { flattenDeep } from "./flattenDeep.mjs"; +//#region src/array/flatMapDeep.ts +/** +* Recursively maps each element in an array using a provided iteratee function and then deeply flattens the resulting array. +* +* @template T - The type of elements within the array. +* @template U - The type of elements within the returned array from the iteratee function. +* @param {T[]} arr - The array to flatten. +* @param {(item: T, index: number, array: readonly T[]) => U} iteratee - The function that produces the new array elements. It receives the element, its index, and the array. +* @returns {Array>} A new array that has been flattened. +* +* @example +* const result = flatMapDeep([1, 2, 3], n => [[n, n]]); +* // [1, 1, 2, 2, 3, 3] +*/ +function flatMapDeep(arr, iteratee) { + return flattenDeep(arr.map((item, index) => iteratee(item, index, arr))); +} +//#endregion +export { flatMapDeep }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flatten.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/flatten.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..b8de9946bf9830dc97e95709be9fe972704b46f9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flatten.d.mts @@ -0,0 +1,20 @@ +//#region src/array/flatten.d.ts +/** + * Flattens an array up to the specified depth. + * + * @template T - The type of elements within the array. + * @template D - The depth to which the array should be flattened. + * @param {T[]} arr - The array to flatten. + * @param {D} depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1. + * @returns {Array>} A new array that has been flattened. + * + * @example + * const arr = flatten([1, [2, 3], [4, [5, 6]]], 1); + * // Returns: [1, 2, 3, 4, [5, 6]] + * + * const arr = flatten([1, [2, 3], [4, [5, 6]]], 2); + * // Returns: [1, 2, 3, 4, 5, 6] + */ +declare function flatten(arr: readonly T[], depth?: D): Array>; +//#endregion +export { flatten }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flatten.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/flatten.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b8de9946bf9830dc97e95709be9fe972704b46f9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flatten.d.ts @@ -0,0 +1,20 @@ +//#region src/array/flatten.d.ts +/** + * Flattens an array up to the specified depth. + * + * @template T - The type of elements within the array. + * @template D - The depth to which the array should be flattened. + * @param {T[]} arr - The array to flatten. + * @param {D} depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1. + * @returns {Array>} A new array that has been flattened. + * + * @example + * const arr = flatten([1, [2, 3], [4, [5, 6]]], 1); + * // Returns: [1, 2, 3, 4, [5, 6]] + * + * const arr = flatten([1, [2, 3], [4, [5, 6]]], 2); + * // Returns: [1, 2, 3, 4, 5, 6] + */ +declare function flatten(arr: readonly T[], depth?: D): Array>; +//#endregion +export { flatten }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flatten.js b/tools/ui/node_modules/es-toolkit/dist/array/flatten.js new file mode 100644 index 0000000000000000000000000000000000000000..fa763a4675eae35c94b8ef2493c74196e74209b1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flatten.js @@ -0,0 +1,32 @@ +//#region src/array/flatten.ts +/** +* Flattens an array up to the specified depth. +* +* @template T - The type of elements within the array. +* @template D - The depth to which the array should be flattened. +* @param {T[]} arr - The array to flatten. +* @param {D} depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1. +* @returns {Array>} A new array that has been flattened. +* +* @example +* const arr = flatten([1, [2, 3], [4, [5, 6]]], 1); +* // Returns: [1, 2, 3, 4, [5, 6]] +* +* const arr = flatten([1, [2, 3], [4, [5, 6]]], 2); +* // Returns: [1, 2, 3, 4, 5, 6] +*/ +function flatten(arr, depth = 1) { + const result = []; + const flooredDepth = Math.floor(depth); + const recursive = (arr, currentDepth) => { + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + if (Array.isArray(item) && currentDepth < flooredDepth) recursive(item, currentDepth + 1); + else result.push(item); + } + }; + recursive(arr, 0); + return result; +} +//#endregion +exports.flatten = flatten; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flatten.mjs b/tools/ui/node_modules/es-toolkit/dist/array/flatten.mjs new file mode 100644 index 0000000000000000000000000000000000000000..ed82d466eee7596b94f189307cf48ed1b2f10a30 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flatten.mjs @@ -0,0 +1,32 @@ +//#region src/array/flatten.ts +/** +* Flattens an array up to the specified depth. +* +* @template T - The type of elements within the array. +* @template D - The depth to which the array should be flattened. +* @param {T[]} arr - The array to flatten. +* @param {D} depth - The depth level specifying how deep a nested array structure should be flattened. Defaults to 1. +* @returns {Array>} A new array that has been flattened. +* +* @example +* const arr = flatten([1, [2, 3], [4, [5, 6]]], 1); +* // Returns: [1, 2, 3, 4, [5, 6]] +* +* const arr = flatten([1, [2, 3], [4, [5, 6]]], 2); +* // Returns: [1, 2, 3, 4, 5, 6] +*/ +function flatten(arr, depth = 1) { + const result = []; + const flooredDepth = Math.floor(depth); + const recursive = (arr, currentDepth) => { + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + if (Array.isArray(item) && currentDepth < flooredDepth) recursive(item, currentDepth + 1); + else result.push(item); + } + }; + recursive(arr, 0); + return result; +} +//#endregion +export { flatten }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flattenDeep.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/flattenDeep.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..31348253b0cd6594cd252f8f900a057c03359004 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flattenDeep.d.mts @@ -0,0 +1,26 @@ +//#region src/array/flattenDeep.d.ts +/** + * Utility type for recursively unpacking nested array types to extract the type of the innermost element + * + * @example + * ExtractNestedArrayType<(number | (number | number[])[])[]> + * // number + * + * ExtractNestedArrayType<(boolean | (string | number[])[])[]> + * // string | number | boolean + */ +type ExtractNestedArrayType = T extends ReadonlyArray ? ExtractNestedArrayType : T; +/** + * Flattens all depths of a nested array. + * + * @template T - The type of elements within the array. + * @param {T[]} arr - The array to flatten. + * @returns {Array>} A new array that has been flattened. + * + * @example + * const arr = flattenDeep([1, [2, [3]], [4, [5, 6]]]); + * // Returns: [1, 2, 3, 4, 5, 6] + */ +declare function flattenDeep(arr: readonly T[]): Array>; +//#endregion +export { ExtractNestedArrayType, flattenDeep }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flattenDeep.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/flattenDeep.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..31348253b0cd6594cd252f8f900a057c03359004 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flattenDeep.d.ts @@ -0,0 +1,26 @@ +//#region src/array/flattenDeep.d.ts +/** + * Utility type for recursively unpacking nested array types to extract the type of the innermost element + * + * @example + * ExtractNestedArrayType<(number | (number | number[])[])[]> + * // number + * + * ExtractNestedArrayType<(boolean | (string | number[])[])[]> + * // string | number | boolean + */ +type ExtractNestedArrayType = T extends ReadonlyArray ? ExtractNestedArrayType : T; +/** + * Flattens all depths of a nested array. + * + * @template T - The type of elements within the array. + * @param {T[]} arr - The array to flatten. + * @returns {Array>} A new array that has been flattened. + * + * @example + * const arr = flattenDeep([1, [2, [3]], [4, [5, 6]]]); + * // Returns: [1, 2, 3, 4, 5, 6] + */ +declare function flattenDeep(arr: readonly T[]): Array>; +//#endregion +export { ExtractNestedArrayType, flattenDeep }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flattenDeep.js b/tools/ui/node_modules/es-toolkit/dist/array/flattenDeep.js new file mode 100644 index 0000000000000000000000000000000000000000..61264530c3ef1cd092f7aea8b8fa7944a150a687 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flattenDeep.js @@ -0,0 +1,18 @@ +const require_flatten = require("./flatten.js"); +//#region src/array/flattenDeep.ts +/** +* Flattens all depths of a nested array. +* +* @template T - The type of elements within the array. +* @param {T[]} arr - The array to flatten. +* @returns {Array>} A new array that has been flattened. +* +* @example +* const arr = flattenDeep([1, [2, [3]], [4, [5, 6]]]); +* // Returns: [1, 2, 3, 4, 5, 6] +*/ +function flattenDeep(arr) { + return require_flatten.flatten(arr, Infinity); +} +//#endregion +exports.flattenDeep = flattenDeep; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/flattenDeep.mjs b/tools/ui/node_modules/es-toolkit/dist/array/flattenDeep.mjs new file mode 100644 index 0000000000000000000000000000000000000000..9acff7d12452ad14a618751054687e584c70b7f6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/flattenDeep.mjs @@ -0,0 +1,18 @@ +import { flatten } from "./flatten.mjs"; +//#region src/array/flattenDeep.ts +/** +* Flattens all depths of a nested array. +* +* @template T - The type of elements within the array. +* @param {T[]} arr - The array to flatten. +* @returns {Array>} A new array that has been flattened. +* +* @example +* const arr = flattenDeep([1, [2, [3]], [4, [5, 6]]]); +* // Returns: [1, 2, 3, 4, 5, 6] +*/ +function flattenDeep(arr) { + return flatten(arr, Infinity); +} +//#endregion +export { flattenDeep }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/forEachAsync.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/forEachAsync.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..d0c2fc724ba113a6e31b919a6df8619d14b7f405 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/forEachAsync.d.mts @@ -0,0 +1,36 @@ +//#region src/array/forEachAsync.d.ts +interface ForEachAsyncOptions { + concurrency?: number; +} +/** + * Executes an async callback function for each element in an array. + * + * Unlike the native `forEach`, this function returns a promise that resolves + * when all async operations complete. It supports optional concurrency limiting. + * + * @template T - The type of elements in the array. + * @param {readonly T[]} array The array to iterate over. + * @param {(item: T, index: number, array: readonly T[]) => Promise} callback An async function to execute for each element. + * @param {ForEachAsyncOptions} [options] Optional configuration object. + * @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently. + * @returns {Promise} A promise that resolves when all operations complete. + * @example + * const users = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * await forEachAsync(users, async (user) => { + * await updateUser(user.id); + * }); + * // All users have been updated + * + * @example + * // With concurrency limit + * const items = [1, 2, 3, 4, 5]; + * await forEachAsync( + * items, + * async (item) => await processItem(item), + * { concurrency: 2 } + * ); + * // Processes at most 2 items concurrently + */ +declare function forEachAsync(array: readonly T[], callback: (item: T, index: number, array: readonly T[]) => Promise, options?: ForEachAsyncOptions): Promise; +//#endregion +export { forEachAsync }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/forEachAsync.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/forEachAsync.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d0c2fc724ba113a6e31b919a6df8619d14b7f405 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/forEachAsync.d.ts @@ -0,0 +1,36 @@ +//#region src/array/forEachAsync.d.ts +interface ForEachAsyncOptions { + concurrency?: number; +} +/** + * Executes an async callback function for each element in an array. + * + * Unlike the native `forEach`, this function returns a promise that resolves + * when all async operations complete. It supports optional concurrency limiting. + * + * @template T - The type of elements in the array. + * @param {readonly T[]} array The array to iterate over. + * @param {(item: T, index: number, array: readonly T[]) => Promise} callback An async function to execute for each element. + * @param {ForEachAsyncOptions} [options] Optional configuration object. + * @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently. + * @returns {Promise} A promise that resolves when all operations complete. + * @example + * const users = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * await forEachAsync(users, async (user) => { + * await updateUser(user.id); + * }); + * // All users have been updated + * + * @example + * // With concurrency limit + * const items = [1, 2, 3, 4, 5]; + * await forEachAsync( + * items, + * async (item) => await processItem(item), + * { concurrency: 2 } + * ); + * // Processes at most 2 items concurrently + */ +declare function forEachAsync(array: readonly T[], callback: (item: T, index: number, array: readonly T[]) => Promise, options?: ForEachAsyncOptions): Promise; +//#endregion +export { forEachAsync }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/forEachAsync.js b/tools/ui/node_modules/es-toolkit/dist/array/forEachAsync.js new file mode 100644 index 0000000000000000000000000000000000000000..3ce0c019513c569901048ca90e7b02eafe6cd9d4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/forEachAsync.js @@ -0,0 +1,37 @@ +const require_limitAsync = require("./limitAsync.js"); +//#region src/array/forEachAsync.ts +/** +* Executes an async callback function for each element in an array. +* +* Unlike the native `forEach`, this function returns a promise that resolves +* when all async operations complete. It supports optional concurrency limiting. +* +* @template T - The type of elements in the array. +* @param {readonly T[]} array The array to iterate over. +* @param {(item: T, index: number, array: readonly T[]) => Promise} callback An async function to execute for each element. +* @param {ForEachAsyncOptions} [options] Optional configuration object. +* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently. +* @returns {Promise} A promise that resolves when all operations complete. +* @example +* const users = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* await forEachAsync(users, async (user) => { +* await updateUser(user.id); +* }); +* // All users have been updated +* +* @example +* // With concurrency limit +* const items = [1, 2, 3, 4, 5]; +* await forEachAsync( +* items, +* async (item) => await processItem(item), +* { concurrency: 2 } +* ); +* // Processes at most 2 items concurrently +*/ +async function forEachAsync(array, callback, options) { + if (options?.concurrency != null) callback = require_limitAsync.limitAsync(callback, options.concurrency); + await Promise.all(array.map(callback)); +} +//#endregion +exports.forEachAsync = forEachAsync; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/forEachAsync.mjs b/tools/ui/node_modules/es-toolkit/dist/array/forEachAsync.mjs new file mode 100644 index 0000000000000000000000000000000000000000..ec75306194c716115f75213563ffbf73b8436615 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/forEachAsync.mjs @@ -0,0 +1,37 @@ +import { limitAsync } from "./limitAsync.mjs"; +//#region src/array/forEachAsync.ts +/** +* Executes an async callback function for each element in an array. +* +* Unlike the native `forEach`, this function returns a promise that resolves +* when all async operations complete. It supports optional concurrency limiting. +* +* @template T - The type of elements in the array. +* @param {readonly T[]} array The array to iterate over. +* @param {(item: T, index: number, array: readonly T[]) => Promise} callback An async function to execute for each element. +* @param {ForEachAsyncOptions} [options] Optional configuration object. +* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently. +* @returns {Promise} A promise that resolves when all operations complete. +* @example +* const users = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* await forEachAsync(users, async (user) => { +* await updateUser(user.id); +* }); +* // All users have been updated +* +* @example +* // With concurrency limit +* const items = [1, 2, 3, 4, 5]; +* await forEachAsync( +* items, +* async (item) => await processItem(item), +* { concurrency: 2 } +* ); +* // Processes at most 2 items concurrently +*/ +async function forEachAsync(array, callback, options) { + if (options?.concurrency != null) callback = limitAsync(callback, options.concurrency); + await Promise.all(array.map(callback)); +} +//#endregion +export { forEachAsync }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/forEachRight.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/forEachRight.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..97eb972aad2f387552bd0508c68c0b9a7f99c368 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/forEachRight.d.mts @@ -0,0 +1,49 @@ +//#region src/array/forEachRight.d.ts +/** + * Iterates over elements of 'arr' from right to left and invokes 'callback' for each element. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to iterate over. + * @param {(value: T, index: number, arr: T[]) => void} callback - The function invoked per iteration. + * The callback function receives three arguments: + * - 'value': The current element being processed in the array. + * - 'index': The index of the current element being processed in the array. + * - 'arr': The array 'forEachRight' was called upon. + * + * @example + * const array = [1, 2, 3]; + * const result: number[] = []; + * + * // Use the forEachRight function to iterate through the array and add each element to the result array. + * forEachRight(array, (value) => { + * result.push(value); + * }) + * + * console.log(result) // Output: [3, 2, 1] + */ +declare function forEachRight(arr: T[], callback: (value: T, index: number, arr: T[]) => void): void; +/** + * Iterates over elements of 'arr' from right to left and invokes 'callback' for each element. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to iterate over. + * @param {(value: T, index: number, arr: T[]) => void} callback - The function invoked per iteration. + * The callback function receives three arguments: + * - 'value': The current element being processed in the array. + * - 'index': The index of the current element being processed in the array. + * - 'arr': The array 'forEachRight' was called upon. + * + * @example + * const array = [1, 2, 3]; + * const result: number[] = []; + * + * // Use the forEachRight function to iterate through the array and add each element to the result array. + * forEachRight(array, (value) => { + * result.push(value); + * }) + * + * console.log(result) // Output: [3, 2, 1] + */ +declare function forEachRight(arr: readonly T[], callback: (value: T, index: number, arr: readonly T[]) => void): void; +//#endregion +export { forEachRight }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/forEachRight.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/forEachRight.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..97eb972aad2f387552bd0508c68c0b9a7f99c368 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/forEachRight.d.ts @@ -0,0 +1,49 @@ +//#region src/array/forEachRight.d.ts +/** + * Iterates over elements of 'arr' from right to left and invokes 'callback' for each element. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to iterate over. + * @param {(value: T, index: number, arr: T[]) => void} callback - The function invoked per iteration. + * The callback function receives three arguments: + * - 'value': The current element being processed in the array. + * - 'index': The index of the current element being processed in the array. + * - 'arr': The array 'forEachRight' was called upon. + * + * @example + * const array = [1, 2, 3]; + * const result: number[] = []; + * + * // Use the forEachRight function to iterate through the array and add each element to the result array. + * forEachRight(array, (value) => { + * result.push(value); + * }) + * + * console.log(result) // Output: [3, 2, 1] + */ +declare function forEachRight(arr: T[], callback: (value: T, index: number, arr: T[]) => void): void; +/** + * Iterates over elements of 'arr' from right to left and invokes 'callback' for each element. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to iterate over. + * @param {(value: T, index: number, arr: T[]) => void} callback - The function invoked per iteration. + * The callback function receives three arguments: + * - 'value': The current element being processed in the array. + * - 'index': The index of the current element being processed in the array. + * - 'arr': The array 'forEachRight' was called upon. + * + * @example + * const array = [1, 2, 3]; + * const result: number[] = []; + * + * // Use the forEachRight function to iterate through the array and add each element to the result array. + * forEachRight(array, (value) => { + * result.push(value); + * }) + * + * console.log(result) // Output: [3, 2, 1] + */ +declare function forEachRight(arr: readonly T[], callback: (value: T, index: number, arr: readonly T[]) => void): void; +//#endregion +export { forEachRight }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/forEachRight.js b/tools/ui/node_modules/es-toolkit/dist/array/forEachRight.js new file mode 100644 index 0000000000000000000000000000000000000000..40a6edbc4bf0b46077777d86504a423a830d9638 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/forEachRight.js @@ -0,0 +1,31 @@ +//#region src/array/forEachRight.ts +/** +* Iterates over elements of 'arr' from right to left and invokes 'callback' for each element. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array to iterate over. +* @param {(value: T, index: number, arr: T[]) => void} callback - The function invoked per iteration. +* The callback function receives three arguments: +* - 'value': The current element being processed in the array. +* - 'index': The index of the current element being processed in the array. +* - 'arr': The array 'forEachRight' was called upon. +* +* @example +* const array = [1, 2, 3]; +* const result: number[] = []; +* +* // Use the forEachRight function to iterate through the array and add each element to the result array. +* forEachRight(array, (value) => { +* result.push(value); +* }) +* +* console.log(result) // Output: [3, 2, 1] +*/ +function forEachRight(arr, callback) { + for (let i = arr.length - 1; i >= 0; i--) { + const element = arr[i]; + callback(element, i, arr); + } +} +//#endregion +exports.forEachRight = forEachRight; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/forEachRight.mjs b/tools/ui/node_modules/es-toolkit/dist/array/forEachRight.mjs new file mode 100644 index 0000000000000000000000000000000000000000..3c8dc4ff1a91ef0de7810a2fc0a3887db7551788 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/forEachRight.mjs @@ -0,0 +1,31 @@ +//#region src/array/forEachRight.ts +/** +* Iterates over elements of 'arr' from right to left and invokes 'callback' for each element. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array to iterate over. +* @param {(value: T, index: number, arr: T[]) => void} callback - The function invoked per iteration. +* The callback function receives three arguments: +* - 'value': The current element being processed in the array. +* - 'index': The index of the current element being processed in the array. +* - 'arr': The array 'forEachRight' was called upon. +* +* @example +* const array = [1, 2, 3]; +* const result: number[] = []; +* +* // Use the forEachRight function to iterate through the array and add each element to the result array. +* forEachRight(array, (value) => { +* result.push(value); +* }) +* +* console.log(result) // Output: [3, 2, 1] +*/ +function forEachRight(arr, callback) { + for (let i = arr.length - 1; i >= 0; i--) { + const element = arr[i]; + callback(element, i, arr); + } +} +//#endregion +export { forEachRight }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/groupBy.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/groupBy.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..619453a47242cd3d04aee10db2dc7b29deff6197 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/groupBy.d.mts @@ -0,0 +1,42 @@ +//#region src/array/groupBy.d.ts +/** + * Groups the elements of an array based on a provided key-generating function. + * + * This function takes an array and a function that generates a key from each element. It returns + * an object where the keys are the generated keys and the values are arrays of elements that share + * the same key. + * + * @template T - The type of elements in the array. + * @template K - The type of keys. + * @param {T[]} arr - The array to group. + * @param {(item: T, index: number, array: readonly T[]) => K} getKeyFromItem - A function that generates a key from an element, its index, and the array. + * @returns {Record} An object where each key is associated with an array of elements that + * share that key. + * + * @example + * const array = [ + * { category: 'fruit', name: 'apple' }, + * { category: 'fruit', name: 'banana' }, + * { category: 'vegetable', name: 'carrot' } + * ]; + * const result = groupBy(array, item => item.category); + * // result will be: + * // { + * // fruit: [ + * // { category: 'fruit', name: 'apple' }, + * // { category: 'fruit', name: 'banana' } + * // ], + * // vegetable: [ + * // { category: 'vegetable', name: 'carrot' } + * // ] + * // } + * + * @example + * // Using index parameter + * const items = ['a', 'b', 'c', 'd']; + * const result = groupBy(items, (item, index) => index % 2 === 0 ? 'even' : 'odd'); + * // result will be: { even: ['a', 'c'], odd: ['b', 'd'] } + */ +declare function groupBy(arr: readonly T[], getKeyFromItem: (item: T, index: number, array: readonly T[]) => K): Record; +//#endregion +export { groupBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/groupBy.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/groupBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..619453a47242cd3d04aee10db2dc7b29deff6197 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/groupBy.d.ts @@ -0,0 +1,42 @@ +//#region src/array/groupBy.d.ts +/** + * Groups the elements of an array based on a provided key-generating function. + * + * This function takes an array and a function that generates a key from each element. It returns + * an object where the keys are the generated keys and the values are arrays of elements that share + * the same key. + * + * @template T - The type of elements in the array. + * @template K - The type of keys. + * @param {T[]} arr - The array to group. + * @param {(item: T, index: number, array: readonly T[]) => K} getKeyFromItem - A function that generates a key from an element, its index, and the array. + * @returns {Record} An object where each key is associated with an array of elements that + * share that key. + * + * @example + * const array = [ + * { category: 'fruit', name: 'apple' }, + * { category: 'fruit', name: 'banana' }, + * { category: 'vegetable', name: 'carrot' } + * ]; + * const result = groupBy(array, item => item.category); + * // result will be: + * // { + * // fruit: [ + * // { category: 'fruit', name: 'apple' }, + * // { category: 'fruit', name: 'banana' } + * // ], + * // vegetable: [ + * // { category: 'vegetable', name: 'carrot' } + * // ] + * // } + * + * @example + * // Using index parameter + * const items = ['a', 'b', 'c', 'd']; + * const result = groupBy(items, (item, index) => index % 2 === 0 ? 'even' : 'odd'); + * // result will be: { even: ['a', 'c'], odd: ['b', 'd'] } + */ +declare function groupBy(arr: readonly T[], getKeyFromItem: (item: T, index: number, array: readonly T[]) => K): Record; +//#endregion +export { groupBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/groupBy.js b/tools/ui/node_modules/es-toolkit/dist/array/groupBy.js new file mode 100644 index 0000000000000000000000000000000000000000..dfa81bdd0e6b23146fb823ef72180ab55b482f10 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/groupBy.js @@ -0,0 +1,51 @@ +//#region src/array/groupBy.ts +/** +* Groups the elements of an array based on a provided key-generating function. +* +* This function takes an array and a function that generates a key from each element. It returns +* an object where the keys are the generated keys and the values are arrays of elements that share +* the same key. +* +* @template T - The type of elements in the array. +* @template K - The type of keys. +* @param {T[]} arr - The array to group. +* @param {(item: T, index: number, array: readonly T[]) => K} getKeyFromItem - A function that generates a key from an element, its index, and the array. +* @returns {Record} An object where each key is associated with an array of elements that +* share that key. +* +* @example +* const array = [ +* { category: 'fruit', name: 'apple' }, +* { category: 'fruit', name: 'banana' }, +* { category: 'vegetable', name: 'carrot' } +* ]; +* const result = groupBy(array, item => item.category); +* // result will be: +* // { +* // fruit: [ +* // { category: 'fruit', name: 'apple' }, +* // { category: 'fruit', name: 'banana' } +* // ], +* // vegetable: [ +* // { category: 'vegetable', name: 'carrot' } +* // ] +* // } +* +* @example +* // Using index parameter +* const items = ['a', 'b', 'c', 'd']; +* const result = groupBy(items, (item, index) => index % 2 === 0 ? 'even' : 'odd'); +* // result will be: { even: ['a', 'c'], odd: ['b', 'd'] } +*/ +function groupBy(arr, getKeyFromItem) { + const result = {}; + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + const key = getKeyFromItem(item, i, arr); + if (!Object.hasOwn(result, key)) result[key] = []; + result[key].push(item); + } + return result; +} +//#endregion +exports.groupBy = groupBy; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/groupBy.mjs b/tools/ui/node_modules/es-toolkit/dist/array/groupBy.mjs new file mode 100644 index 0000000000000000000000000000000000000000..4426962993503fb308cc42e783afe28be4649939 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/groupBy.mjs @@ -0,0 +1,51 @@ +//#region src/array/groupBy.ts +/** +* Groups the elements of an array based on a provided key-generating function. +* +* This function takes an array and a function that generates a key from each element. It returns +* an object where the keys are the generated keys and the values are arrays of elements that share +* the same key. +* +* @template T - The type of elements in the array. +* @template K - The type of keys. +* @param {T[]} arr - The array to group. +* @param {(item: T, index: number, array: readonly T[]) => K} getKeyFromItem - A function that generates a key from an element, its index, and the array. +* @returns {Record} An object where each key is associated with an array of elements that +* share that key. +* +* @example +* const array = [ +* { category: 'fruit', name: 'apple' }, +* { category: 'fruit', name: 'banana' }, +* { category: 'vegetable', name: 'carrot' } +* ]; +* const result = groupBy(array, item => item.category); +* // result will be: +* // { +* // fruit: [ +* // { category: 'fruit', name: 'apple' }, +* // { category: 'fruit', name: 'banana' } +* // ], +* // vegetable: [ +* // { category: 'vegetable', name: 'carrot' } +* // ] +* // } +* +* @example +* // Using index parameter +* const items = ['a', 'b', 'c', 'd']; +* const result = groupBy(items, (item, index) => index % 2 === 0 ? 'even' : 'odd'); +* // result will be: { even: ['a', 'c'], odd: ['b', 'd'] } +*/ +function groupBy(arr, getKeyFromItem) { + const result = {}; + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + const key = getKeyFromItem(item, i, arr); + if (!Object.hasOwn(result, key)) result[key] = []; + result[key].push(item); + } + return result; +} +//#endregion +export { groupBy }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/head.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/head.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..2977b2bc20536977065ae5d293bdf51c91df3cca --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/head.d.mts @@ -0,0 +1,35 @@ +//#region src/array/head.d.ts +/** + * Returns the first element of an array. + * + * This function takes an array and returns the first element of the array. + * If the array is empty, the function returns `undefined`. + * + * @template T - The type of elements in the array. + * @param {[T, ...T[]]} arr - A non-empty array from which to get the first element. + * @returns {T} The first element of the array. + * + * @example + * const arr = [1, 2, 3]; + * const firstElement = head(arr); + * // firstElement will be 1 + */ +declare function head(arr: readonly [T, ...T[]]): T; +/** + * Returns the first element of an array or `undefined` if the array is empty. + * + * This function takes an array and returns the first element of the array. + * If the array is empty, the function returns `undefined`. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array from which to get the first element. + * @returns {T | undefined} The first element of the array, or `undefined` if the array is empty. + * + * @example + * const emptyArr: number[] = []; + * const noElement = head(emptyArr); + * // noElement will be undefined + */ +declare function head(arr: readonly T[]): T | undefined; +//#endregion +export { head }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/head.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/head.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2977b2bc20536977065ae5d293bdf51c91df3cca --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/head.d.ts @@ -0,0 +1,35 @@ +//#region src/array/head.d.ts +/** + * Returns the first element of an array. + * + * This function takes an array and returns the first element of the array. + * If the array is empty, the function returns `undefined`. + * + * @template T - The type of elements in the array. + * @param {[T, ...T[]]} arr - A non-empty array from which to get the first element. + * @returns {T} The first element of the array. + * + * @example + * const arr = [1, 2, 3]; + * const firstElement = head(arr); + * // firstElement will be 1 + */ +declare function head(arr: readonly [T, ...T[]]): T; +/** + * Returns the first element of an array or `undefined` if the array is empty. + * + * This function takes an array and returns the first element of the array. + * If the array is empty, the function returns `undefined`. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array from which to get the first element. + * @returns {T | undefined} The first element of the array, or `undefined` if the array is empty. + * + * @example + * const emptyArr: number[] = []; + * const noElement = head(emptyArr); + * // noElement will be undefined + */ +declare function head(arr: readonly T[]): T | undefined; +//#endregion +export { head }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/head.js b/tools/ui/node_modules/es-toolkit/dist/array/head.js new file mode 100644 index 0000000000000000000000000000000000000000..56cd069ce19d2dc6866b8ca300aa69a888e8ec4f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/head.js @@ -0,0 +1,21 @@ +//#region src/array/head.ts +/** +* Returns the first element of an array or `undefined` if the array is empty. +* +* This function takes an array and returns the first element of the array. +* If the array is empty, the function returns `undefined`. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array from which to get the first element. +* @returns {T | undefined} The first element of the array, or `undefined` if the array is empty. +* +* @example +* const emptyArr: number[] = []; +* const noElement = head(emptyArr); +* // noElement will be undefined +*/ +function head(arr) { + return arr[0]; +} +//#endregion +exports.head = head; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/head.mjs b/tools/ui/node_modules/es-toolkit/dist/array/head.mjs new file mode 100644 index 0000000000000000000000000000000000000000..4de82d3e93ced2721621f51d379ec8a5df2e5ba7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/head.mjs @@ -0,0 +1,21 @@ +//#region src/array/head.ts +/** +* Returns the first element of an array or `undefined` if the array is empty. +* +* This function takes an array and returns the first element of the array. +* If the array is empty, the function returns `undefined`. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array from which to get the first element. +* @returns {T | undefined} The first element of the array, or `undefined` if the array is empty. +* +* @example +* const emptyArr: number[] = []; +* const noElement = head(emptyArr); +* // noElement will be undefined +*/ +function head(arr) { + return arr[0]; +} +//#endregion +export { head }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/index.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..68e664262db1aebafb5cd17a890831d2c7a8aa80 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/index.d.mts @@ -0,0 +1,69 @@ +import { at } from "./at.mjs"; +import { cartesianProduct } from "./cartesianProduct.mjs"; +import { chunk } from "./chunk.mjs"; +import { combinations } from "./combinations.mjs"; +import { compact } from "./compact.mjs"; +import { countBy } from "./countBy.mjs"; +import { difference } from "./difference.mjs"; +import { differenceBy } from "./differenceBy.mjs"; +import { differenceWith } from "./differenceWith.mjs"; +import { drop } from "./drop.mjs"; +import { dropRight } from "./dropRight.mjs"; +import { dropRightWhile } from "./dropRightWhile.mjs"; +import { dropWhile } from "./dropWhile.mjs"; +import { fill } from "./fill.mjs"; +import { filterAsync } from "./filterAsync.mjs"; +import { flatMap } from "./flatMap.mjs"; +import { flatMapAsync } from "./flatMapAsync.mjs"; +import { flattenDeep } from "./flattenDeep.mjs"; +import { flatMapDeep } from "./flatMapDeep.mjs"; +import { flatten } from "./flatten.mjs"; +import { forEachAsync } from "./forEachAsync.mjs"; +import { forEachRight } from "./forEachRight.mjs"; +import { groupBy } from "./groupBy.mjs"; +import { head } from "./head.mjs"; +import { initial } from "./initial.mjs"; +import { intersection } from "./intersection.mjs"; +import { intersectionBy } from "./intersectionBy.mjs"; +import { intersectionWith } from "./intersectionWith.mjs"; +import { isSubset } from "./isSubset.mjs"; +import { isSubsetWith } from "./isSubsetWith.mjs"; +import { keyBy } from "./keyBy.mjs"; +import { last } from "./last.mjs"; +import { limitAsync } from "./limitAsync.mjs"; +import { mapAsync } from "./mapAsync.mjs"; +import { maxBy } from "./maxBy.mjs"; +import { minBy } from "./minBy.mjs"; +import { orderBy } from "./orderBy.mjs"; +import { partition } from "./partition.mjs"; +import { pull } from "./pull.mjs"; +import { pullAt } from "./pullAt.mjs"; +import { reduceAsync } from "./reduceAsync.mjs"; +import { remove } from "./remove.mjs"; +import { sample } from "./sample.mjs"; +import { sampleSize } from "./sampleSize.mjs"; +import { shuffle } from "./shuffle.mjs"; +import { sortBy } from "./sortBy.mjs"; +import { tail } from "./tail.mjs"; +import { take } from "./take.mjs"; +import { takeRight } from "./takeRight.mjs"; +import { takeRightWhile } from "./takeRightWhile.mjs"; +import { takeWhile } from "./takeWhile.mjs"; +import { toFilled } from "./toFilled.mjs"; +import { union } from "./union.mjs"; +import { unionBy } from "./unionBy.mjs"; +import { unionWith } from "./unionWith.mjs"; +import { uniq } from "./uniq.mjs"; +import { uniqBy } from "./uniqBy.mjs"; +import { uniqWith } from "./uniqWith.mjs"; +import { unzip } from "./unzip.mjs"; +import { unzipWith } from "./unzipWith.mjs"; +import { windowed } from "./windowed.mjs"; +import { without } from "./without.mjs"; +import { xor } from "./xor.mjs"; +import { xorBy } from "./xorBy.mjs"; +import { xorWith } from "./xorWith.mjs"; +import { zip } from "./zip.mjs"; +import { zipObject } from "./zipObject.mjs"; +import { zipWith } from "./zipWith.mjs"; +export { at, cartesianProduct, chunk, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, remove, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/index.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b9ca06398a68088636a1d8d14a3405f7405d23bd --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/index.d.ts @@ -0,0 +1,69 @@ +import { at } from "./at.js"; +import { cartesianProduct } from "./cartesianProduct.js"; +import { chunk } from "./chunk.js"; +import { combinations } from "./combinations.js"; +import { compact } from "./compact.js"; +import { countBy } from "./countBy.js"; +import { difference } from "./difference.js"; +import { differenceBy } from "./differenceBy.js"; +import { differenceWith } from "./differenceWith.js"; +import { drop } from "./drop.js"; +import { dropRight } from "./dropRight.js"; +import { dropRightWhile } from "./dropRightWhile.js"; +import { dropWhile } from "./dropWhile.js"; +import { fill } from "./fill.js"; +import { filterAsync } from "./filterAsync.js"; +import { flatMap } from "./flatMap.js"; +import { flatMapAsync } from "./flatMapAsync.js"; +import { flattenDeep } from "./flattenDeep.js"; +import { flatMapDeep } from "./flatMapDeep.js"; +import { flatten } from "./flatten.js"; +import { forEachAsync } from "./forEachAsync.js"; +import { forEachRight } from "./forEachRight.js"; +import { groupBy } from "./groupBy.js"; +import { head } from "./head.js"; +import { initial } from "./initial.js"; +import { intersection } from "./intersection.js"; +import { intersectionBy } from "./intersectionBy.js"; +import { intersectionWith } from "./intersectionWith.js"; +import { isSubset } from "./isSubset.js"; +import { isSubsetWith } from "./isSubsetWith.js"; +import { keyBy } from "./keyBy.js"; +import { last } from "./last.js"; +import { limitAsync } from "./limitAsync.js"; +import { mapAsync } from "./mapAsync.js"; +import { maxBy } from "./maxBy.js"; +import { minBy } from "./minBy.js"; +import { orderBy } from "./orderBy.js"; +import { partition } from "./partition.js"; +import { pull } from "./pull.js"; +import { pullAt } from "./pullAt.js"; +import { reduceAsync } from "./reduceAsync.js"; +import { remove } from "./remove.js"; +import { sample } from "./sample.js"; +import { sampleSize } from "./sampleSize.js"; +import { shuffle } from "./shuffle.js"; +import { sortBy } from "./sortBy.js"; +import { tail } from "./tail.js"; +import { take } from "./take.js"; +import { takeRight } from "./takeRight.js"; +import { takeRightWhile } from "./takeRightWhile.js"; +import { takeWhile } from "./takeWhile.js"; +import { toFilled } from "./toFilled.js"; +import { union } from "./union.js"; +import { unionBy } from "./unionBy.js"; +import { unionWith } from "./unionWith.js"; +import { uniq } from "./uniq.js"; +import { uniqBy } from "./uniqBy.js"; +import { uniqWith } from "./uniqWith.js"; +import { unzip } from "./unzip.js"; +import { unzipWith } from "./unzipWith.js"; +import { windowed } from "./windowed.js"; +import { without } from "./without.js"; +import { xor } from "./xor.js"; +import { xorBy } from "./xorBy.js"; +import { xorWith } from "./xorWith.js"; +import { zip } from "./zip.js"; +import { zipObject } from "./zipObject.js"; +import { zipWith } from "./zipWith.js"; +export { at, cartesianProduct, chunk, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, remove, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/index.js b/tools/ui/node_modules/es-toolkit/dist/array/index.js new file mode 100644 index 0000000000000000000000000000000000000000..862ada4b68e71542944ad1a8c447bd7db0e16d30 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/index.js @@ -0,0 +1,137 @@ +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const require_at = require("./at.js"); +const require_cartesianProduct = require("./cartesianProduct.js"); +const require_chunk = require("./chunk.js"); +const require_combinations = require("./combinations.js"); +const require_compact = require("./compact.js"); +const require_countBy = require("./countBy.js"); +const require_difference = require("./difference.js"); +const require_differenceBy = require("./differenceBy.js"); +const require_differenceWith = require("./differenceWith.js"); +const require_drop = require("./drop.js"); +const require_dropRight = require("./dropRight.js"); +const require_dropRightWhile = require("./dropRightWhile.js"); +const require_dropWhile = require("./dropWhile.js"); +const require_fill = require("./fill.js"); +const require_limitAsync = require("./limitAsync.js"); +const require_filterAsync = require("./filterAsync.js"); +const require_flatten = require("./flatten.js"); +const require_flatMap = require("./flatMap.js"); +const require_flatMapAsync = require("./flatMapAsync.js"); +const require_flattenDeep = require("./flattenDeep.js"); +const require_flatMapDeep = require("./flatMapDeep.js"); +const require_forEachAsync = require("./forEachAsync.js"); +const require_forEachRight = require("./forEachRight.js"); +const require_groupBy = require("./groupBy.js"); +const require_head = require("./head.js"); +const require_initial = require("./initial.js"); +const require_intersection = require("./intersection.js"); +const require_intersectionBy = require("./intersectionBy.js"); +const require_intersectionWith = require("./intersectionWith.js"); +const require_isSubset = require("./isSubset.js"); +const require_isSubsetWith = require("./isSubsetWith.js"); +const require_keyBy = require("./keyBy.js"); +const require_last = require("./last.js"); +const require_mapAsync = require("./mapAsync.js"); +const require_maxBy = require("./maxBy.js"); +const require_minBy = require("./minBy.js"); +const require_orderBy = require("./orderBy.js"); +const require_partition = require("./partition.js"); +const require_pull = require("./pull.js"); +const require_pullAt = require("./pullAt.js"); +const require_reduceAsync = require("./reduceAsync.js"); +const require_remove = require("./remove.js"); +const require_sample = require("./sample.js"); +const require_sampleSize = require("./sampleSize.js"); +const require_shuffle = require("./shuffle.js"); +const require_sortBy = require("./sortBy.js"); +const require_tail = require("./tail.js"); +const require_take = require("./take.js"); +const require_takeRight = require("./takeRight.js"); +const require_takeRightWhile = require("./takeRightWhile.js"); +const require_takeWhile = require("./takeWhile.js"); +const require_toFilled = require("./toFilled.js"); +const require_uniq = require("./uniq.js"); +const require_union = require("./union.js"); +const require_uniqBy = require("./uniqBy.js"); +const require_unionBy = require("./unionBy.js"); +const require_uniqWith = require("./uniqWith.js"); +const require_unionWith = require("./unionWith.js"); +const require_unzip = require("./unzip.js"); +const require_unzipWith = require("./unzipWith.js"); +const require_windowed = require("./windowed.js"); +const require_without = require("./without.js"); +const require_xor = require("./xor.js"); +const require_xorBy = require("./xorBy.js"); +const require_xorWith = require("./xorWith.js"); +const require_zip = require("./zip.js"); +const require_zipObject = require("./zipObject.js"); +const require_zipWith = require("./zipWith.js"); +exports.at = require_at.at; +exports.cartesianProduct = require_cartesianProduct.cartesianProduct; +exports.chunk = require_chunk.chunk; +exports.combinations = require_combinations.combinations; +exports.compact = require_compact.compact; +exports.countBy = require_countBy.countBy; +exports.difference = require_difference.difference; +exports.differenceBy = require_differenceBy.differenceBy; +exports.differenceWith = require_differenceWith.differenceWith; +exports.drop = require_drop.drop; +exports.dropRight = require_dropRight.dropRight; +exports.dropRightWhile = require_dropRightWhile.dropRightWhile; +exports.dropWhile = require_dropWhile.dropWhile; +exports.fill = require_fill.fill; +exports.filterAsync = require_filterAsync.filterAsync; +exports.flatMap = require_flatMap.flatMap; +exports.flatMapAsync = require_flatMapAsync.flatMapAsync; +exports.flatMapDeep = require_flatMapDeep.flatMapDeep; +exports.flatten = require_flatten.flatten; +exports.flattenDeep = require_flattenDeep.flattenDeep; +exports.forEachAsync = require_forEachAsync.forEachAsync; +exports.forEachRight = require_forEachRight.forEachRight; +exports.groupBy = require_groupBy.groupBy; +exports.head = require_head.head; +exports.initial = require_initial.initial; +exports.intersection = require_intersection.intersection; +exports.intersectionBy = require_intersectionBy.intersectionBy; +exports.intersectionWith = require_intersectionWith.intersectionWith; +exports.isSubset = require_isSubset.isSubset; +exports.isSubsetWith = require_isSubsetWith.isSubsetWith; +exports.keyBy = require_keyBy.keyBy; +exports.last = require_last.last; +exports.limitAsync = require_limitAsync.limitAsync; +exports.mapAsync = require_mapAsync.mapAsync; +exports.maxBy = require_maxBy.maxBy; +exports.minBy = require_minBy.minBy; +exports.orderBy = require_orderBy.orderBy; +exports.partition = require_partition.partition; +exports.pull = require_pull.pull; +exports.pullAt = require_pullAt.pullAt; +exports.reduceAsync = require_reduceAsync.reduceAsync; +exports.remove = require_remove.remove; +exports.sample = require_sample.sample; +exports.sampleSize = require_sampleSize.sampleSize; +exports.shuffle = require_shuffle.shuffle; +exports.sortBy = require_sortBy.sortBy; +exports.tail = require_tail.tail; +exports.take = require_take.take; +exports.takeRight = require_takeRight.takeRight; +exports.takeRightWhile = require_takeRightWhile.takeRightWhile; +exports.takeWhile = require_takeWhile.takeWhile; +exports.toFilled = require_toFilled.toFilled; +exports.union = require_union.union; +exports.unionBy = require_unionBy.unionBy; +exports.unionWith = require_unionWith.unionWith; +exports.uniq = require_uniq.uniq; +exports.uniqBy = require_uniqBy.uniqBy; +exports.uniqWith = require_uniqWith.uniqWith; +exports.unzip = require_unzip.unzip; +exports.unzipWith = require_unzipWith.unzipWith; +exports.windowed = require_windowed.windowed; +exports.without = require_without.without; +exports.xor = require_xor.xor; +exports.xorBy = require_xorBy.xorBy; +exports.xorWith = require_xorWith.xorWith; +exports.zip = require_zip.zip; +exports.zipObject = require_zipObject.zipObject; +exports.zipWith = require_zipWith.zipWith; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/index.mjs b/tools/ui/node_modules/es-toolkit/dist/array/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..a3ce606c52b74d02c273e52636b9ee623a9055d4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/index.mjs @@ -0,0 +1,69 @@ +import { at } from "./at.mjs"; +import { cartesianProduct } from "./cartesianProduct.mjs"; +import { chunk } from "./chunk.mjs"; +import { combinations } from "./combinations.mjs"; +import { compact } from "./compact.mjs"; +import { countBy } from "./countBy.mjs"; +import { difference } from "./difference.mjs"; +import { differenceBy } from "./differenceBy.mjs"; +import { differenceWith } from "./differenceWith.mjs"; +import { drop } from "./drop.mjs"; +import { dropRight } from "./dropRight.mjs"; +import { dropRightWhile } from "./dropRightWhile.mjs"; +import { dropWhile } from "./dropWhile.mjs"; +import { fill } from "./fill.mjs"; +import { limitAsync } from "./limitAsync.mjs"; +import { filterAsync } from "./filterAsync.mjs"; +import { flatten } from "./flatten.mjs"; +import { flatMap } from "./flatMap.mjs"; +import { flatMapAsync } from "./flatMapAsync.mjs"; +import { flattenDeep } from "./flattenDeep.mjs"; +import { flatMapDeep } from "./flatMapDeep.mjs"; +import { forEachAsync } from "./forEachAsync.mjs"; +import { forEachRight } from "./forEachRight.mjs"; +import { groupBy } from "./groupBy.mjs"; +import { head } from "./head.mjs"; +import { initial } from "./initial.mjs"; +import { intersection } from "./intersection.mjs"; +import { intersectionBy } from "./intersectionBy.mjs"; +import { intersectionWith } from "./intersectionWith.mjs"; +import { isSubset } from "./isSubset.mjs"; +import { isSubsetWith } from "./isSubsetWith.mjs"; +import { keyBy } from "./keyBy.mjs"; +import { last } from "./last.mjs"; +import { mapAsync } from "./mapAsync.mjs"; +import { maxBy } from "./maxBy.mjs"; +import { minBy } from "./minBy.mjs"; +import { orderBy } from "./orderBy.mjs"; +import { partition } from "./partition.mjs"; +import { pull } from "./pull.mjs"; +import { pullAt } from "./pullAt.mjs"; +import { reduceAsync } from "./reduceAsync.mjs"; +import { remove } from "./remove.mjs"; +import { sample } from "./sample.mjs"; +import { sampleSize } from "./sampleSize.mjs"; +import { shuffle } from "./shuffle.mjs"; +import { sortBy } from "./sortBy.mjs"; +import { tail } from "./tail.mjs"; +import { take } from "./take.mjs"; +import { takeRight } from "./takeRight.mjs"; +import { takeRightWhile } from "./takeRightWhile.mjs"; +import { takeWhile } from "./takeWhile.mjs"; +import { toFilled } from "./toFilled.mjs"; +import { uniq } from "./uniq.mjs"; +import { union } from "./union.mjs"; +import { uniqBy } from "./uniqBy.mjs"; +import { unionBy } from "./unionBy.mjs"; +import { uniqWith } from "./uniqWith.mjs"; +import { unionWith } from "./unionWith.mjs"; +import { unzip } from "./unzip.mjs"; +import { unzipWith } from "./unzipWith.mjs"; +import { windowed } from "./windowed.mjs"; +import { without } from "./without.mjs"; +import { xor } from "./xor.mjs"; +import { xorBy } from "./xorBy.mjs"; +import { xorWith } from "./xorWith.mjs"; +import { zip } from "./zip.mjs"; +import { zipObject } from "./zipObject.mjs"; +import { zipWith } from "./zipWith.mjs"; +export { at, cartesianProduct, chunk, combinations, compact, countBy, difference, differenceBy, differenceWith, drop, dropRight, dropRightWhile, dropWhile, fill, filterAsync, flatMap, flatMapAsync, flatMapDeep, flatten, flattenDeep, forEachAsync, forEachRight, groupBy, head, initial, intersection, intersectionBy, intersectionWith, isSubset, isSubsetWith, keyBy, last, limitAsync, mapAsync, maxBy, minBy, orderBy, partition, pull, pullAt, reduceAsync, remove, sample, sampleSize, shuffle, sortBy, tail, take, takeRight, takeRightWhile, takeWhile, toFilled, union, unionBy, unionWith, uniq, uniqBy, uniqWith, unzip, unzipWith, windowed, without, xor, xorBy, xorWith, zip, zipObject, zipWith }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/initial.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/initial.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..adacf8ea5f0e0af93c0b7baab0c8dfe543fa9e37 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/initial.d.mts @@ -0,0 +1,55 @@ +//#region src/array/initial.d.ts +/** + * Returns an empty array when the input is a tuple containing exactly one element. + * + * @template T The type of the single element. + * @param {[T]} arr - A tuple containing exactly one element. + * @returns {[]} An empty array since there is only one element. + * + * @example + * const array = [100] as const; + * const result = initial(array); + * // result will be [] + */ +declare function initial(arr: readonly [T]): []; +/** + * Returns an empty array when the input array is empty. + * + * @returns {[]} Always returns an empty array for an empty input. + * + * @example + * const array = [] as const; + * const result = initial(array); + * // result will be [] + */ +declare function initial(arr: readonly []): []; +/** + * Returns a new array containing all elements except the last one from a tuple with multiple elements. + * + * @template T The types of the initial elements. + * @template U The type of the last element in the tuple. + * @param {[...T[], U]} arr - A tuple with one or more elements. + * @returns {T[]} A new array containing all but the last element of the tuple. + * + * @example + * const array = ['apple', 'banana', 'cherry'] as const; + * const result = initial(array); + * // result will be ['apple', 'banana'] + */ +declare function initial(arr: readonly [...T[], U]): T[]; +/** + * Returns a new array containing all elements except the last one from the input array. + * If the input array is empty or has only one element, the function returns an empty array. + * + * @template T The type of elements in the array. + * @param {T[]} arr - The input array. + * @returns {T[]} A new array containing all but the last element of the input array. + * + * @example + * const arr = [1, 2, 3, 4]; + * const result = initial(arr); + * // result will be [1, 2, 3] + */ +declare function initial(arr: readonly T[]): T[]; +//#endregion +export { initial }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/initial.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/initial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..adacf8ea5f0e0af93c0b7baab0c8dfe543fa9e37 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/initial.d.ts @@ -0,0 +1,55 @@ +//#region src/array/initial.d.ts +/** + * Returns an empty array when the input is a tuple containing exactly one element. + * + * @template T The type of the single element. + * @param {[T]} arr - A tuple containing exactly one element. + * @returns {[]} An empty array since there is only one element. + * + * @example + * const array = [100] as const; + * const result = initial(array); + * // result will be [] + */ +declare function initial(arr: readonly [T]): []; +/** + * Returns an empty array when the input array is empty. + * + * @returns {[]} Always returns an empty array for an empty input. + * + * @example + * const array = [] as const; + * const result = initial(array); + * // result will be [] + */ +declare function initial(arr: readonly []): []; +/** + * Returns a new array containing all elements except the last one from a tuple with multiple elements. + * + * @template T The types of the initial elements. + * @template U The type of the last element in the tuple. + * @param {[...T[], U]} arr - A tuple with one or more elements. + * @returns {T[]} A new array containing all but the last element of the tuple. + * + * @example + * const array = ['apple', 'banana', 'cherry'] as const; + * const result = initial(array); + * // result will be ['apple', 'banana'] + */ +declare function initial(arr: readonly [...T[], U]): T[]; +/** + * Returns a new array containing all elements except the last one from the input array. + * If the input array is empty or has only one element, the function returns an empty array. + * + * @template T The type of elements in the array. + * @param {T[]} arr - The input array. + * @returns {T[]} A new array containing all but the last element of the input array. + * + * @example + * const arr = [1, 2, 3, 4]; + * const result = initial(arr); + * // result will be [1, 2, 3] + */ +declare function initial(arr: readonly T[]): T[]; +//#endregion +export { initial }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/initial.js b/tools/ui/node_modules/es-toolkit/dist/array/initial.js new file mode 100644 index 0000000000000000000000000000000000000000..90657df5a7da24c211f766a737d5a841aae9ac9d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/initial.js @@ -0,0 +1,19 @@ +//#region src/array/initial.ts +/** +* Returns a new array containing all elements except the last one from the input array. +* If the input array is empty or has only one element, the function returns an empty array. +* +* @template T The type of elements in the array. +* @param {T[]} arr - The input array. +* @returns {T[]} A new array containing all but the last element of the input array. +* +* @example +* const arr = [1, 2, 3, 4]; +* const result = initial(arr); +* // result will be [1, 2, 3] +*/ +function initial(arr) { + return arr.slice(0, -1); +} +//#endregion +exports.initial = initial; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/initial.mjs b/tools/ui/node_modules/es-toolkit/dist/array/initial.mjs new file mode 100644 index 0000000000000000000000000000000000000000..34a09becb4ed48cbb67b957bdded3312d7608179 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/initial.mjs @@ -0,0 +1,19 @@ +//#region src/array/initial.ts +/** +* Returns a new array containing all elements except the last one from the input array. +* If the input array is empty or has only one element, the function returns an empty array. +* +* @template T The type of elements in the array. +* @param {T[]} arr - The input array. +* @returns {T[]} A new array containing all but the last element of the input array. +* +* @example +* const arr = [1, 2, 3, 4]; +* const result = initial(arr); +* // result will be [1, 2, 3] +*/ +function initial(arr) { + return arr.slice(0, -1); +} +//#endregion +export { initial }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/intersection.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/intersection.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..c94d8265602623f9b926450f66cc2691861f11d7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/intersection.d.mts @@ -0,0 +1,22 @@ +//#region src/array/intersection.d.ts +/** + * Returns the intersection of two arrays. + * + * This function takes two arrays and returns a new array containing the elements that are + * present in both arrays. It effectively filters out any elements from the first array that + * are not found in the second array. + * + * @template T - The type of elements in the array. + * @param {T[]} firstArr - The first array to compare. + * @param {T[]} secondArr - The second array to compare. + * @returns {T[]} A new array containing the elements that are present in both arrays. + * + * @example + * const array1 = [1, 2, 3, 4, 5]; + * const array2 = [3, 4, 5, 6, 7]; + * const result = intersection(array1, array2); + * // result will be [3, 4, 5] since these elements are in both arrays. + */ +declare function intersection(firstArr: readonly T[], secondArr: readonly T[]): T[]; +//#endregion +export { intersection }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/intersection.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/intersection.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c94d8265602623f9b926450f66cc2691861f11d7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/intersection.d.ts @@ -0,0 +1,22 @@ +//#region src/array/intersection.d.ts +/** + * Returns the intersection of two arrays. + * + * This function takes two arrays and returns a new array containing the elements that are + * present in both arrays. It effectively filters out any elements from the first array that + * are not found in the second array. + * + * @template T - The type of elements in the array. + * @param {T[]} firstArr - The first array to compare. + * @param {T[]} secondArr - The second array to compare. + * @returns {T[]} A new array containing the elements that are present in both arrays. + * + * @example + * const array1 = [1, 2, 3, 4, 5]; + * const array2 = [3, 4, 5, 6, 7]; + * const result = intersection(array1, array2); + * // result will be [3, 4, 5] since these elements are in both arrays. + */ +declare function intersection(firstArr: readonly T[], secondArr: readonly T[]): T[]; +//#endregion +export { intersection }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/intersection.js b/tools/ui/node_modules/es-toolkit/dist/array/intersection.js new file mode 100644 index 0000000000000000000000000000000000000000..3f23ec3e9cf4967c1e28a07192193248e4b13e68 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/intersection.js @@ -0,0 +1,25 @@ +//#region src/array/intersection.ts +/** +* Returns the intersection of two arrays. +* +* This function takes two arrays and returns a new array containing the elements that are +* present in both arrays. It effectively filters out any elements from the first array that +* are not found in the second array. +* +* @template T - The type of elements in the array. +* @param {T[]} firstArr - The first array to compare. +* @param {T[]} secondArr - The second array to compare. +* @returns {T[]} A new array containing the elements that are present in both arrays. +* +* @example +* const array1 = [1, 2, 3, 4, 5]; +* const array2 = [3, 4, 5, 6, 7]; +* const result = intersection(array1, array2); +* // result will be [3, 4, 5] since these elements are in both arrays. +*/ +function intersection(firstArr, secondArr) { + const secondSet = new Set(secondArr); + return firstArr.filter((item) => secondSet.has(item)); +} +//#endregion +exports.intersection = intersection; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/intersection.mjs b/tools/ui/node_modules/es-toolkit/dist/array/intersection.mjs new file mode 100644 index 0000000000000000000000000000000000000000..3004c3462a119cf4eb274d28e1f093a96c1cdc56 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/intersection.mjs @@ -0,0 +1,25 @@ +//#region src/array/intersection.ts +/** +* Returns the intersection of two arrays. +* +* This function takes two arrays and returns a new array containing the elements that are +* present in both arrays. It effectively filters out any elements from the first array that +* are not found in the second array. +* +* @template T - The type of elements in the array. +* @param {T[]} firstArr - The first array to compare. +* @param {T[]} secondArr - The second array to compare. +* @returns {T[]} A new array containing the elements that are present in both arrays. +* +* @example +* const array1 = [1, 2, 3, 4, 5]; +* const array2 = [3, 4, 5, 6, 7]; +* const result = intersection(array1, array2); +* // result will be [3, 4, 5] since these elements are in both arrays. +*/ +function intersection(firstArr, secondArr) { + const secondSet = new Set(secondArr); + return firstArr.filter((item) => secondSet.has(item)); +} +//#endregion +export { intersection }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/intersectionBy.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/intersectionBy.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..c7d5ea4ee1f25bb0adfb83d1aac73666f094f56b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/intersectionBy.d.mts @@ -0,0 +1,37 @@ +//#region src/array/intersectionBy.d.ts +/** + * Returns the intersection of two arrays based on a mapping function. + * + * This function takes two arrays and a mapping function. It returns a new array containing + * the elements from the first array that, when mapped using the provided function, have matching + * mapped elements in the second array. It effectively filters out any elements from the first array + * that do not have corresponding mapped values in the second array. + * + * @template T - The type of elements in the first array. + * @template U - The type of elements in the second array. + * @param {T[]} firstArr - The first array to compare. + * @param {U[]} secondArr - The second array to compare. + * @param {(item: T | U) => unknown} mapper - A function to map the elements of both arrays for comparison. + * @returns {T[]} A new array containing the elements from the first array that have corresponding mapped values in the second array. + * + * @example + * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const array2 = [{ id: 2 }, { id: 4 }]; + * const mapper = item => item.id; + * const result = intersectionBy(array1, array2, mapper); + * // result will be [{ id: 2 }] since only this element has a matching id in both arrays. + * + * @example + * const array1 = [ + * { id: 1, name: 'jane' }, + * { id: 2, name: 'amy' }, + * { id: 3, name: 'michael' }, + * ]; + * const array2 = [2, 4]; + * const mapper = item => (typeof item === 'object' ? item.id : item); + * const result = intersectionBy(array1, array2, mapper); + * // result will be [{ id: 2, name: 'amy' }] since only this element has a matching id that is equal to seconds array's element. + */ +declare function intersectionBy(firstArr: readonly T[], secondArr: readonly U[], mapper: (item: T | U) => unknown): T[]; +//#endregion +export { intersectionBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/intersectionBy.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/intersectionBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c7d5ea4ee1f25bb0adfb83d1aac73666f094f56b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/intersectionBy.d.ts @@ -0,0 +1,37 @@ +//#region src/array/intersectionBy.d.ts +/** + * Returns the intersection of two arrays based on a mapping function. + * + * This function takes two arrays and a mapping function. It returns a new array containing + * the elements from the first array that, when mapped using the provided function, have matching + * mapped elements in the second array. It effectively filters out any elements from the first array + * that do not have corresponding mapped values in the second array. + * + * @template T - The type of elements in the first array. + * @template U - The type of elements in the second array. + * @param {T[]} firstArr - The first array to compare. + * @param {U[]} secondArr - The second array to compare. + * @param {(item: T | U) => unknown} mapper - A function to map the elements of both arrays for comparison. + * @returns {T[]} A new array containing the elements from the first array that have corresponding mapped values in the second array. + * + * @example + * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const array2 = [{ id: 2 }, { id: 4 }]; + * const mapper = item => item.id; + * const result = intersectionBy(array1, array2, mapper); + * // result will be [{ id: 2 }] since only this element has a matching id in both arrays. + * + * @example + * const array1 = [ + * { id: 1, name: 'jane' }, + * { id: 2, name: 'amy' }, + * { id: 3, name: 'michael' }, + * ]; + * const array2 = [2, 4]; + * const mapper = item => (typeof item === 'object' ? item.id : item); + * const result = intersectionBy(array1, array2, mapper); + * // result will be [{ id: 2, name: 'amy' }] since only this element has a matching id that is equal to seconds array's element. + */ +declare function intersectionBy(firstArr: readonly T[], secondArr: readonly U[], mapper: (item: T | U) => unknown): T[]; +//#endregion +export { intersectionBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/intersectionBy.js b/tools/ui/node_modules/es-toolkit/dist/array/intersectionBy.js new file mode 100644 index 0000000000000000000000000000000000000000..5e1d104000532a769849b243395a7f6097e129a5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/intersectionBy.js @@ -0,0 +1,49 @@ +//#region src/array/intersectionBy.ts +/** +* Returns the intersection of two arrays based on a mapping function. +* +* This function takes two arrays and a mapping function. It returns a new array containing +* the elements from the first array that, when mapped using the provided function, have matching +* mapped elements in the second array. It effectively filters out any elements from the first array +* that do not have corresponding mapped values in the second array. +* +* @template T - The type of elements in the first array. +* @template U - The type of elements in the second array. +* @param {T[]} firstArr - The first array to compare. +* @param {U[]} secondArr - The second array to compare. +* @param {(item: T | U) => unknown} mapper - A function to map the elements of both arrays for comparison. +* @returns {T[]} A new array containing the elements from the first array that have corresponding mapped values in the second array. +* +* @example +* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const array2 = [{ id: 2 }, { id: 4 }]; +* const mapper = item => item.id; +* const result = intersectionBy(array1, array2, mapper); +* // result will be [{ id: 2 }] since only this element has a matching id in both arrays. +* +* @example +* const array1 = [ +* { id: 1, name: 'jane' }, +* { id: 2, name: 'amy' }, +* { id: 3, name: 'michael' }, +* ]; +* const array2 = [2, 4]; +* const mapper = item => (typeof item === 'object' ? item.id : item); +* const result = intersectionBy(array1, array2, mapper); +* // result will be [{ id: 2, name: 'amy' }] since only this element has a matching id that is equal to seconds array's element. +*/ +function intersectionBy(firstArr, secondArr, mapper) { + const result = []; + const mappedSecondSet = new Set(secondArr.map(mapper)); + for (let i = 0; i < firstArr.length; i++) { + const item = firstArr[i]; + const mappedItem = mapper(item); + if (mappedSecondSet.has(mappedItem)) { + result.push(item); + mappedSecondSet.delete(mappedItem); + } + } + return result; +} +//#endregion +exports.intersectionBy = intersectionBy; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/intersectionBy.mjs b/tools/ui/node_modules/es-toolkit/dist/array/intersectionBy.mjs new file mode 100644 index 0000000000000000000000000000000000000000..ee3da223cf1675e2ea87598967ca9ba073e9b922 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/intersectionBy.mjs @@ -0,0 +1,49 @@ +//#region src/array/intersectionBy.ts +/** +* Returns the intersection of two arrays based on a mapping function. +* +* This function takes two arrays and a mapping function. It returns a new array containing +* the elements from the first array that, when mapped using the provided function, have matching +* mapped elements in the second array. It effectively filters out any elements from the first array +* that do not have corresponding mapped values in the second array. +* +* @template T - The type of elements in the first array. +* @template U - The type of elements in the second array. +* @param {T[]} firstArr - The first array to compare. +* @param {U[]} secondArr - The second array to compare. +* @param {(item: T | U) => unknown} mapper - A function to map the elements of both arrays for comparison. +* @returns {T[]} A new array containing the elements from the first array that have corresponding mapped values in the second array. +* +* @example +* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const array2 = [{ id: 2 }, { id: 4 }]; +* const mapper = item => item.id; +* const result = intersectionBy(array1, array2, mapper); +* // result will be [{ id: 2 }] since only this element has a matching id in both arrays. +* +* @example +* const array1 = [ +* { id: 1, name: 'jane' }, +* { id: 2, name: 'amy' }, +* { id: 3, name: 'michael' }, +* ]; +* const array2 = [2, 4]; +* const mapper = item => (typeof item === 'object' ? item.id : item); +* const result = intersectionBy(array1, array2, mapper); +* // result will be [{ id: 2, name: 'amy' }] since only this element has a matching id that is equal to seconds array's element. +*/ +function intersectionBy(firstArr, secondArr, mapper) { + const result = []; + const mappedSecondSet = new Set(secondArr.map(mapper)); + for (let i = 0; i < firstArr.length; i++) { + const item = firstArr[i]; + const mappedItem = mapper(item); + if (mappedSecondSet.has(mappedItem)) { + result.push(item); + mappedSecondSet.delete(mappedItem); + } + } + return result; +} +//#endregion +export { intersectionBy }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/intersectionWith.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/intersectionWith.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..4f082028170e40d6d1b0c45d0ae33fa6dae2b44c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/intersectionWith.d.mts @@ -0,0 +1,38 @@ +//#region src/array/intersectionWith.d.ts +/** + * Returns the intersection of two arrays based on a custom equality function. + * + * This function takes two arrays and a custom equality function. It returns a new array containing + * the elements from the first array that have matching elements in the second array, as determined + * by the custom equality function. It effectively filters out any elements from the first array that + * do not have corresponding matches in the second array according to the equality function. + * + * @template T - The type of elements in the first array. + * @template U - The type of elements in the second array. + * @param {T[]} firstArr - The first array to compare. + * @param {U[]} secondArr - The second array to compare. + * @param {(x: T, y: U) => boolean} areItemsEqual - A custom function to determine if two elements are equal. + * This function takes two arguments, one from each array, and returns `true` if the elements are considered equal, and `false` otherwise. + * @returns {T[]} A new array containing the elements from the first array that have corresponding matches in the second array according to the custom equality function. + * + * @example + * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const array2 = [{ id: 2 }, { id: 4 }]; + * const areItemsEqual = (a, b) => a.id === b.id; + * const result = intersectionWith(array1, array2, areItemsEqual); + * // result will be [{ id: 2 }] since this element has a matching id in both arrays. + * + * @example + * const array1 = [ + * { id: 1, name: 'jane' }, + * { id: 2, name: 'amy' }, + * { id: 3, name: 'michael' }, + * ]; + * const array2 = [2, 4]; + * const areItemsEqual = (a, b) => a.id === b; + * const result = intersectionWith(array1, array2, areItemsEqual); + * // result will be [{ id: 2, name: 'amy' }] since this element has a matching id that is equal to seconds array's element. + */ +declare function intersectionWith(firstArr: readonly T[], secondArr: readonly U[], areItemsEqual: (x: T, y: U) => boolean): T[]; +//#endregion +export { intersectionWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/intersectionWith.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/intersectionWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4f082028170e40d6d1b0c45d0ae33fa6dae2b44c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/intersectionWith.d.ts @@ -0,0 +1,38 @@ +//#region src/array/intersectionWith.d.ts +/** + * Returns the intersection of two arrays based on a custom equality function. + * + * This function takes two arrays and a custom equality function. It returns a new array containing + * the elements from the first array that have matching elements in the second array, as determined + * by the custom equality function. It effectively filters out any elements from the first array that + * do not have corresponding matches in the second array according to the equality function. + * + * @template T - The type of elements in the first array. + * @template U - The type of elements in the second array. + * @param {T[]} firstArr - The first array to compare. + * @param {U[]} secondArr - The second array to compare. + * @param {(x: T, y: U) => boolean} areItemsEqual - A custom function to determine if two elements are equal. + * This function takes two arguments, one from each array, and returns `true` if the elements are considered equal, and `false` otherwise. + * @returns {T[]} A new array containing the elements from the first array that have corresponding matches in the second array according to the custom equality function. + * + * @example + * const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const array2 = [{ id: 2 }, { id: 4 }]; + * const areItemsEqual = (a, b) => a.id === b.id; + * const result = intersectionWith(array1, array2, areItemsEqual); + * // result will be [{ id: 2 }] since this element has a matching id in both arrays. + * + * @example + * const array1 = [ + * { id: 1, name: 'jane' }, + * { id: 2, name: 'amy' }, + * { id: 3, name: 'michael' }, + * ]; + * const array2 = [2, 4]; + * const areItemsEqual = (a, b) => a.id === b; + * const result = intersectionWith(array1, array2, areItemsEqual); + * // result will be [{ id: 2, name: 'amy' }] since this element has a matching id that is equal to seconds array's element. + */ +declare function intersectionWith(firstArr: readonly T[], secondArr: readonly U[], areItemsEqual: (x: T, y: U) => boolean): T[]; +//#endregion +export { intersectionWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/intersectionWith.js b/tools/ui/node_modules/es-toolkit/dist/array/intersectionWith.js new file mode 100644 index 0000000000000000000000000000000000000000..979208d69e1e32ea09cdc1144c51f43d27af6362 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/intersectionWith.js @@ -0,0 +1,44 @@ +//#region src/array/intersectionWith.ts +/** +* Returns the intersection of two arrays based on a custom equality function. +* +* This function takes two arrays and a custom equality function. It returns a new array containing +* the elements from the first array that have matching elements in the second array, as determined +* by the custom equality function. It effectively filters out any elements from the first array that +* do not have corresponding matches in the second array according to the equality function. +* +* @template T - The type of elements in the first array. +* @template U - The type of elements in the second array. +* @param {T[]} firstArr - The first array to compare. +* @param {U[]} secondArr - The second array to compare. +* @param {(x: T, y: U) => boolean} areItemsEqual - A custom function to determine if two elements are equal. +* This function takes two arguments, one from each array, and returns `true` if the elements are considered equal, and `false` otherwise. +* @returns {T[]} A new array containing the elements from the first array that have corresponding matches in the second array according to the custom equality function. +* +* @example +* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const array2 = [{ id: 2 }, { id: 4 }]; +* const areItemsEqual = (a, b) => a.id === b.id; +* const result = intersectionWith(array1, array2, areItemsEqual); +* // result will be [{ id: 2 }] since this element has a matching id in both arrays. +* +* @example +* const array1 = [ +* { id: 1, name: 'jane' }, +* { id: 2, name: 'amy' }, +* { id: 3, name: 'michael' }, +* ]; +* const array2 = [2, 4]; +* const areItemsEqual = (a, b) => a.id === b; +* const result = intersectionWith(array1, array2, areItemsEqual); +* // result will be [{ id: 2, name: 'amy' }] since this element has a matching id that is equal to seconds array's element. +*/ +function intersectionWith(firstArr, secondArr, areItemsEqual) { + return firstArr.filter((firstItem) => { + return secondArr.some((secondItem) => { + return areItemsEqual(firstItem, secondItem); + }); + }); +} +//#endregion +exports.intersectionWith = intersectionWith; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/intersectionWith.mjs b/tools/ui/node_modules/es-toolkit/dist/array/intersectionWith.mjs new file mode 100644 index 0000000000000000000000000000000000000000..e21c3547aa44d29fe81649cd9060b96341e43346 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/intersectionWith.mjs @@ -0,0 +1,44 @@ +//#region src/array/intersectionWith.ts +/** +* Returns the intersection of two arrays based on a custom equality function. +* +* This function takes two arrays and a custom equality function. It returns a new array containing +* the elements from the first array that have matching elements in the second array, as determined +* by the custom equality function. It effectively filters out any elements from the first array that +* do not have corresponding matches in the second array according to the equality function. +* +* @template T - The type of elements in the first array. +* @template U - The type of elements in the second array. +* @param {T[]} firstArr - The first array to compare. +* @param {U[]} secondArr - The second array to compare. +* @param {(x: T, y: U) => boolean} areItemsEqual - A custom function to determine if two elements are equal. +* This function takes two arguments, one from each array, and returns `true` if the elements are considered equal, and `false` otherwise. +* @returns {T[]} A new array containing the elements from the first array that have corresponding matches in the second array according to the custom equality function. +* +* @example +* const array1 = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const array2 = [{ id: 2 }, { id: 4 }]; +* const areItemsEqual = (a, b) => a.id === b.id; +* const result = intersectionWith(array1, array2, areItemsEqual); +* // result will be [{ id: 2 }] since this element has a matching id in both arrays. +* +* @example +* const array1 = [ +* { id: 1, name: 'jane' }, +* { id: 2, name: 'amy' }, +* { id: 3, name: 'michael' }, +* ]; +* const array2 = [2, 4]; +* const areItemsEqual = (a, b) => a.id === b; +* const result = intersectionWith(array1, array2, areItemsEqual); +* // result will be [{ id: 2, name: 'amy' }] since this element has a matching id that is equal to seconds array's element. +*/ +function intersectionWith(firstArr, secondArr, areItemsEqual) { + return firstArr.filter((firstItem) => { + return secondArr.some((secondItem) => { + return areItemsEqual(firstItem, secondItem); + }); + }); +} +//#endregion +export { intersectionWith }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/isSubset.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/isSubset.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..275f9a76171eeb4b85089d82f08b8285a5384e9c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/isSubset.d.mts @@ -0,0 +1,27 @@ +//#region src/array/isSubset.d.ts +/** + * Checks if the `subset` array is entirely contained within the `superset` array. + * + * + * @template T - The type of elements contained in the arrays. + * @param {T[]} superset - The array that may contain all elements of the subset. + * @param {T[]} subset - The array to check against the superset. + * @returns {boolean} - Returns `true` if all elements of the `subset` are present in the `superset`, otherwise returns `false`. + * + * @example + * ```typescript + * const superset = [1, 2, 3, 4, 5]; + * const subset = [2, 3, 4]; + * isSubset(superset, subset); // true + * ``` + * + * @example + * ```typescript + * const superset = ['a', 'b', 'c']; + * const subset = ['a', 'd']; + * isSubset(superset, subset); // false + * ``` + */ +declare function isSubset(superset: readonly T[], subset: readonly T[]): boolean; +//#endregion +export { isSubset }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/isSubset.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/isSubset.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..275f9a76171eeb4b85089d82f08b8285a5384e9c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/isSubset.d.ts @@ -0,0 +1,27 @@ +//#region src/array/isSubset.d.ts +/** + * Checks if the `subset` array is entirely contained within the `superset` array. + * + * + * @template T - The type of elements contained in the arrays. + * @param {T[]} superset - The array that may contain all elements of the subset. + * @param {T[]} subset - The array to check against the superset. + * @returns {boolean} - Returns `true` if all elements of the `subset` are present in the `superset`, otherwise returns `false`. + * + * @example + * ```typescript + * const superset = [1, 2, 3, 4, 5]; + * const subset = [2, 3, 4]; + * isSubset(superset, subset); // true + * ``` + * + * @example + * ```typescript + * const superset = ['a', 'b', 'c']; + * const subset = ['a', 'd']; + * isSubset(superset, subset); // false + * ``` + */ +declare function isSubset(superset: readonly T[], subset: readonly T[]): boolean; +//#endregion +export { isSubset }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/isSubset.js b/tools/ui/node_modules/es-toolkit/dist/array/isSubset.js new file mode 100644 index 0000000000000000000000000000000000000000..2a0c8c94062b3bc09da3feeaa4cfd3efa95dc425 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/isSubset.js @@ -0,0 +1,30 @@ +const require_difference = require("./difference.js"); +//#region src/array/isSubset.ts +/** +* Checks if the `subset` array is entirely contained within the `superset` array. +* +* +* @template T - The type of elements contained in the arrays. +* @param {T[]} superset - The array that may contain all elements of the subset. +* @param {T[]} subset - The array to check against the superset. +* @returns {boolean} - Returns `true` if all elements of the `subset` are present in the `superset`, otherwise returns `false`. +* +* @example +* ```typescript +* const superset = [1, 2, 3, 4, 5]; +* const subset = [2, 3, 4]; +* isSubset(superset, subset); // true +* ``` +* +* @example +* ```typescript +* const superset = ['a', 'b', 'c']; +* const subset = ['a', 'd']; +* isSubset(superset, subset); // false +* ``` +*/ +function isSubset(superset, subset) { + return require_difference.difference(subset, superset).length === 0; +} +//#endregion +exports.isSubset = isSubset; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/isSubset.mjs b/tools/ui/node_modules/es-toolkit/dist/array/isSubset.mjs new file mode 100644 index 0000000000000000000000000000000000000000..3e10bccb711bd313a94c36e1a324bb7508ddb1c7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/isSubset.mjs @@ -0,0 +1,30 @@ +import { difference } from "./difference.mjs"; +//#region src/array/isSubset.ts +/** +* Checks if the `subset` array is entirely contained within the `superset` array. +* +* +* @template T - The type of elements contained in the arrays. +* @param {T[]} superset - The array that may contain all elements of the subset. +* @param {T[]} subset - The array to check against the superset. +* @returns {boolean} - Returns `true` if all elements of the `subset` are present in the `superset`, otherwise returns `false`. +* +* @example +* ```typescript +* const superset = [1, 2, 3, 4, 5]; +* const subset = [2, 3, 4]; +* isSubset(superset, subset); // true +* ``` +* +* @example +* ```typescript +* const superset = ['a', 'b', 'c']; +* const subset = ['a', 'd']; +* isSubset(superset, subset); // false +* ``` +*/ +function isSubset(superset, subset) { + return difference(subset, superset).length === 0; +} +//#endregion +export { isSubset }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/isSubsetWith.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/isSubsetWith.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..7f4eb3893f10210cf84213455d0018de260e2af4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/isSubsetWith.d.mts @@ -0,0 +1,34 @@ +//#region src/array/isSubsetWith.d.ts +/** + * Checks if the `subset` array is entirely contained within the `superset` array based on a custom equality function. + * + * This function takes two arrays and a custom comparison function. It returns a boolean indicating + * whether all elements in the subset array are present in the superset array, as determined by the provided + * custom equality function. + * + * @template T - The type of elements contained in the arrays. + * @param {T[]} superset - The array that may contain all elements of the subset. + * @param {T[]} subset - The array to check against the superset. + * @param {(x: T, y: T) => boolean} areItemsEqual - A function to determine if two items are equal. + * @returns {boolean} - Returns `true` if all elements of the subset are present in the superset + * according to the custom equality function, otherwise returns `false`. + * + * @example + * ```typescript + * const superset = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const subset = [{ id: 2 }, { id: 1 }]; + * const areItemsEqual = (a, b) => a.id === b.id; + * isSubsetWith(superset, subset, areItemsEqual); // true + * ``` + * + * @example + * ```typescript + * const superset = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const subset = [{ id: 4 }]; + * const areItemsEqual = (a, b) => a.id === b.id; + * isSubsetWith(superset, subset, areItemsEqual); // false + * ``` + */ +declare function isSubsetWith(superset: readonly T[], subset: readonly T[], areItemsEqual: (x: T, y: T) => boolean): boolean; +//#endregion +export { isSubsetWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/isSubsetWith.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/isSubsetWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7f4eb3893f10210cf84213455d0018de260e2af4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/isSubsetWith.d.ts @@ -0,0 +1,34 @@ +//#region src/array/isSubsetWith.d.ts +/** + * Checks if the `subset` array is entirely contained within the `superset` array based on a custom equality function. + * + * This function takes two arrays and a custom comparison function. It returns a boolean indicating + * whether all elements in the subset array are present in the superset array, as determined by the provided + * custom equality function. + * + * @template T - The type of elements contained in the arrays. + * @param {T[]} superset - The array that may contain all elements of the subset. + * @param {T[]} subset - The array to check against the superset. + * @param {(x: T, y: T) => boolean} areItemsEqual - A function to determine if two items are equal. + * @returns {boolean} - Returns `true` if all elements of the subset are present in the superset + * according to the custom equality function, otherwise returns `false`. + * + * @example + * ```typescript + * const superset = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const subset = [{ id: 2 }, { id: 1 }]; + * const areItemsEqual = (a, b) => a.id === b.id; + * isSubsetWith(superset, subset, areItemsEqual); // true + * ``` + * + * @example + * ```typescript + * const superset = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const subset = [{ id: 4 }]; + * const areItemsEqual = (a, b) => a.id === b.id; + * isSubsetWith(superset, subset, areItemsEqual); // false + * ``` + */ +declare function isSubsetWith(superset: readonly T[], subset: readonly T[], areItemsEqual: (x: T, y: T) => boolean): boolean; +//#endregion +export { isSubsetWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/isSubsetWith.js b/tools/ui/node_modules/es-toolkit/dist/array/isSubsetWith.js new file mode 100644 index 0000000000000000000000000000000000000000..109312eb0591eeb1ea47522132c3a17fbdf67ef5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/isSubsetWith.js @@ -0,0 +1,37 @@ +const require_differenceWith = require("./differenceWith.js"); +//#region src/array/isSubsetWith.ts +/** +* Checks if the `subset` array is entirely contained within the `superset` array based on a custom equality function. +* +* This function takes two arrays and a custom comparison function. It returns a boolean indicating +* whether all elements in the subset array are present in the superset array, as determined by the provided +* custom equality function. +* +* @template T - The type of elements contained in the arrays. +* @param {T[]} superset - The array that may contain all elements of the subset. +* @param {T[]} subset - The array to check against the superset. +* @param {(x: T, y: T) => boolean} areItemsEqual - A function to determine if two items are equal. +* @returns {boolean} - Returns `true` if all elements of the subset are present in the superset +* according to the custom equality function, otherwise returns `false`. +* +* @example +* ```typescript +* const superset = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const subset = [{ id: 2 }, { id: 1 }]; +* const areItemsEqual = (a, b) => a.id === b.id; +* isSubsetWith(superset, subset, areItemsEqual); // true +* ``` +* +* @example +* ```typescript +* const superset = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const subset = [{ id: 4 }]; +* const areItemsEqual = (a, b) => a.id === b.id; +* isSubsetWith(superset, subset, areItemsEqual); // false +* ``` +*/ +function isSubsetWith(superset, subset, areItemsEqual) { + return require_differenceWith.differenceWith(subset, superset, areItemsEqual).length === 0; +} +//#endregion +exports.isSubsetWith = isSubsetWith; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/isSubsetWith.mjs b/tools/ui/node_modules/es-toolkit/dist/array/isSubsetWith.mjs new file mode 100644 index 0000000000000000000000000000000000000000..6aea1750a1e9bcd1cf0e2da36e95af27b907de32 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/isSubsetWith.mjs @@ -0,0 +1,37 @@ +import { differenceWith } from "./differenceWith.mjs"; +//#region src/array/isSubsetWith.ts +/** +* Checks if the `subset` array is entirely contained within the `superset` array based on a custom equality function. +* +* This function takes two arrays and a custom comparison function. It returns a boolean indicating +* whether all elements in the subset array are present in the superset array, as determined by the provided +* custom equality function. +* +* @template T - The type of elements contained in the arrays. +* @param {T[]} superset - The array that may contain all elements of the subset. +* @param {T[]} subset - The array to check against the superset. +* @param {(x: T, y: T) => boolean} areItemsEqual - A function to determine if two items are equal. +* @returns {boolean} - Returns `true` if all elements of the subset are present in the superset +* according to the custom equality function, otherwise returns `false`. +* +* @example +* ```typescript +* const superset = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const subset = [{ id: 2 }, { id: 1 }]; +* const areItemsEqual = (a, b) => a.id === b.id; +* isSubsetWith(superset, subset, areItemsEqual); // true +* ``` +* +* @example +* ```typescript +* const superset = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const subset = [{ id: 4 }]; +* const areItemsEqual = (a, b) => a.id === b.id; +* isSubsetWith(superset, subset, areItemsEqual); // false +* ``` +*/ +function isSubsetWith(superset, subset, areItemsEqual) { + return differenceWith(subset, superset, areItemsEqual).length === 0; +} +//#endregion +export { isSubsetWith }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/keyBy.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/keyBy.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..3d461dde4c5649ddc18add7a49c5a4e561b1835e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/keyBy.d.mts @@ -0,0 +1,37 @@ +//#region src/array/keyBy.d.ts +/** + * Maps each element of an array based on a provided key-generating function. + * + * This function takes an array and a function that generates a key from each element. It returns + * an object where the keys are the generated keys and the values are the corresponding elements. + * If there are multiple elements generating the same key, the last element among them is used + * as the value. + * + * @template T - The type of elements in the array. + * @template K - The type of keys. + * @param {T[]} arr - The array of elements to be mapped. + * @param {(item: T, index: number, array: readonly T[]) => K} getKeyFromItem - A function that generates a key from an element, its index, and the array. + * @returns {Record} An object where keys are mapped to each element of an array. + * + * @example + * const array = [ + * { category: 'fruit', name: 'apple' }, + * { category: 'fruit', name: 'banana' }, + * { category: 'vegetable', name: 'carrot' } + * ]; + * const result = keyBy(array, item => item.category); + * // result will be: + * // { + * // fruit: { category: 'fruit', name: 'banana' }, + * // vegetable: { category: 'vegetable', name: 'carrot' } + * // } + * + * @example + * // Using index parameter + * const items = ['a', 'b', 'c']; + * const result = keyBy(items, (item, index) => index); + * // result will be: { 0: 'a', 1: 'b', 2: 'c' } + */ +declare function keyBy(arr: readonly T[], getKeyFromItem: (item: T, index: number, array: readonly T[]) => K): Record; +//#endregion +export { keyBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/keyBy.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/keyBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3d461dde4c5649ddc18add7a49c5a4e561b1835e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/keyBy.d.ts @@ -0,0 +1,37 @@ +//#region src/array/keyBy.d.ts +/** + * Maps each element of an array based on a provided key-generating function. + * + * This function takes an array and a function that generates a key from each element. It returns + * an object where the keys are the generated keys and the values are the corresponding elements. + * If there are multiple elements generating the same key, the last element among them is used + * as the value. + * + * @template T - The type of elements in the array. + * @template K - The type of keys. + * @param {T[]} arr - The array of elements to be mapped. + * @param {(item: T, index: number, array: readonly T[]) => K} getKeyFromItem - A function that generates a key from an element, its index, and the array. + * @returns {Record} An object where keys are mapped to each element of an array. + * + * @example + * const array = [ + * { category: 'fruit', name: 'apple' }, + * { category: 'fruit', name: 'banana' }, + * { category: 'vegetable', name: 'carrot' } + * ]; + * const result = keyBy(array, item => item.category); + * // result will be: + * // { + * // fruit: { category: 'fruit', name: 'banana' }, + * // vegetable: { category: 'vegetable', name: 'carrot' } + * // } + * + * @example + * // Using index parameter + * const items = ['a', 'b', 'c']; + * const result = keyBy(items, (item, index) => index); + * // result will be: { 0: 'a', 1: 'b', 2: 'c' } + */ +declare function keyBy(arr: readonly T[], getKeyFromItem: (item: T, index: number, array: readonly T[]) => K): Record; +//#endregion +export { keyBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/keyBy.js b/tools/ui/node_modules/es-toolkit/dist/array/keyBy.js new file mode 100644 index 0000000000000000000000000000000000000000..51bcfd1e69852c33a6bbe6a52b5a016640b35112 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/keyBy.js @@ -0,0 +1,45 @@ +//#region src/array/keyBy.ts +/** +* Maps each element of an array based on a provided key-generating function. +* +* This function takes an array and a function that generates a key from each element. It returns +* an object where the keys are the generated keys and the values are the corresponding elements. +* If there are multiple elements generating the same key, the last element among them is used +* as the value. +* +* @template T - The type of elements in the array. +* @template K - The type of keys. +* @param {T[]} arr - The array of elements to be mapped. +* @param {(item: T, index: number, array: readonly T[]) => K} getKeyFromItem - A function that generates a key from an element, its index, and the array. +* @returns {Record} An object where keys are mapped to each element of an array. +* +* @example +* const array = [ +* { category: 'fruit', name: 'apple' }, +* { category: 'fruit', name: 'banana' }, +* { category: 'vegetable', name: 'carrot' } +* ]; +* const result = keyBy(array, item => item.category); +* // result will be: +* // { +* // fruit: { category: 'fruit', name: 'banana' }, +* // vegetable: { category: 'vegetable', name: 'carrot' } +* // } +* +* @example +* // Using index parameter +* const items = ['a', 'b', 'c']; +* const result = keyBy(items, (item, index) => index); +* // result will be: { 0: 'a', 1: 'b', 2: 'c' } +*/ +function keyBy(arr, getKeyFromItem) { + const result = {}; + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + const key = getKeyFromItem(item, i, arr); + result[key] = item; + } + return result; +} +//#endregion +exports.keyBy = keyBy; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/keyBy.mjs b/tools/ui/node_modules/es-toolkit/dist/array/keyBy.mjs new file mode 100644 index 0000000000000000000000000000000000000000..a8c01f310769956b6825e96d92348982f6876ddc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/keyBy.mjs @@ -0,0 +1,45 @@ +//#region src/array/keyBy.ts +/** +* Maps each element of an array based on a provided key-generating function. +* +* This function takes an array and a function that generates a key from each element. It returns +* an object where the keys are the generated keys and the values are the corresponding elements. +* If there are multiple elements generating the same key, the last element among them is used +* as the value. +* +* @template T - The type of elements in the array. +* @template K - The type of keys. +* @param {T[]} arr - The array of elements to be mapped. +* @param {(item: T, index: number, array: readonly T[]) => K} getKeyFromItem - A function that generates a key from an element, its index, and the array. +* @returns {Record} An object where keys are mapped to each element of an array. +* +* @example +* const array = [ +* { category: 'fruit', name: 'apple' }, +* { category: 'fruit', name: 'banana' }, +* { category: 'vegetable', name: 'carrot' } +* ]; +* const result = keyBy(array, item => item.category); +* // result will be: +* // { +* // fruit: { category: 'fruit', name: 'banana' }, +* // vegetable: { category: 'vegetable', name: 'carrot' } +* // } +* +* @example +* // Using index parameter +* const items = ['a', 'b', 'c']; +* const result = keyBy(items, (item, index) => index); +* // result will be: { 0: 'a', 1: 'b', 2: 'c' } +*/ +function keyBy(arr, getKeyFromItem) { + const result = {}; + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + const key = getKeyFromItem(item, i, arr); + result[key] = item; + } + return result; +} +//#endregion +export { keyBy }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/last.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/last.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..e5a9f03e8036acbe65470bc3a752b226600a729b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/last.d.mts @@ -0,0 +1,49 @@ +//#region src/array/last.d.ts +/** + * Returns the last element of an array. + * + * This function takes an array and returns the last element of the array. + * If the array is empty, the function returns `undefined`. + * + * Unlike some implementations, this function is optimized for performance + * by directly accessing the last index of the array. + * + * @template T - The type of elements in the array. + * @param {[...T[], T]} arr - The array from which to get the last element. + * @returns {T} The last element of the array, or `undefined` if the array is empty. + * + * @example + * const arr = [1, 2, 3]; + * const lastElement = last(arr); + * // lastElement will be 3 + * + * const emptyArr: number[] = []; + * const noElement = last(emptyArr); + * // noElement will be undefined + */ +declare function last(arr: readonly [...T[], T]): T; +/** + * Returns the last element of an array. + * + * This function takes an array and returns the last element of the array. + * If the array is empty, the function returns `undefined`. + * + * Unlike some implementations, this function is optimized for performance + * by directly accessing the last index of the array. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array from which to get the last element. + * @returns {T | undefined} The last element of the array, or `undefined` if the array is empty. + * + * @example + * const arr = [1, 2, 3]; + * const lastElement = last(arr); + * // lastElement will be 3 + * + * const emptyArr: number[] = []; + * const noElement = last(emptyArr); + * // noElement will be undefined + */ +declare function last(arr: readonly T[]): T | undefined; +//#endregion +export { last }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/last.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/last.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e5a9f03e8036acbe65470bc3a752b226600a729b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/last.d.ts @@ -0,0 +1,49 @@ +//#region src/array/last.d.ts +/** + * Returns the last element of an array. + * + * This function takes an array and returns the last element of the array. + * If the array is empty, the function returns `undefined`. + * + * Unlike some implementations, this function is optimized for performance + * by directly accessing the last index of the array. + * + * @template T - The type of elements in the array. + * @param {[...T[], T]} arr - The array from which to get the last element. + * @returns {T} The last element of the array, or `undefined` if the array is empty. + * + * @example + * const arr = [1, 2, 3]; + * const lastElement = last(arr); + * // lastElement will be 3 + * + * const emptyArr: number[] = []; + * const noElement = last(emptyArr); + * // noElement will be undefined + */ +declare function last(arr: readonly [...T[], T]): T; +/** + * Returns the last element of an array. + * + * This function takes an array and returns the last element of the array. + * If the array is empty, the function returns `undefined`. + * + * Unlike some implementations, this function is optimized for performance + * by directly accessing the last index of the array. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array from which to get the last element. + * @returns {T | undefined} The last element of the array, or `undefined` if the array is empty. + * + * @example + * const arr = [1, 2, 3]; + * const lastElement = last(arr); + * // lastElement will be 3 + * + * const emptyArr: number[] = []; + * const noElement = last(emptyArr); + * // noElement will be undefined + */ +declare function last(arr: readonly T[]): T | undefined; +//#endregion +export { last }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/last.js b/tools/ui/node_modules/es-toolkit/dist/array/last.js new file mode 100644 index 0000000000000000000000000000000000000000..431ceee60347956ea6881462fcba7afc4599179d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/last.js @@ -0,0 +1,28 @@ +//#region src/array/last.ts +/** +* Returns the last element of an array. +* +* This function takes an array and returns the last element of the array. +* If the array is empty, the function returns `undefined`. +* +* Unlike some implementations, this function is optimized for performance +* by directly accessing the last index of the array. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array from which to get the last element. +* @returns {T | undefined} The last element of the array, or `undefined` if the array is empty. +* +* @example +* const arr = [1, 2, 3]; +* const lastElement = last(arr); +* // lastElement will be 3 +* +* const emptyArr: number[] = []; +* const noElement = last(emptyArr); +* // noElement will be undefined +*/ +function last(arr) { + return arr[arr.length - 1]; +} +//#endregion +exports.last = last; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/last.mjs b/tools/ui/node_modules/es-toolkit/dist/array/last.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d6436fa268a4ebd20de8d232131afd156d5aab2f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/last.mjs @@ -0,0 +1,28 @@ +//#region src/array/last.ts +/** +* Returns the last element of an array. +* +* This function takes an array and returns the last element of the array. +* If the array is empty, the function returns `undefined`. +* +* Unlike some implementations, this function is optimized for performance +* by directly accessing the last index of the array. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array from which to get the last element. +* @returns {T | undefined} The last element of the array, or `undefined` if the array is empty. +* +* @example +* const arr = [1, 2, 3]; +* const lastElement = last(arr); +* // lastElement will be 3 +* +* const emptyArr: number[] = []; +* const noElement = last(emptyArr); +* // noElement will be undefined +*/ +function last(arr) { + return arr[arr.length - 1]; +} +//#endregion +export { last }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/limitAsync.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/limitAsync.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..f662b60bd0e67ec80acad407e03dfcda186b0880 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/limitAsync.d.mts @@ -0,0 +1,35 @@ +//#region src/array/limitAsync.d.ts +/** + * Wraps an async function to limit the number of concurrent executions. + * + * This function creates a wrapper around an async callback that ensures at most + * `concurrency` number of executions can run simultaneously. Additional calls will + * wait until a slot becomes available. + * + * @template F - The type of the async function to wrap. + * @param {F} callback The async function to wrap with concurrency control. + * @param {number} concurrency Maximum number of concurrent executions allowed. + * @returns {F} A wrapped version of the callback with concurrency limiting. + * @example + * const limitedFetch = limitAsync(async (url) => { + * return await fetch(url); + * }, 3); + * + * // Only 3 fetches will run concurrently + * const urls = ['url1', 'url2', 'url3', 'url4', 'url5']; + * await Promise.all(urls.map(url => limitedFetch(url))); + * + * @example + * const processItem = async (item) => { + * // Expensive async operation + * return await heavyComputation(item); + * }; + * + * const limitedProcess = limitAsync(processItem, 2); + * const items = [1, 2, 3, 4, 5]; + * // At most 2 items will be processed concurrently + * await Promise.all(items.map(item => limitedProcess(item))); + */ +declare function limitAsync Promise>(callback: F, concurrency: number): F; +//#endregion +export { limitAsync }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/limitAsync.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/limitAsync.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f662b60bd0e67ec80acad407e03dfcda186b0880 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/limitAsync.d.ts @@ -0,0 +1,35 @@ +//#region src/array/limitAsync.d.ts +/** + * Wraps an async function to limit the number of concurrent executions. + * + * This function creates a wrapper around an async callback that ensures at most + * `concurrency` number of executions can run simultaneously. Additional calls will + * wait until a slot becomes available. + * + * @template F - The type of the async function to wrap. + * @param {F} callback The async function to wrap with concurrency control. + * @param {number} concurrency Maximum number of concurrent executions allowed. + * @returns {F} A wrapped version of the callback with concurrency limiting. + * @example + * const limitedFetch = limitAsync(async (url) => { + * return await fetch(url); + * }, 3); + * + * // Only 3 fetches will run concurrently + * const urls = ['url1', 'url2', 'url3', 'url4', 'url5']; + * await Promise.all(urls.map(url => limitedFetch(url))); + * + * @example + * const processItem = async (item) => { + * // Expensive async operation + * return await heavyComputation(item); + * }; + * + * const limitedProcess = limitAsync(processItem, 2); + * const items = [1, 2, 3, 4, 5]; + * // At most 2 items will be processed concurrently + * await Promise.all(items.map(item => limitedProcess(item))); + */ +declare function limitAsync Promise>(callback: F, concurrency: number): F; +//#endregion +export { limitAsync }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/limitAsync.js b/tools/ui/node_modules/es-toolkit/dist/array/limitAsync.js new file mode 100644 index 0000000000000000000000000000000000000000..b8a3ce9f24ae108cb13e8b40c3fcf553f084e539 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/limitAsync.js @@ -0,0 +1,46 @@ +const require_semaphore = require("../promise/semaphore.js"); +//#region src/array/limitAsync.ts +/** +* Wraps an async function to limit the number of concurrent executions. +* +* This function creates a wrapper around an async callback that ensures at most +* `concurrency` number of executions can run simultaneously. Additional calls will +* wait until a slot becomes available. +* +* @template F - The type of the async function to wrap. +* @param {F} callback The async function to wrap with concurrency control. +* @param {number} concurrency Maximum number of concurrent executions allowed. +* @returns {F} A wrapped version of the callback with concurrency limiting. +* @example +* const limitedFetch = limitAsync(async (url) => { +* return await fetch(url); +* }, 3); +* +* // Only 3 fetches will run concurrently +* const urls = ['url1', 'url2', 'url3', 'url4', 'url5']; +* await Promise.all(urls.map(url => limitedFetch(url))); +* +* @example +* const processItem = async (item) => { +* // Expensive async operation +* return await heavyComputation(item); +* }; +* +* const limitedProcess = limitAsync(processItem, 2); +* const items = [1, 2, 3, 4, 5]; +* // At most 2 items will be processed concurrently +* await Promise.all(items.map(item => limitedProcess(item))); +*/ +function limitAsync(callback, concurrency) { + const semaphore = new require_semaphore.Semaphore(concurrency); + return async function(...args) { + try { + await semaphore.acquire(); + return await callback.apply(this, args); + } finally { + semaphore.release(); + } + }; +} +//#endregion +exports.limitAsync = limitAsync; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/limitAsync.mjs b/tools/ui/node_modules/es-toolkit/dist/array/limitAsync.mjs new file mode 100644 index 0000000000000000000000000000000000000000..de62105233cb45ed5bd0ac284d46962187df8bc2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/limitAsync.mjs @@ -0,0 +1,46 @@ +import { Semaphore } from "../promise/semaphore.mjs"; +//#region src/array/limitAsync.ts +/** +* Wraps an async function to limit the number of concurrent executions. +* +* This function creates a wrapper around an async callback that ensures at most +* `concurrency` number of executions can run simultaneously. Additional calls will +* wait until a slot becomes available. +* +* @template F - The type of the async function to wrap. +* @param {F} callback The async function to wrap with concurrency control. +* @param {number} concurrency Maximum number of concurrent executions allowed. +* @returns {F} A wrapped version of the callback with concurrency limiting. +* @example +* const limitedFetch = limitAsync(async (url) => { +* return await fetch(url); +* }, 3); +* +* // Only 3 fetches will run concurrently +* const urls = ['url1', 'url2', 'url3', 'url4', 'url5']; +* await Promise.all(urls.map(url => limitedFetch(url))); +* +* @example +* const processItem = async (item) => { +* // Expensive async operation +* return await heavyComputation(item); +* }; +* +* const limitedProcess = limitAsync(processItem, 2); +* const items = [1, 2, 3, 4, 5]; +* // At most 2 items will be processed concurrently +* await Promise.all(items.map(item => limitedProcess(item))); +*/ +function limitAsync(callback, concurrency) { + const semaphore = new Semaphore(concurrency); + return async function(...args) { + try { + await semaphore.acquire(); + return await callback.apply(this, args); + } finally { + semaphore.release(); + } + }; +} +//#endregion +export { limitAsync }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/mapAsync.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/mapAsync.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..fdd4b16118619b466ea3b491ec4ffaea9b8f7123 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/mapAsync.d.mts @@ -0,0 +1,35 @@ +//#region src/array/mapAsync.d.ts +interface MapAsyncOptions { + concurrency?: number; +} +/** + * Transforms each element in an array using an async callback function and returns + * a promise that resolves to an array of transformed values. + * + * @template T - The type of elements in the input array. + * @template R - The type of elements in the output array. + * @param {readonly T[]} array The array to transform. + * @param {(item: T, index: number, array: readonly T[]) => Promise} callback An async function that transforms each element. + * @param {MapAsyncOptions} [options] Optional configuration object. + * @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently. + * @returns {Promise} A promise that resolves to an array of transformed values. + * @example + * const users = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const userDetails = await mapAsync(users, async (user) => { + * return await fetchUserDetails(user.id); + * }); + * // Returns: [{ id: 1, name: '...' }, { id: 2, name: '...' }, { id: 3, name: '...' }] + * + * @example + * // With concurrency limit + * const numbers = [1, 2, 3, 4, 5]; + * const results = await mapAsync( + * numbers, + * async (n) => await slowOperation(n), + * { concurrency: 2 } + * ); + * // Processes at most 2 operations concurrently + */ +declare function mapAsync(array: readonly T[], callback: (item: T, index: number, array: readonly T[]) => Promise, options?: MapAsyncOptions): Promise; +//#endregion +export { mapAsync }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/mapAsync.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/mapAsync.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fdd4b16118619b466ea3b491ec4ffaea9b8f7123 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/mapAsync.d.ts @@ -0,0 +1,35 @@ +//#region src/array/mapAsync.d.ts +interface MapAsyncOptions { + concurrency?: number; +} +/** + * Transforms each element in an array using an async callback function and returns + * a promise that resolves to an array of transformed values. + * + * @template T - The type of elements in the input array. + * @template R - The type of elements in the output array. + * @param {readonly T[]} array The array to transform. + * @param {(item: T, index: number, array: readonly T[]) => Promise} callback An async function that transforms each element. + * @param {MapAsyncOptions} [options] Optional configuration object. + * @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently. + * @returns {Promise} A promise that resolves to an array of transformed values. + * @example + * const users = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const userDetails = await mapAsync(users, async (user) => { + * return await fetchUserDetails(user.id); + * }); + * // Returns: [{ id: 1, name: '...' }, { id: 2, name: '...' }, { id: 3, name: '...' }] + * + * @example + * // With concurrency limit + * const numbers = [1, 2, 3, 4, 5]; + * const results = await mapAsync( + * numbers, + * async (n) => await slowOperation(n), + * { concurrency: 2 } + * ); + * // Processes at most 2 operations concurrently + */ +declare function mapAsync(array: readonly T[], callback: (item: T, index: number, array: readonly T[]) => Promise, options?: MapAsyncOptions): Promise; +//#endregion +export { mapAsync }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/mapAsync.js b/tools/ui/node_modules/es-toolkit/dist/array/mapAsync.js new file mode 100644 index 0000000000000000000000000000000000000000..25a29fa01533fd3b3d8d72fd24e21078bd061e42 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/mapAsync.js @@ -0,0 +1,36 @@ +const require_limitAsync = require("./limitAsync.js"); +//#region src/array/mapAsync.ts +/** +* Transforms each element in an array using an async callback function and returns +* a promise that resolves to an array of transformed values. +* +* @template T - The type of elements in the input array. +* @template R - The type of elements in the output array. +* @param {readonly T[]} array The array to transform. +* @param {(item: T, index: number, array: readonly T[]) => Promise} callback An async function that transforms each element. +* @param {MapAsyncOptions} [options] Optional configuration object. +* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently. +* @returns {Promise} A promise that resolves to an array of transformed values. +* @example +* const users = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const userDetails = await mapAsync(users, async (user) => { +* return await fetchUserDetails(user.id); +* }); +* // Returns: [{ id: 1, name: '...' }, { id: 2, name: '...' }, { id: 3, name: '...' }] +* +* @example +* // With concurrency limit +* const numbers = [1, 2, 3, 4, 5]; +* const results = await mapAsync( +* numbers, +* async (n) => await slowOperation(n), +* { concurrency: 2 } +* ); +* // Processes at most 2 operations concurrently +*/ +function mapAsync(array, callback, options) { + if (options?.concurrency != null) callback = require_limitAsync.limitAsync(callback, options.concurrency); + return Promise.all(array.map(callback)); +} +//#endregion +exports.mapAsync = mapAsync; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/mapAsync.mjs b/tools/ui/node_modules/es-toolkit/dist/array/mapAsync.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f16ca75aca48fefef8dc1475e63e6e4ca2242694 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/mapAsync.mjs @@ -0,0 +1,36 @@ +import { limitAsync } from "./limitAsync.mjs"; +//#region src/array/mapAsync.ts +/** +* Transforms each element in an array using an async callback function and returns +* a promise that resolves to an array of transformed values. +* +* @template T - The type of elements in the input array. +* @template R - The type of elements in the output array. +* @param {readonly T[]} array The array to transform. +* @param {(item: T, index: number, array: readonly T[]) => Promise} callback An async function that transforms each element. +* @param {MapAsyncOptions} [options] Optional configuration object. +* @param {number} [options.concurrency] Maximum number of concurrent async operations. If not specified, all operations run concurrently. +* @returns {Promise} A promise that resolves to an array of transformed values. +* @example +* const users = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const userDetails = await mapAsync(users, async (user) => { +* return await fetchUserDetails(user.id); +* }); +* // Returns: [{ id: 1, name: '...' }, { id: 2, name: '...' }, { id: 3, name: '...' }] +* +* @example +* // With concurrency limit +* const numbers = [1, 2, 3, 4, 5]; +* const results = await mapAsync( +* numbers, +* async (n) => await slowOperation(n), +* { concurrency: 2 } +* ); +* // Processes at most 2 operations concurrently +*/ +function mapAsync(array, callback, options) { + if (options?.concurrency != null) callback = limitAsync(callback, options.concurrency); + return Promise.all(array.map(callback)); +} +//#endregion +export { mapAsync }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/maxBy.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/maxBy.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..b79a4c09f56b51fc9bc88d2af6835fd7bd38efd1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/maxBy.d.mts @@ -0,0 +1,46 @@ +//#region src/array/maxBy.d.ts +/** + * Finds the element in an array that has the maximum value when applying + * the `getValue` function to each element. + * + * @template T - The type of elements in the array. + * @param {[T, ...T[]]} items The nonempty array of elements to search. + * @param {(element: T) => number} getValue A function that selects a numeric value from each element. + * @returns {T} The element with the maximum value as determined by the `getValue` function. + * @example + * maxBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 3 } + * maxBy([], x => x.a); // Returns: undefined + * maxBy( + * [ + * { name: 'john', age: 30 }, + * { name: 'jane', age: 28 }, + * { name: 'joe', age: 26 }, + * ], + * x => x.age + * ); // Returns: { name: 'john', age: 30 } + */ +declare function maxBy(items: readonly [T, ...T[]], getValue: (element: T, index: number, array: readonly T[]) => number): T; +/** + * Finds the element in an array that has the maximum value when applying + * the `getValue` function to each element. + * + * @template T - The type of elements in the array. + * @param {T[]} items The array of elements to search. + * @param {(element: T, index: number, array: readonly T[]) => number} getValue A function that selects a numeric value from each element. + * @returns {T | undefined} The element with the maximum value as determined by the `getValue` function, + * or `undefined` if the array is empty. + * @example + * maxBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 3 } + * maxBy([], x => x.a); // Returns: undefined + * maxBy( + * [ + * { name: 'john', age: 30 }, + * { name: 'jane', age: 28 }, + * { name: 'joe', age: 26 }, + * ], + * x => x.age + * ); // Returns: { name: 'john', age: 30 } + */ +declare function maxBy(items: readonly T[], getValue: (element: T, index: number, array: readonly T[]) => number): T | undefined; +//#endregion +export { maxBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/maxBy.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/maxBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b79a4c09f56b51fc9bc88d2af6835fd7bd38efd1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/maxBy.d.ts @@ -0,0 +1,46 @@ +//#region src/array/maxBy.d.ts +/** + * Finds the element in an array that has the maximum value when applying + * the `getValue` function to each element. + * + * @template T - The type of elements in the array. + * @param {[T, ...T[]]} items The nonempty array of elements to search. + * @param {(element: T) => number} getValue A function that selects a numeric value from each element. + * @returns {T} The element with the maximum value as determined by the `getValue` function. + * @example + * maxBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 3 } + * maxBy([], x => x.a); // Returns: undefined + * maxBy( + * [ + * { name: 'john', age: 30 }, + * { name: 'jane', age: 28 }, + * { name: 'joe', age: 26 }, + * ], + * x => x.age + * ); // Returns: { name: 'john', age: 30 } + */ +declare function maxBy(items: readonly [T, ...T[]], getValue: (element: T, index: number, array: readonly T[]) => number): T; +/** + * Finds the element in an array that has the maximum value when applying + * the `getValue` function to each element. + * + * @template T - The type of elements in the array. + * @param {T[]} items The array of elements to search. + * @param {(element: T, index: number, array: readonly T[]) => number} getValue A function that selects a numeric value from each element. + * @returns {T | undefined} The element with the maximum value as determined by the `getValue` function, + * or `undefined` if the array is empty. + * @example + * maxBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 3 } + * maxBy([], x => x.a); // Returns: undefined + * maxBy( + * [ + * { name: 'john', age: 30 }, + * { name: 'jane', age: 28 }, + * { name: 'joe', age: 26 }, + * ], + * x => x.age + * ); // Returns: { name: 'john', age: 30 } + */ +declare function maxBy(items: readonly T[], getValue: (element: T, index: number, array: readonly T[]) => number): T | undefined; +//#endregion +export { maxBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/maxBy.js b/tools/ui/node_modules/es-toolkit/dist/array/maxBy.js new file mode 100644 index 0000000000000000000000000000000000000000..eb81a06f341d817f811ce9817d5fe0137b7936d8 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/maxBy.js @@ -0,0 +1,38 @@ +//#region src/array/maxBy.ts +/** +* Finds the element in an array that has the maximum value when applying +* the `getValue` function to each element. +* +* @template T - The type of elements in the array. +* @param {T[]} items The array of elements to search. +* @param {(element: T, index: number, array: readonly T[]) => number} getValue A function that selects a numeric value from each element. +* @returns {T | undefined} The element with the maximum value as determined by the `getValue` function, +* or `undefined` if the array is empty. +* @example +* maxBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 3 } +* maxBy([], x => x.a); // Returns: undefined +* maxBy( +* [ +* { name: 'john', age: 30 }, +* { name: 'jane', age: 28 }, +* { name: 'joe', age: 26 }, +* ], +* x => x.age +* ); // Returns: { name: 'john', age: 30 } +*/ +function maxBy(items, getValue) { + if (items.length === 0) return; + let maxElement = items[0]; + let max = getValue(maxElement, 0, items); + for (let i = 1; i < items.length; i++) { + const element = items[i]; + const value = getValue(element, i, items); + if (value > max) { + max = value; + maxElement = element; + } + } + return maxElement; +} +//#endregion +exports.maxBy = maxBy; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/maxBy.mjs b/tools/ui/node_modules/es-toolkit/dist/array/maxBy.mjs new file mode 100644 index 0000000000000000000000000000000000000000..34abc150651954fddec32ab239fdc757a160d286 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/maxBy.mjs @@ -0,0 +1,38 @@ +//#region src/array/maxBy.ts +/** +* Finds the element in an array that has the maximum value when applying +* the `getValue` function to each element. +* +* @template T - The type of elements in the array. +* @param {T[]} items The array of elements to search. +* @param {(element: T, index: number, array: readonly T[]) => number} getValue A function that selects a numeric value from each element. +* @returns {T | undefined} The element with the maximum value as determined by the `getValue` function, +* or `undefined` if the array is empty. +* @example +* maxBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 3 } +* maxBy([], x => x.a); // Returns: undefined +* maxBy( +* [ +* { name: 'john', age: 30 }, +* { name: 'jane', age: 28 }, +* { name: 'joe', age: 26 }, +* ], +* x => x.age +* ); // Returns: { name: 'john', age: 30 } +*/ +function maxBy(items, getValue) { + if (items.length === 0) return; + let maxElement = items[0]; + let max = getValue(maxElement, 0, items); + for (let i = 1; i < items.length; i++) { + const element = items[i]; + const value = getValue(element, i, items); + if (value > max) { + max = value; + maxElement = element; + } + } + return maxElement; +} +//#endregion +export { maxBy }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/minBy.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/minBy.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..6b64f39089c4ddb836eeb5609f3727d436c36dbb --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/minBy.d.mts @@ -0,0 +1,46 @@ +//#region src/array/minBy.d.ts +/** + * Finds the element in an array that has the minimum value when applying + * the `getValue` function to each element. + * + * @template T - The type of elements in the array. + * @param {[T, ...T[]]} items The nonempty array of elements to search. + * @param {(element: T) => number} getValue A function that selects a numeric value from each element. + * @returns {T} The element with the minimum value as determined by the `getValue` function. + * @example + * minBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 1 } + * minBy([], x => x.a); // Returns: undefined + * minBy( + * [ + * { name: 'john', age: 30 }, + * { name: 'jane', age: 28 }, + * { name: 'joe', age: 26 }, + * ], + * x => x.age + * ); // Returns: { name: 'joe', age: 26 } + */ +declare function minBy(items: readonly [T, ...T[]], getValue: (element: T, index: number, array: readonly T[]) => number): T; +/** + * Finds the element in an array that has the minimum value when applying + * the `getValue` function to each element. + * + * @template T - The type of elements in the array. + * @param {T[]} items The array of elements to search. + * @param {(element: T, index: number, array: readonly T[]) => number} getValue A function that selects a numeric value from each element. + * @returns {T | undefined} The element with the minimum value as determined by the `getValue` function, + * or `undefined` if the array is empty. + * @example + * minBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 1 } + * minBy([], x => x.a); // Returns: undefined + * minBy( + * [ + * { name: 'john', age: 30 }, + * { name: 'jane', age: 28 }, + * { name: 'joe', age: 26 }, + * ], + * x => x.age + * ); // Returns: { name: 'joe', age: 26 } + */ +declare function minBy(items: readonly T[], getValue: (element: T, index: number, array: readonly T[]) => number): T | undefined; +//#endregion +export { minBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/minBy.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/minBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6b64f39089c4ddb836eeb5609f3727d436c36dbb --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/minBy.d.ts @@ -0,0 +1,46 @@ +//#region src/array/minBy.d.ts +/** + * Finds the element in an array that has the minimum value when applying + * the `getValue` function to each element. + * + * @template T - The type of elements in the array. + * @param {[T, ...T[]]} items The nonempty array of elements to search. + * @param {(element: T) => number} getValue A function that selects a numeric value from each element. + * @returns {T} The element with the minimum value as determined by the `getValue` function. + * @example + * minBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 1 } + * minBy([], x => x.a); // Returns: undefined + * minBy( + * [ + * { name: 'john', age: 30 }, + * { name: 'jane', age: 28 }, + * { name: 'joe', age: 26 }, + * ], + * x => x.age + * ); // Returns: { name: 'joe', age: 26 } + */ +declare function minBy(items: readonly [T, ...T[]], getValue: (element: T, index: number, array: readonly T[]) => number): T; +/** + * Finds the element in an array that has the minimum value when applying + * the `getValue` function to each element. + * + * @template T - The type of elements in the array. + * @param {T[]} items The array of elements to search. + * @param {(element: T, index: number, array: readonly T[]) => number} getValue A function that selects a numeric value from each element. + * @returns {T | undefined} The element with the minimum value as determined by the `getValue` function, + * or `undefined` if the array is empty. + * @example + * minBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 1 } + * minBy([], x => x.a); // Returns: undefined + * minBy( + * [ + * { name: 'john', age: 30 }, + * { name: 'jane', age: 28 }, + * { name: 'joe', age: 26 }, + * ], + * x => x.age + * ); // Returns: { name: 'joe', age: 26 } + */ +declare function minBy(items: readonly T[], getValue: (element: T, index: number, array: readonly T[]) => number): T | undefined; +//#endregion +export { minBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/minBy.js b/tools/ui/node_modules/es-toolkit/dist/array/minBy.js new file mode 100644 index 0000000000000000000000000000000000000000..ca662687deb17d6601fb561c5f7840c4226a0a1d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/minBy.js @@ -0,0 +1,38 @@ +//#region src/array/minBy.ts +/** +* Finds the element in an array that has the minimum value when applying +* the `getValue` function to each element. +* +* @template T - The type of elements in the array. +* @param {T[]} items The array of elements to search. +* @param {(element: T, index: number, array: readonly T[]) => number} getValue A function that selects a numeric value from each element. +* @returns {T | undefined} The element with the minimum value as determined by the `getValue` function, +* or `undefined` if the array is empty. +* @example +* minBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 1 } +* minBy([], x => x.a); // Returns: undefined +* minBy( +* [ +* { name: 'john', age: 30 }, +* { name: 'jane', age: 28 }, +* { name: 'joe', age: 26 }, +* ], +* x => x.age +* ); // Returns: { name: 'joe', age: 26 } +*/ +function minBy(items, getValue) { + if (items.length === 0) return; + let minElement = items[0]; + let min = getValue(minElement, 0, items); + for (let i = 1; i < items.length; i++) { + const element = items[i]; + const value = getValue(element, i, items); + if (value < min) { + min = value; + minElement = element; + } + } + return minElement; +} +//#endregion +exports.minBy = minBy; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/minBy.mjs b/tools/ui/node_modules/es-toolkit/dist/array/minBy.mjs new file mode 100644 index 0000000000000000000000000000000000000000..91eb8db38ad35de0f677de69977f985b8bddd653 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/minBy.mjs @@ -0,0 +1,38 @@ +//#region src/array/minBy.ts +/** +* Finds the element in an array that has the minimum value when applying +* the `getValue` function to each element. +* +* @template T - The type of elements in the array. +* @param {T[]} items The array of elements to search. +* @param {(element: T, index: number, array: readonly T[]) => number} getValue A function that selects a numeric value from each element. +* @returns {T | undefined} The element with the minimum value as determined by the `getValue` function, +* or `undefined` if the array is empty. +* @example +* minBy([{ a: 1 }, { a: 2 }, { a: 3 }], x => x.a); // Returns: { a: 1 } +* minBy([], x => x.a); // Returns: undefined +* minBy( +* [ +* { name: 'john', age: 30 }, +* { name: 'jane', age: 28 }, +* { name: 'joe', age: 26 }, +* ], +* x => x.age +* ); // Returns: { name: 'joe', age: 26 } +*/ +function minBy(items, getValue) { + if (items.length === 0) return; + let minElement = items[0]; + let min = getValue(minElement, 0, items); + for (let i = 1; i < items.length; i++) { + const element = items[i]; + const value = getValue(element, i, items); + if (value < min) { + min = value; + minElement = element; + } + } + return minElement; +} +//#endregion +export { minBy }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/orderBy.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/orderBy.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..62ea2c9568920ae0bf6f382111b70f0d2cf2877a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/orderBy.d.mts @@ -0,0 +1,38 @@ +//#region src/array/orderBy.d.ts +/** + * Sorts an array of objects based on the given `criteria` and their corresponding order directions. + * + * - If you provide keys, it sorts the objects by the values of those keys. + * - If you provide functions, it sorts based on the values returned by those functions. + * + * The function returns the array of objects sorted in corresponding order directions. + * If two objects have the same value for the current criterion, it uses the next criterion to determine their order. + * If the number of orders is less than the number of criteria, it uses the last order for the rest of the criteria. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array of objects to be sorted. + * @param {Array<((item: T) => unknown) | keyof T>} criteria - The criteria for sorting. This can be an array of object keys or functions that return values used for sorting. + * @param {Array<'asc' | 'desc'>} orders - An array of order directions ('asc' for ascending or 'desc' for descending). + * @returns {T[]} - The sorted array. + * + * @example + * // Sort an array of objects by 'user' in ascending order and 'age' in descending order. + * const users = [ + * { user: 'fred', age: 48 }, + * { user: 'barney', age: 34 }, + * { user: 'fred', age: 40 }, + * { user: 'barney', age: 36 }, + * ]; + * + * const result = orderBy(users, [obj => obj.user, 'age'], ['asc', 'desc']); + * // result will be: + * // [ + * // { user: 'barney', age: 36 }, + * // { user: 'barney', age: 34 }, + * // { user: 'fred', age: 48 }, + * // { user: 'fred', age: 40 }, + * // ] + */ +declare function orderBy(arr: readonly T[], criteria: Array<((item: T) => unknown) | keyof T>, orders: Array<'asc' | 'desc'>): T[]; +//#endregion +export { orderBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/orderBy.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/orderBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..62ea2c9568920ae0bf6f382111b70f0d2cf2877a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/orderBy.d.ts @@ -0,0 +1,38 @@ +//#region src/array/orderBy.d.ts +/** + * Sorts an array of objects based on the given `criteria` and their corresponding order directions. + * + * - If you provide keys, it sorts the objects by the values of those keys. + * - If you provide functions, it sorts based on the values returned by those functions. + * + * The function returns the array of objects sorted in corresponding order directions. + * If two objects have the same value for the current criterion, it uses the next criterion to determine their order. + * If the number of orders is less than the number of criteria, it uses the last order for the rest of the criteria. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array of objects to be sorted. + * @param {Array<((item: T) => unknown) | keyof T>} criteria - The criteria for sorting. This can be an array of object keys or functions that return values used for sorting. + * @param {Array<'asc' | 'desc'>} orders - An array of order directions ('asc' for ascending or 'desc' for descending). + * @returns {T[]} - The sorted array. + * + * @example + * // Sort an array of objects by 'user' in ascending order and 'age' in descending order. + * const users = [ + * { user: 'fred', age: 48 }, + * { user: 'barney', age: 34 }, + * { user: 'fred', age: 40 }, + * { user: 'barney', age: 36 }, + * ]; + * + * const result = orderBy(users, [obj => obj.user, 'age'], ['asc', 'desc']); + * // result will be: + * // [ + * // { user: 'barney', age: 36 }, + * // { user: 'barney', age: 34 }, + * // { user: 'fred', age: 48 }, + * // { user: 'fred', age: 40 }, + * // ] + */ +declare function orderBy(arr: readonly T[], criteria: Array<((item: T) => unknown) | keyof T>, orders: Array<'asc' | 'desc'>): T[]; +//#endregion +export { orderBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/orderBy.js b/tools/ui/node_modules/es-toolkit/dist/array/orderBy.js new file mode 100644 index 0000000000000000000000000000000000000000..8b333249c29a9e3891d60933501b4418795b2fb8 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/orderBy.js @@ -0,0 +1,53 @@ +const require_compareValues = require("../_internal/compareValues.js"); +//#region src/array/orderBy.ts +/** +* Sorts an array of objects based on the given `criteria` and their corresponding order directions. +* +* - If you provide keys, it sorts the objects by the values of those keys. +* - If you provide functions, it sorts based on the values returned by those functions. +* +* The function returns the array of objects sorted in corresponding order directions. +* If two objects have the same value for the current criterion, it uses the next criterion to determine their order. +* If the number of orders is less than the number of criteria, it uses the last order for the rest of the criteria. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array of objects to be sorted. +* @param {Array<((item: T) => unknown) | keyof T>} criteria - The criteria for sorting. This can be an array of object keys or functions that return values used for sorting. +* @param {Array<'asc' | 'desc'>} orders - An array of order directions ('asc' for ascending or 'desc' for descending). +* @returns {T[]} - The sorted array. +* +* @example +* // Sort an array of objects by 'user' in ascending order and 'age' in descending order. +* const users = [ +* { user: 'fred', age: 48 }, +* { user: 'barney', age: 34 }, +* { user: 'fred', age: 40 }, +* { user: 'barney', age: 36 }, +* ]; +* +* const result = orderBy(users, [obj => obj.user, 'age'], ['asc', 'desc']); +* // result will be: +* // [ +* // { user: 'barney', age: 36 }, +* // { user: 'barney', age: 34 }, +* // { user: 'fred', age: 48 }, +* // { user: 'fred', age: 40 }, +* // ] +*/ +function orderBy(arr, criteria, orders) { + return arr.slice().sort((a, b) => { + const ordersLength = orders.length; + for (let i = 0; i < criteria.length; i++) { + const order = ordersLength > i ? orders[i] : orders[ordersLength - 1]; + const criterion = criteria[i]; + const criterionIsFunction = typeof criterion === "function"; + const valueA = criterionIsFunction ? criterion(a) : a[criterion]; + const valueB = criterionIsFunction ? criterion(b) : b[criterion]; + const result = require_compareValues.compareValues(valueA, valueB, order); + if (result !== 0) return result; + } + return 0; + }); +} +//#endregion +exports.orderBy = orderBy; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/orderBy.mjs b/tools/ui/node_modules/es-toolkit/dist/array/orderBy.mjs new file mode 100644 index 0000000000000000000000000000000000000000..2c0bdc4052505747bc6d8d90d4f5dd634d10c948 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/orderBy.mjs @@ -0,0 +1,51 @@ +import { compareValues } from "../_internal/compareValues.mjs"; +//#region src/array/orderBy.ts +/** +* Sorts an array of objects based on the given `criteria` and their corresponding order directions. +* +* - If you provide keys, it sorts the objects by the values of those keys. +* - If you provide functions, it sorts based on the values returned by those functions. +* +* The function returns the array of objects sorted in corresponding order directions. +* If two objects have the same value for the current criterion, it uses the next criterion to determine their order. +* If the number of orders is less than the number of criteria, it uses the last order for the rest of the criteria. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array of objects to be sorted. +* @param {Array<((item: T) => unknown) | keyof T>} criteria - The criteria for sorting. This can be an array of object keys or functions that return values used for sorting. +* @param {Array<'asc' | 'desc'>} orders - An array of order directions ('asc' for ascending or 'desc' for descending). +* @returns {T[]} - The sorted array. +* +* @example +* // Sort an array of objects by 'user' in ascending order and 'age' in descending order. +* const users = [ +* { user: 'fred', age: 48 }, +* { user: 'barney', age: 34 }, +* { user: 'fred', age: 40 }, +* { user: 'barney', age: 36 }, +* ]; +* +* const result = orderBy(users, [obj => obj.user, 'age'], ['asc', 'desc']); +* // result will be: +* // [ +* // { user: 'barney', age: 36 }, +* // { user: 'barney', age: 34 }, +* // { user: 'fred', age: 48 }, +* // { user: 'fred', age: 40 }, +* // ] +*/ +function orderBy(arr, criteria, orders) { + return arr.slice().sort((a, b) => { + const ordersLength = orders.length; + for (let i = 0; i < criteria.length; i++) { + const order = ordersLength > i ? orders[i] : orders[ordersLength - 1]; + const criterion = criteria[i]; + const criterionIsFunction = typeof criterion === "function"; + const result = compareValues(criterionIsFunction ? criterion(a) : a[criterion], criterionIsFunction ? criterion(b) : b[criterion], order); + if (result !== 0) return result; + } + return 0; + }); +} +//#endregion +export { orderBy }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/partition.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/partition.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..e4f707ea993a902ec6a92f0df587ec55d2667369 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/partition.d.mts @@ -0,0 +1,50 @@ +//#region src/array/partition.d.ts +/** + * Splits an array into two groups based on a predicate function. + * + * This function takes an array and a predicate function. It returns a tuple of two arrays: + * the first array contains elements for which the predicate function returns true, and + * the second array contains elements for which the predicate function returns false. + * + * @template T - The type of elements in the array. + * @template {T} U - The type being filtered for. + * @param {T[]} arr - The array to partition. + * @param {(value: T, index: number, array: readonly T[]) => value is U} isInTruthy - A type guard that determines whether an + * element should be placed in the truthy array. The function is called with each element + * of the array and its index. + * @returns {[U[], Exclude[]]} A tuple containing two arrays: the first array contains elements for + * which the predicate returned true, and the second array contains elements for which the + * predicate returned false. + * + * @example + * const array = [1, 2, 3, 4] as const; + * const isEven = (x: number): x is 2 | 4 => x % 2 === 0; + * const [even, odd]: [(2 | 4)[], (2 | 4)[]] = partition(array, isEven); + * // even will be [2, 4], and odd will be [1, 3] + */ +declare function partition(arr: readonly T[], isInTruthy: (value: T, index: number, array: readonly T[]) => value is U): [truthy: U[], falsy: Array>]; +/** + * Splits an array into two groups based on a predicate function. + * + * This function takes an array and a predicate function. It returns a tuple of two arrays: + * the first array contains elements for which the predicate function returns true, and + * the second array contains elements for which the predicate function returns false. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to partition. + * @param {(value: T, index: number) => boolean} isInTruthy - A predicate function that determines + * whether an element should be placed in the truthy array. The function is called with each + * element of the array and its index. + * @returns {[T[], T[]]} A tuple containing two arrays: the first array contains elements for + * which the predicate returned true, and the second array contains elements for which the + * predicate returned false. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const isEven = x => x % 2 === 0; + * const [even, odd] = partition(array, isEven); + * // even will be [2, 4], and odd will be [1, 3, 5] + */ +declare function partition(arr: readonly T[], isInTruthy: (value: T, index: number, array: readonly T[]) => boolean): [truthy: T[], falsy: T[]]; +//#endregion +export { partition }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/partition.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/partition.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e4f707ea993a902ec6a92f0df587ec55d2667369 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/partition.d.ts @@ -0,0 +1,50 @@ +//#region src/array/partition.d.ts +/** + * Splits an array into two groups based on a predicate function. + * + * This function takes an array and a predicate function. It returns a tuple of two arrays: + * the first array contains elements for which the predicate function returns true, and + * the second array contains elements for which the predicate function returns false. + * + * @template T - The type of elements in the array. + * @template {T} U - The type being filtered for. + * @param {T[]} arr - The array to partition. + * @param {(value: T, index: number, array: readonly T[]) => value is U} isInTruthy - A type guard that determines whether an + * element should be placed in the truthy array. The function is called with each element + * of the array and its index. + * @returns {[U[], Exclude[]]} A tuple containing two arrays: the first array contains elements for + * which the predicate returned true, and the second array contains elements for which the + * predicate returned false. + * + * @example + * const array = [1, 2, 3, 4] as const; + * const isEven = (x: number): x is 2 | 4 => x % 2 === 0; + * const [even, odd]: [(2 | 4)[], (2 | 4)[]] = partition(array, isEven); + * // even will be [2, 4], and odd will be [1, 3] + */ +declare function partition(arr: readonly T[], isInTruthy: (value: T, index: number, array: readonly T[]) => value is U): [truthy: U[], falsy: Array>]; +/** + * Splits an array into two groups based on a predicate function. + * + * This function takes an array and a predicate function. It returns a tuple of two arrays: + * the first array contains elements for which the predicate function returns true, and + * the second array contains elements for which the predicate function returns false. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to partition. + * @param {(value: T, index: number) => boolean} isInTruthy - A predicate function that determines + * whether an element should be placed in the truthy array. The function is called with each + * element of the array and its index. + * @returns {[T[], T[]]} A tuple containing two arrays: the first array contains elements for + * which the predicate returned true, and the second array contains elements for which the + * predicate returned false. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const isEven = x => x % 2 === 0; + * const [even, odd] = partition(array, isEven); + * // even will be [2, 4], and odd will be [1, 3, 5] + */ +declare function partition(arr: readonly T[], isInTruthy: (value: T, index: number, array: readonly T[]) => boolean): [truthy: T[], falsy: T[]]; +//#endregion +export { partition }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/partition.js b/tools/ui/node_modules/es-toolkit/dist/array/partition.js new file mode 100644 index 0000000000000000000000000000000000000000..62c814094c11a3538f568ab4767081c9b2b94748 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/partition.js @@ -0,0 +1,13 @@ +//#region src/array/partition.ts +function partition(arr, isInTruthy) { + const truthy = []; + const falsy = []; + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + if (isInTruthy(item, i, arr)) truthy.push(item); + else falsy.push(item); + } + return [truthy, falsy]; +} +//#endregion +exports.partition = partition; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/partition.mjs b/tools/ui/node_modules/es-toolkit/dist/array/partition.mjs new file mode 100644 index 0000000000000000000000000000000000000000..611687fabbdf5a7d8274310dcd85aa355cb20d71 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/partition.mjs @@ -0,0 +1,13 @@ +//#region src/array/partition.ts +function partition(arr, isInTruthy) { + const truthy = []; + const falsy = []; + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + if (isInTruthy(item, i, arr)) truthy.push(item); + else falsy.push(item); + } + return [truthy, falsy]; +} +//#endregion +export { partition }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/pull.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/pull.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..ca796e0003d444323f9d08b3060ee3ee8cf6e3ea --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/pull.d.mts @@ -0,0 +1,20 @@ +//#region src/array/pull.d.ts +/** + * Removes all specified values from an array. + * + * This function changes `arr` in place. + * If you want to remove values without modifying the original array, use `difference`. + * + * @template T, U + * @param {T[]} arr - The array to modify. + * @param {unknown[]} valuesToRemove - The values to remove from the array. + * @returns {T[]} The modified array with the specified values removed. + * + * @example + * const numbers = [1, 2, 3, 4, 5, 2, 4]; + * pull(numbers, [2, 4]); + * console.log(numbers); // [1, 3, 5] + */ +declare function pull(arr: T[], valuesToRemove: readonly unknown[]): T[]; +//#endregion +export { pull }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/pull.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/pull.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ca796e0003d444323f9d08b3060ee3ee8cf6e3ea --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/pull.d.ts @@ -0,0 +1,20 @@ +//#region src/array/pull.d.ts +/** + * Removes all specified values from an array. + * + * This function changes `arr` in place. + * If you want to remove values without modifying the original array, use `difference`. + * + * @template T, U + * @param {T[]} arr - The array to modify. + * @param {unknown[]} valuesToRemove - The values to remove from the array. + * @returns {T[]} The modified array with the specified values removed. + * + * @example + * const numbers = [1, 2, 3, 4, 5, 2, 4]; + * pull(numbers, [2, 4]); + * console.log(numbers); // [1, 3, 5] + */ +declare function pull(arr: T[], valuesToRemove: readonly unknown[]): T[]; +//#endregion +export { pull }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/pull.js b/tools/ui/node_modules/es-toolkit/dist/array/pull.js new file mode 100644 index 0000000000000000000000000000000000000000..dc49648b856b83a19048b90d7a5c31009dbc65c7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/pull.js @@ -0,0 +1,33 @@ +//#region src/array/pull.ts +/** +* Removes all specified values from an array. +* +* This function changes `arr` in place. +* If you want to remove values without modifying the original array, use `difference`. +* +* @template T, U +* @param {T[]} arr - The array to modify. +* @param {unknown[]} valuesToRemove - The values to remove from the array. +* @returns {T[]} The modified array with the specified values removed. +* +* @example +* const numbers = [1, 2, 3, 4, 5, 2, 4]; +* pull(numbers, [2, 4]); +* console.log(numbers); // [1, 3, 5] +*/ +function pull(arr, valuesToRemove) { + const valuesSet = new Set(valuesToRemove); + let resultIndex = 0; + for (let i = 0; i < arr.length; i++) { + if (valuesSet.has(arr[i])) continue; + if (!Object.hasOwn(arr, i)) { + delete arr[resultIndex++]; + continue; + } + arr[resultIndex++] = arr[i]; + } + arr.length = resultIndex; + return arr; +} +//#endregion +exports.pull = pull; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/pull.mjs b/tools/ui/node_modules/es-toolkit/dist/array/pull.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f09d02a2e4906aa315d4f5b829ca9971da3cdba5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/pull.mjs @@ -0,0 +1,33 @@ +//#region src/array/pull.ts +/** +* Removes all specified values from an array. +* +* This function changes `arr` in place. +* If you want to remove values without modifying the original array, use `difference`. +* +* @template T, U +* @param {T[]} arr - The array to modify. +* @param {unknown[]} valuesToRemove - The values to remove from the array. +* @returns {T[]} The modified array with the specified values removed. +* +* @example +* const numbers = [1, 2, 3, 4, 5, 2, 4]; +* pull(numbers, [2, 4]); +* console.log(numbers); // [1, 3, 5] +*/ +function pull(arr, valuesToRemove) { + const valuesSet = new Set(valuesToRemove); + let resultIndex = 0; + for (let i = 0; i < arr.length; i++) { + if (valuesSet.has(arr[i])) continue; + if (!Object.hasOwn(arr, i)) { + delete arr[resultIndex++]; + continue; + } + arr[resultIndex++] = arr[i]; + } + arr.length = resultIndex; + return arr; +} +//#endregion +export { pull }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/pullAt.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/pullAt.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..09faad9ca46be94d1f63b168ecad62ff0464ef0c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/pullAt.d.mts @@ -0,0 +1,20 @@ +//#region src/array/pullAt.d.ts +/** + * Removes elements from an array at specified indices and returns the removed elements. + * + * This function supports negative indices, which count from the end of the array. + * + * @template T + * @param {T[]} arr - The array from which elements will be removed. + * @param {number[]} indicesToRemove - An array of indices specifying the positions of elements to remove. + * @returns {Array} An array containing the elements that were removed from the original array. + * + * @example + * const numbers = [10, 20, 30, 40, 50]; + * const removed = pullAt(numbers, [1, 3, 4]); + * console.log(removed); // [20, 40, 50] + * console.log(numbers); // [10, 30] + */ +declare function pullAt(arr: T[], indicesToRemove: number[]): T[]; +//#endregion +export { pullAt }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/pullAt.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/pullAt.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..09faad9ca46be94d1f63b168ecad62ff0464ef0c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/pullAt.d.ts @@ -0,0 +1,20 @@ +//#region src/array/pullAt.d.ts +/** + * Removes elements from an array at specified indices and returns the removed elements. + * + * This function supports negative indices, which count from the end of the array. + * + * @template T + * @param {T[]} arr - The array from which elements will be removed. + * @param {number[]} indicesToRemove - An array of indices specifying the positions of elements to remove. + * @returns {Array} An array containing the elements that were removed from the original array. + * + * @example + * const numbers = [10, 20, 30, 40, 50]; + * const removed = pullAt(numbers, [1, 3, 4]); + * console.log(removed); // [20, 40, 50] + * console.log(numbers); // [10, 30] + */ +declare function pullAt(arr: T[], indicesToRemove: number[]): T[]; +//#endregion +export { pullAt }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/pullAt.js b/tools/ui/node_modules/es-toolkit/dist/array/pullAt.js new file mode 100644 index 0000000000000000000000000000000000000000..fab097252be85b03e4a343af395fd6d1b613b00b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/pullAt.js @@ -0,0 +1,26 @@ +const require_at = require("./at.js"); +//#region src/array/pullAt.ts +/** +* Removes elements from an array at specified indices and returns the removed elements. +* +* This function supports negative indices, which count from the end of the array. +* +* @template T +* @param {T[]} arr - The array from which elements will be removed. +* @param {number[]} indicesToRemove - An array of indices specifying the positions of elements to remove. +* @returns {Array} An array containing the elements that were removed from the original array. +* +* @example +* const numbers = [10, 20, 30, 40, 50]; +* const removed = pullAt(numbers, [1, 3, 4]); +* console.log(removed); // [20, 40, 50] +* console.log(numbers); // [10, 30] +*/ +function pullAt(arr, indicesToRemove) { + const removed = require_at.at(arr, indicesToRemove); + const indices = new Set(indicesToRemove.slice().sort((x, y) => y - x)); + for (const index of indices) arr.splice(index, 1); + return removed; +} +//#endregion +exports.pullAt = pullAt; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/pullAt.mjs b/tools/ui/node_modules/es-toolkit/dist/array/pullAt.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d9218bac5d30319043cdcb6bc6fd50e3e3bfb886 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/pullAt.mjs @@ -0,0 +1,26 @@ +import { at } from "./at.mjs"; +//#region src/array/pullAt.ts +/** +* Removes elements from an array at specified indices and returns the removed elements. +* +* This function supports negative indices, which count from the end of the array. +* +* @template T +* @param {T[]} arr - The array from which elements will be removed. +* @param {number[]} indicesToRemove - An array of indices specifying the positions of elements to remove. +* @returns {Array} An array containing the elements that were removed from the original array. +* +* @example +* const numbers = [10, 20, 30, 40, 50]; +* const removed = pullAt(numbers, [1, 3, 4]); +* console.log(removed); // [20, 40, 50] +* console.log(numbers); // [10, 30] +*/ +function pullAt(arr, indicesToRemove) { + const removed = at(arr, indicesToRemove); + const indices = new Set(indicesToRemove.slice().sort((x, y) => y - x)); + for (const index of indices) arr.splice(index, 1); + return removed; +} +//#endregion +export { pullAt }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/reduceAsync.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/reduceAsync.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..a98701de5ec794fc4851474551699e468cb40275 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/reduceAsync.d.mts @@ -0,0 +1,72 @@ +//#region src/array/reduceAsync.d.ts +/** + * Reduces an array to a single value using an async reducer function. + * + * Applies the reducer function sequentially to each element (left to right), + * carrying an accumulated result from one call to the next. Unlike other async + * array methods, reduce must process elements sequentially and does not support + * concurrency limiting. + * + * @template T - The type of elements in the array. + * @template U - The type of the accumulated result. + * @param {readonly T[]} array The array to reduce. + * @param {(accumulator: U, currentValue: T, currentIndex: number, array: readonly T[]) => Promise} reducer An async function that processes each element. + * @param {U} initialValue The initial value of the accumulator. + * @returns {Promise} A promise that resolves to the final accumulated value. + * @example + * const numbers = [1, 2, 3, 4, 5]; + * const sum = await reduceAsync( + * numbers, + * async (acc, n) => acc + await fetchValue(n), + * 0 + * ); + * // Returns: sum of all fetched values + * + * @example + * const users = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const userMap = await reduceAsync( + * users, + * async (acc, user) => { + * const details = await fetchUserDetails(user.id); + * acc[user.id] = details; + * return acc; + * }, + * {} as Record + * ); + * // Returns: { 1: {...}, 2: {...}, 3: {...} } + */ +declare function reduceAsync(array: readonly T[], reducer: (accumulator: U, currentValue: T, currentIndex: number, array: readonly T[]) => Promise, initialValue: U): Promise; +/** + * Reduces an array to a single value using an async reducer function. + * + * Applies the reducer function sequentially to each element (left to right), + * carrying an accumulated result from one call to the next. Unlike other async + * array methods, reduce must process elements sequentially and does not support + * concurrency limiting. + * + * When no initial value is provided, the first element of the array is used as + * the initial value and the reduction starts from the second element. + * + * @template T - The type of elements in the array. + * @param {readonly T[]} array The array to reduce. + * @param {(accumulator: T, currentValue: T, currentIndex: number, array: readonly T[]) => Promise} reducer An async function that processes each element. + * @returns {Promise} A promise that resolves to the final accumulated value, or undefined if the array is empty. + * @example + * const numbers = [1, 2, 3, 4, 5]; + * const sum = await reduceAsync( + * numbers, + * async (acc, n) => acc + n + * ); + * // Returns: 15 + * + * @example + * const emptyArray: number[] = []; + * const result = await reduceAsync( + * emptyArray, + * async (acc, n) => acc + n + * ); + * // Returns: undefined + */ +declare function reduceAsync(array: readonly T[], reducer: (accumulator: T, currentValue: T, currentIndex: number, array: readonly T[]) => Promise): Promise; +//#endregion +export { reduceAsync }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/reduceAsync.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/reduceAsync.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a98701de5ec794fc4851474551699e468cb40275 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/reduceAsync.d.ts @@ -0,0 +1,72 @@ +//#region src/array/reduceAsync.d.ts +/** + * Reduces an array to a single value using an async reducer function. + * + * Applies the reducer function sequentially to each element (left to right), + * carrying an accumulated result from one call to the next. Unlike other async + * array methods, reduce must process elements sequentially and does not support + * concurrency limiting. + * + * @template T - The type of elements in the array. + * @template U - The type of the accumulated result. + * @param {readonly T[]} array The array to reduce. + * @param {(accumulator: U, currentValue: T, currentIndex: number, array: readonly T[]) => Promise} reducer An async function that processes each element. + * @param {U} initialValue The initial value of the accumulator. + * @returns {Promise} A promise that resolves to the final accumulated value. + * @example + * const numbers = [1, 2, 3, 4, 5]; + * const sum = await reduceAsync( + * numbers, + * async (acc, n) => acc + await fetchValue(n), + * 0 + * ); + * // Returns: sum of all fetched values + * + * @example + * const users = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const userMap = await reduceAsync( + * users, + * async (acc, user) => { + * const details = await fetchUserDetails(user.id); + * acc[user.id] = details; + * return acc; + * }, + * {} as Record + * ); + * // Returns: { 1: {...}, 2: {...}, 3: {...} } + */ +declare function reduceAsync(array: readonly T[], reducer: (accumulator: U, currentValue: T, currentIndex: number, array: readonly T[]) => Promise, initialValue: U): Promise; +/** + * Reduces an array to a single value using an async reducer function. + * + * Applies the reducer function sequentially to each element (left to right), + * carrying an accumulated result from one call to the next. Unlike other async + * array methods, reduce must process elements sequentially and does not support + * concurrency limiting. + * + * When no initial value is provided, the first element of the array is used as + * the initial value and the reduction starts from the second element. + * + * @template T - The type of elements in the array. + * @param {readonly T[]} array The array to reduce. + * @param {(accumulator: T, currentValue: T, currentIndex: number, array: readonly T[]) => Promise} reducer An async function that processes each element. + * @returns {Promise} A promise that resolves to the final accumulated value, or undefined if the array is empty. + * @example + * const numbers = [1, 2, 3, 4, 5]; + * const sum = await reduceAsync( + * numbers, + * async (acc, n) => acc + n + * ); + * // Returns: 15 + * + * @example + * const emptyArray: number[] = []; + * const result = await reduceAsync( + * emptyArray, + * async (acc, n) => acc + n + * ); + * // Returns: undefined + */ +declare function reduceAsync(array: readonly T[], reducer: (accumulator: T, currentValue: T, currentIndex: number, array: readonly T[]) => Promise): Promise; +//#endregion +export { reduceAsync }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/reduceAsync.js b/tools/ui/node_modules/es-toolkit/dist/array/reduceAsync.js new file mode 100644 index 0000000000000000000000000000000000000000..ae96beee48cd75cff14457a49eb121d5604d473a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/reduceAsync.js @@ -0,0 +1,13 @@ +//#region src/array/reduceAsync.ts +async function reduceAsync(array, reducer, initialValue) { + let startIndex = 0; + if (initialValue == null) { + initialValue = array[0]; + startIndex = 1; + } + let accumulator = initialValue; + for (let i = startIndex; i < array.length; i++) accumulator = await reducer(accumulator, array[i], i, array); + return accumulator; +} +//#endregion +exports.reduceAsync = reduceAsync; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/reduceAsync.mjs b/tools/ui/node_modules/es-toolkit/dist/array/reduceAsync.mjs new file mode 100644 index 0000000000000000000000000000000000000000..6d0b08e83b399547eb1e3210f72f00b13839fc3c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/reduceAsync.mjs @@ -0,0 +1,13 @@ +//#region src/array/reduceAsync.ts +async function reduceAsync(array, reducer, initialValue) { + let startIndex = 0; + if (initialValue == null) { + initialValue = array[0]; + startIndex = 1; + } + let accumulator = initialValue; + for (let i = startIndex; i < array.length; i++) accumulator = await reducer(accumulator, array[i], i, array); + return accumulator; +} +//#endregion +export { reduceAsync }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/remove.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/remove.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..6702419da6f99d5a711011098f1992b25f659607 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/remove.d.mts @@ -0,0 +1,20 @@ +//#region src/array/remove.d.ts +/** + * Removes elements from an array based on a predicate function. + * + * This function changes `arr` in place. + * If you want to remove elements without modifying the original array, use `filter`. + * + * @template T + * @param {T[]} arr - The array to modify. + * @param {(value: T, index: number, array: T[]) => boolean} shouldRemoveElement - The function invoked per iteration to determine if an element should be removed. + * @returns {T[]} The modified array with the specified elements removed. + * + * @example + * const numbers = [1, 2, 3, 4, 5]; + * remove(numbers, (value) => value % 2 === 0); + * console.log(numbers); // [1, 3, 5] + */ +declare function remove(arr: T[], shouldRemoveElement: (value: T, index: number, array: T[]) => boolean): T[]; +//#endregion +export { remove }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/remove.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/remove.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6702419da6f99d5a711011098f1992b25f659607 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/remove.d.ts @@ -0,0 +1,20 @@ +//#region src/array/remove.d.ts +/** + * Removes elements from an array based on a predicate function. + * + * This function changes `arr` in place. + * If you want to remove elements without modifying the original array, use `filter`. + * + * @template T + * @param {T[]} arr - The array to modify. + * @param {(value: T, index: number, array: T[]) => boolean} shouldRemoveElement - The function invoked per iteration to determine if an element should be removed. + * @returns {T[]} The modified array with the specified elements removed. + * + * @example + * const numbers = [1, 2, 3, 4, 5]; + * remove(numbers, (value) => value % 2 === 0); + * console.log(numbers); // [1, 3, 5] + */ +declare function remove(arr: T[], shouldRemoveElement: (value: T, index: number, array: T[]) => boolean): T[]; +//#endregion +export { remove }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/remove.js b/tools/ui/node_modules/es-toolkit/dist/array/remove.js new file mode 100644 index 0000000000000000000000000000000000000000..d40fac61c1ae1f41ae82339b35e0a0341d512521 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/remove.js @@ -0,0 +1,37 @@ +//#region src/array/remove.ts +/** +* Removes elements from an array based on a predicate function. +* +* This function changes `arr` in place. +* If you want to remove elements without modifying the original array, use `filter`. +* +* @template T +* @param {T[]} arr - The array to modify. +* @param {(value: T, index: number, array: T[]) => boolean} shouldRemoveElement - The function invoked per iteration to determine if an element should be removed. +* @returns {T[]} The modified array with the specified elements removed. +* +* @example +* const numbers = [1, 2, 3, 4, 5]; +* remove(numbers, (value) => value % 2 === 0); +* console.log(numbers); // [1, 3, 5] +*/ +function remove(arr, shouldRemoveElement) { + const originalArr = arr.slice(); + const removed = []; + let resultIndex = 0; + for (let i = 0; i < arr.length; i++) { + if (shouldRemoveElement(arr[i], i, originalArr)) { + removed.push(arr[i]); + continue; + } + if (!Object.hasOwn(arr, i)) { + delete arr[resultIndex++]; + continue; + } + arr[resultIndex++] = arr[i]; + } + arr.length = resultIndex; + return removed; +} +//#endregion +exports.remove = remove; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/remove.mjs b/tools/ui/node_modules/es-toolkit/dist/array/remove.mjs new file mode 100644 index 0000000000000000000000000000000000000000..82a04808cc3a529c2ca9bdc34170bcdf76669a8e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/remove.mjs @@ -0,0 +1,37 @@ +//#region src/array/remove.ts +/** +* Removes elements from an array based on a predicate function. +* +* This function changes `arr` in place. +* If you want to remove elements without modifying the original array, use `filter`. +* +* @template T +* @param {T[]} arr - The array to modify. +* @param {(value: T, index: number, array: T[]) => boolean} shouldRemoveElement - The function invoked per iteration to determine if an element should be removed. +* @returns {T[]} The modified array with the specified elements removed. +* +* @example +* const numbers = [1, 2, 3, 4, 5]; +* remove(numbers, (value) => value % 2 === 0); +* console.log(numbers); // [1, 3, 5] +*/ +function remove(arr, shouldRemoveElement) { + const originalArr = arr.slice(); + const removed = []; + let resultIndex = 0; + for (let i = 0; i < arr.length; i++) { + if (shouldRemoveElement(arr[i], i, originalArr)) { + removed.push(arr[i]); + continue; + } + if (!Object.hasOwn(arr, i)) { + delete arr[resultIndex++]; + continue; + } + arr[resultIndex++] = arr[i]; + } + arr.length = resultIndex; + return removed; +} +//#endregion +export { remove }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/sample.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/sample.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..a30fa8fae19ce04ef22673490fb354a8c6e5acbc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/sample.d.mts @@ -0,0 +1,18 @@ +//#region src/array/sample.d.ts +/** + * Returns a random element from an array. + * + * This function takes an array and returns a single element selected randomly from the array. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to sample from. + * @returns {T} A random element from the array. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const randomElement = sample(array); + * // randomElement will be one of the elements from the array, selected randomly. + */ +declare function sample(arr: readonly T[]): T; +//#endregion +export { sample }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/sample.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/sample.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a30fa8fae19ce04ef22673490fb354a8c6e5acbc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/sample.d.ts @@ -0,0 +1,18 @@ +//#region src/array/sample.d.ts +/** + * Returns a random element from an array. + * + * This function takes an array and returns a single element selected randomly from the array. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to sample from. + * @returns {T} A random element from the array. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const randomElement = sample(array); + * // randomElement will be one of the elements from the array, selected randomly. + */ +declare function sample(arr: readonly T[]): T; +//#endregion +export { sample }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/sample.js b/tools/ui/node_modules/es-toolkit/dist/array/sample.js new file mode 100644 index 0000000000000000000000000000000000000000..6291d62d231dbc15dd37c504bd5cbf0462a00185 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/sample.js @@ -0,0 +1,20 @@ +//#region src/array/sample.ts +/** +* Returns a random element from an array. +* +* This function takes an array and returns a single element selected randomly from the array. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array to sample from. +* @returns {T} A random element from the array. +* +* @example +* const array = [1, 2, 3, 4, 5]; +* const randomElement = sample(array); +* // randomElement will be one of the elements from the array, selected randomly. +*/ +function sample(arr) { + return arr[Math.floor(Math.random() * arr.length)]; +} +//#endregion +exports.sample = sample; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/sample.mjs b/tools/ui/node_modules/es-toolkit/dist/array/sample.mjs new file mode 100644 index 0000000000000000000000000000000000000000..e7b8198f280a929f5a8e6f9d6f1bf7f00fae95fd --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/sample.mjs @@ -0,0 +1,20 @@ +//#region src/array/sample.ts +/** +* Returns a random element from an array. +* +* This function takes an array and returns a single element selected randomly from the array. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array to sample from. +* @returns {T} A random element from the array. +* +* @example +* const array = [1, 2, 3, 4, 5]; +* const randomElement = sample(array); +* // randomElement will be one of the elements from the array, selected randomly. +*/ +function sample(arr) { + return arr[Math.floor(Math.random() * arr.length)]; +} +//#endregion +export { sample }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/sampleSize.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/sampleSize.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..1545b0ab08fa0508009e68e7a878ac3ad0ff9c4f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/sampleSize.d.mts @@ -0,0 +1,22 @@ +//#region src/array/sampleSize.d.ts +/** + * Returns a sample element array of a specified `size`. + * + * This function takes an array and a number, and returns an array containing the sampled elements using Floyd's algorithm. + * + * {@link https://www.nowherenearithaca.com/2013/05/robert-floyds-tiny-and-beautiful.html Floyd's algorithm} + * + * @template T - The type of elements in the array. + * @param {T[]} array - The array to sample from. + * @param {number} size - The size of sample. + * @returns {T[]} A new array with sample size applied. + * @throws {Error} Throws an error if `size` is greater than the length of `array`. + * + * @example + * const result = sampleSize([1, 2, 3], 2) + * // result will be an array containing two of the elements from the array. + * // [1, 2] or [1, 3] or [2, 3] + */ +declare function sampleSize(array: readonly T[], size: number): T[]; +//#endregion +export { sampleSize }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/sampleSize.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/sampleSize.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1545b0ab08fa0508009e68e7a878ac3ad0ff9c4f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/sampleSize.d.ts @@ -0,0 +1,22 @@ +//#region src/array/sampleSize.d.ts +/** + * Returns a sample element array of a specified `size`. + * + * This function takes an array and a number, and returns an array containing the sampled elements using Floyd's algorithm. + * + * {@link https://www.nowherenearithaca.com/2013/05/robert-floyds-tiny-and-beautiful.html Floyd's algorithm} + * + * @template T - The type of elements in the array. + * @param {T[]} array - The array to sample from. + * @param {number} size - The size of sample. + * @returns {T[]} A new array with sample size applied. + * @throws {Error} Throws an error if `size` is greater than the length of `array`. + * + * @example + * const result = sampleSize([1, 2, 3], 2) + * // result will be an array containing two of the elements from the array. + * // [1, 2] or [1, 3] or [2, 3] + */ +declare function sampleSize(array: readonly T[], size: number): T[]; +//#endregion +export { sampleSize }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/sampleSize.js b/tools/ui/node_modules/es-toolkit/dist/array/sampleSize.js new file mode 100644 index 0000000000000000000000000000000000000000..c5786ba6033771b74c3f17b8a4cc217946843fcd --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/sampleSize.js @@ -0,0 +1,34 @@ +const require_randomInt = require("../math/randomInt.js"); +//#region src/array/sampleSize.ts +/** +* Returns a sample element array of a specified `size`. +* +* This function takes an array and a number, and returns an array containing the sampled elements using Floyd's algorithm. +* +* {@link https://www.nowherenearithaca.com/2013/05/robert-floyds-tiny-and-beautiful.html Floyd's algorithm} +* +* @template T - The type of elements in the array. +* @param {T[]} array - The array to sample from. +* @param {number} size - The size of sample. +* @returns {T[]} A new array with sample size applied. +* @throws {Error} Throws an error if `size` is greater than the length of `array`. +* +* @example +* const result = sampleSize([1, 2, 3], 2) +* // result will be an array containing two of the elements from the array. +* // [1, 2] or [1, 3] or [2, 3] +*/ +function sampleSize(array, size) { + if (size > array.length) throw new Error("Size must be less than or equal to the length of array."); + const result = new Array(size); + const selected = /* @__PURE__ */ new Set(); + for (let step = array.length - size, resultIndex = 0; step < array.length; step++, resultIndex++) { + let index = require_randomInt.randomInt(0, step + 1); + if (selected.has(index)) index = step; + selected.add(index); + result[resultIndex] = array[index]; + } + return result; +} +//#endregion +exports.sampleSize = sampleSize; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/sampleSize.mjs b/tools/ui/node_modules/es-toolkit/dist/array/sampleSize.mjs new file mode 100644 index 0000000000000000000000000000000000000000..39e2b01d191e4742827fca1090eba480250fa104 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/sampleSize.mjs @@ -0,0 +1,34 @@ +import { randomInt } from "../math/randomInt.mjs"; +//#region src/array/sampleSize.ts +/** +* Returns a sample element array of a specified `size`. +* +* This function takes an array and a number, and returns an array containing the sampled elements using Floyd's algorithm. +* +* {@link https://www.nowherenearithaca.com/2013/05/robert-floyds-tiny-and-beautiful.html Floyd's algorithm} +* +* @template T - The type of elements in the array. +* @param {T[]} array - The array to sample from. +* @param {number} size - The size of sample. +* @returns {T[]} A new array with sample size applied. +* @throws {Error} Throws an error if `size` is greater than the length of `array`. +* +* @example +* const result = sampleSize([1, 2, 3], 2) +* // result will be an array containing two of the elements from the array. +* // [1, 2] or [1, 3] or [2, 3] +*/ +function sampleSize(array, size) { + if (size > array.length) throw new Error("Size must be less than or equal to the length of array."); + const result = new Array(size); + const selected = /* @__PURE__ */ new Set(); + for (let step = array.length - size, resultIndex = 0; step < array.length; step++, resultIndex++) { + let index = randomInt(0, step + 1); + if (selected.has(index)) index = step; + selected.add(index); + result[resultIndex] = array[index]; + } + return result; +} +//#endregion +export { sampleSize }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/shuffle.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/shuffle.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..cc1c17a00d4c57916f236811e851fafe53ad1569 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/shuffle.d.mts @@ -0,0 +1,18 @@ +//#region src/array/shuffle.d.ts +/** + * Randomizes the order of elements in an array using the Fisher-Yates algorithm. + * + * This function takes an array and returns a new array with its elements shuffled in a random order. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to shuffle. + * @returns {T[]} A new array with its elements shuffled in random order. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const shuffledArray = shuffle(array); + * // shuffledArray will be a new array with elements of array in random order, e.g., [3, 1, 4, 5, 2] + */ +declare function shuffle(arr: readonly T[]): T[]; +//#endregion +export { shuffle }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/shuffle.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/shuffle.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cc1c17a00d4c57916f236811e851fafe53ad1569 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/shuffle.d.ts @@ -0,0 +1,18 @@ +//#region src/array/shuffle.d.ts +/** + * Randomizes the order of elements in an array using the Fisher-Yates algorithm. + * + * This function takes an array and returns a new array with its elements shuffled in a random order. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to shuffle. + * @returns {T[]} A new array with its elements shuffled in random order. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const shuffledArray = shuffle(array); + * // shuffledArray will be a new array with elements of array in random order, e.g., [3, 1, 4, 5, 2] + */ +declare function shuffle(arr: readonly T[]): T[]; +//#endregion +export { shuffle }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/shuffle.js b/tools/ui/node_modules/es-toolkit/dist/array/shuffle.js new file mode 100644 index 0000000000000000000000000000000000000000..7624eef7cbb268c97af2b400feab0d33fedd8cbf --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/shuffle.js @@ -0,0 +1,28 @@ +//#region src/array/shuffle.ts +/** +* Randomizes the order of elements in an array using the Fisher-Yates algorithm. +* +* This function takes an array and returns a new array with its elements shuffled in a random order. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array to shuffle. +* @returns {T[]} A new array with its elements shuffled in random order. +* +* @example +* const array = [1, 2, 3, 4, 5]; +* const shuffledArray = shuffle(array); +* // shuffledArray will be a new array with elements of array in random order, e.g., [3, 1, 4, 5, 2] +*/ +function shuffle(arr) { + const result = arr.slice(); + /** + * https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm + */ + for (let i = result.length - 1; i >= 1; i--) { + const j = Math.floor(Math.random() * (i + 1)); + [result[i], result[j]] = [result[j], result[i]]; + } + return result; +} +//#endregion +exports.shuffle = shuffle; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/shuffle.mjs b/tools/ui/node_modules/es-toolkit/dist/array/shuffle.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d5cef6705f1591117b2291c4aba83f3c1758a74d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/shuffle.mjs @@ -0,0 +1,28 @@ +//#region src/array/shuffle.ts +/** +* Randomizes the order of elements in an array using the Fisher-Yates algorithm. +* +* This function takes an array and returns a new array with its elements shuffled in a random order. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array to shuffle. +* @returns {T[]} A new array with its elements shuffled in random order. +* +* @example +* const array = [1, 2, 3, 4, 5]; +* const shuffledArray = shuffle(array); +* // shuffledArray will be a new array with elements of array in random order, e.g., [3, 1, 4, 5, 2] +*/ +function shuffle(arr) { + const result = arr.slice(); + /** + * https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm + */ + for (let i = result.length - 1; i >= 1; i--) { + const j = Math.floor(Math.random() * (i + 1)); + [result[i], result[j]] = [result[j], result[i]]; + } + return result; +} +//#endregion +export { shuffle }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/sortBy.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/sortBy.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..54e95f68b7033b99994320b174c195ba2e29bfc3 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/sortBy.d.mts @@ -0,0 +1,36 @@ +//#region src/array/sortBy.d.ts +/** + * Sorts an array of objects based on the given `criteria`. + * + * - If you provide keys, it sorts the objects by the values of those keys. + * - If you provide functions, it sorts based on the values returned by those functions. + * + * The function returns the array of objects sorted in ascending order. + * If two objects have the same value for the current criterion, it uses the next criterion to determine their order. + * + * @template T - The type of the objects in the array. + * @param {T[]} arr - The array of objects to be sorted. + * @param {Array<((item: T) => unknown) | keyof T>} criteria - The criteria for sorting. This can be an array of object keys or functions that return values used for sorting. + * @returns {T[]} - The sorted array. + * + * @example + * const users = [ + * { user: 'foo', age: 24 }, + * { user: 'bar', age: 7 }, + * { user: 'foo', age: 8 }, + * { user: 'bar', age: 29 }, + * ]; + * + * sortBy(users, ['user', 'age']); + * sortBy(users, [obj => obj.user, 'age']); + * // results will be: + * // [ + * // { user : 'bar', age: 7 }, + * // { user : 'bar', age: 29 }, + * // { user : 'foo', age: 8 }, + * // { user : 'foo', age: 24 }, + * // ] + */ +declare function sortBy(arr: readonly T[], criteria: Array<((item: T) => unknown) | keyof T>): T[]; +//#endregion +export { sortBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/sortBy.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/sortBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..54e95f68b7033b99994320b174c195ba2e29bfc3 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/sortBy.d.ts @@ -0,0 +1,36 @@ +//#region src/array/sortBy.d.ts +/** + * Sorts an array of objects based on the given `criteria`. + * + * - If you provide keys, it sorts the objects by the values of those keys. + * - If you provide functions, it sorts based on the values returned by those functions. + * + * The function returns the array of objects sorted in ascending order. + * If two objects have the same value for the current criterion, it uses the next criterion to determine their order. + * + * @template T - The type of the objects in the array. + * @param {T[]} arr - The array of objects to be sorted. + * @param {Array<((item: T) => unknown) | keyof T>} criteria - The criteria for sorting. This can be an array of object keys or functions that return values used for sorting. + * @returns {T[]} - The sorted array. + * + * @example + * const users = [ + * { user: 'foo', age: 24 }, + * { user: 'bar', age: 7 }, + * { user: 'foo', age: 8 }, + * { user: 'bar', age: 29 }, + * ]; + * + * sortBy(users, ['user', 'age']); + * sortBy(users, [obj => obj.user, 'age']); + * // results will be: + * // [ + * // { user : 'bar', age: 7 }, + * // { user : 'bar', age: 29 }, + * // { user : 'foo', age: 8 }, + * // { user : 'foo', age: 24 }, + * // ] + */ +declare function sortBy(arr: readonly T[], criteria: Array<((item: T) => unknown) | keyof T>): T[]; +//#endregion +export { sortBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/sortBy.js b/tools/ui/node_modules/es-toolkit/dist/array/sortBy.js new file mode 100644 index 0000000000000000000000000000000000000000..5a49ec52bb5185aa32310dc12e866223896631a5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/sortBy.js @@ -0,0 +1,39 @@ +const require_orderBy = require("./orderBy.js"); +//#region src/array/sortBy.ts +/** +* Sorts an array of objects based on the given `criteria`. +* +* - If you provide keys, it sorts the objects by the values of those keys. +* - If you provide functions, it sorts based on the values returned by those functions. +* +* The function returns the array of objects sorted in ascending order. +* If two objects have the same value for the current criterion, it uses the next criterion to determine their order. +* +* @template T - The type of the objects in the array. +* @param {T[]} arr - The array of objects to be sorted. +* @param {Array<((item: T) => unknown) | keyof T>} criteria - The criteria for sorting. This can be an array of object keys or functions that return values used for sorting. +* @returns {T[]} - The sorted array. +* +* @example +* const users = [ +* { user: 'foo', age: 24 }, +* { user: 'bar', age: 7 }, +* { user: 'foo', age: 8 }, +* { user: 'bar', age: 29 }, +* ]; +* +* sortBy(users, ['user', 'age']); +* sortBy(users, [obj => obj.user, 'age']); +* // results will be: +* // [ +* // { user : 'bar', age: 7 }, +* // { user : 'bar', age: 29 }, +* // { user : 'foo', age: 8 }, +* // { user : 'foo', age: 24 }, +* // ] +*/ +function sortBy(arr, criteria) { + return require_orderBy.orderBy(arr, criteria, ["asc"]); +} +//#endregion +exports.sortBy = sortBy; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/sortBy.mjs b/tools/ui/node_modules/es-toolkit/dist/array/sortBy.mjs new file mode 100644 index 0000000000000000000000000000000000000000..6e0fbdb0781faf4e3a6af918bacb236333db6b55 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/sortBy.mjs @@ -0,0 +1,39 @@ +import { orderBy } from "./orderBy.mjs"; +//#region src/array/sortBy.ts +/** +* Sorts an array of objects based on the given `criteria`. +* +* - If you provide keys, it sorts the objects by the values of those keys. +* - If you provide functions, it sorts based on the values returned by those functions. +* +* The function returns the array of objects sorted in ascending order. +* If two objects have the same value for the current criterion, it uses the next criterion to determine their order. +* +* @template T - The type of the objects in the array. +* @param {T[]} arr - The array of objects to be sorted. +* @param {Array<((item: T) => unknown) | keyof T>} criteria - The criteria for sorting. This can be an array of object keys or functions that return values used for sorting. +* @returns {T[]} - The sorted array. +* +* @example +* const users = [ +* { user: 'foo', age: 24 }, +* { user: 'bar', age: 7 }, +* { user: 'foo', age: 8 }, +* { user: 'bar', age: 29 }, +* ]; +* +* sortBy(users, ['user', 'age']); +* sortBy(users, [obj => obj.user, 'age']); +* // results will be: +* // [ +* // { user : 'bar', age: 7 }, +* // { user : 'bar', age: 29 }, +* // { user : 'foo', age: 8 }, +* // { user : 'foo', age: 24 }, +* // ] +*/ +function sortBy(arr, criteria) { + return orderBy(arr, criteria, ["asc"]); +} +//#endregion +export { sortBy }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/tail.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/tail.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..fc4ce9b17875ffe5936b473d46684b99c9716b38 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/tail.d.mts @@ -0,0 +1,68 @@ +//#region src/array/tail.d.ts +/** + * Returns an empty array when the input is a single-element array. + * + * @template T - The type of the single element in the array. + * @param {[T]} arr - The single-element array to process. + * @returns {[]} An empty array. + * + * @example + * const arr = [1]; + * const result = tail(arr); + * // result will be [] + */ +declare function tail(arr: readonly [T]): []; +/** + * Returns an empty array when the input is an empty array. + * + * @template T - The type of elements in the array. + * @param {[]} arr - The empty array to process. + * @returns {[]} An empty array. + * + * @example + * const arr = []; + * const result = tail(arr); + * // result will be [] + */ +declare function tail(arr: readonly []): []; +/** + * Returns a new array with all elements except for the first when the input is a tuple array. + * + * @template T - The type of the first element in the tuple array. + * @template U - The type of the remaining elements in the tuple array. + * @param {[T, ...U[]]} arr - The tuple array to process. + * @returns {U[]} A new array containing all elements of the input array except for the first one. + * + * @example + * const arr = [1, 2, 3]; + * const result = tail(arr); + * // result will be [2, 3] + */ +declare function tail(arr: readonly [T, ...U[]]): U[]; +/** + * Returns a new array with all elements except for the first. + * + * This function takes an array and returns a new array containing all the elements + * except for the first one. If the input array is empty or has only one element, + * an empty array is returned. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to get the tail of. + * @returns {T[]} A new array containing all elements of the input array except for the first one. + * + * @example + * const arr1 = [1, 2, 3]; + * const result = tail(arr1); + * // result will be [2, 3] + * + * const arr2 = [1]; + * const result2 = tail(arr2); + * // result2 will be [] + * + * const arr3 = []; + * const result3 = tail(arr3); + * // result3 will be [] + */ +declare function tail(arr: readonly T[]): T[]; +//#endregion +export { tail }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/tail.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/tail.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc4ce9b17875ffe5936b473d46684b99c9716b38 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/tail.d.ts @@ -0,0 +1,68 @@ +//#region src/array/tail.d.ts +/** + * Returns an empty array when the input is a single-element array. + * + * @template T - The type of the single element in the array. + * @param {[T]} arr - The single-element array to process. + * @returns {[]} An empty array. + * + * @example + * const arr = [1]; + * const result = tail(arr); + * // result will be [] + */ +declare function tail(arr: readonly [T]): []; +/** + * Returns an empty array when the input is an empty array. + * + * @template T - The type of elements in the array. + * @param {[]} arr - The empty array to process. + * @returns {[]} An empty array. + * + * @example + * const arr = []; + * const result = tail(arr); + * // result will be [] + */ +declare function tail(arr: readonly []): []; +/** + * Returns a new array with all elements except for the first when the input is a tuple array. + * + * @template T - The type of the first element in the tuple array. + * @template U - The type of the remaining elements in the tuple array. + * @param {[T, ...U[]]} arr - The tuple array to process. + * @returns {U[]} A new array containing all elements of the input array except for the first one. + * + * @example + * const arr = [1, 2, 3]; + * const result = tail(arr); + * // result will be [2, 3] + */ +declare function tail(arr: readonly [T, ...U[]]): U[]; +/** + * Returns a new array with all elements except for the first. + * + * This function takes an array and returns a new array containing all the elements + * except for the first one. If the input array is empty or has only one element, + * an empty array is returned. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to get the tail of. + * @returns {T[]} A new array containing all elements of the input array except for the first one. + * + * @example + * const arr1 = [1, 2, 3]; + * const result = tail(arr1); + * // result will be [2, 3] + * + * const arr2 = [1]; + * const result2 = tail(arr2); + * // result2 will be [] + * + * const arr3 = []; + * const result3 = tail(arr3); + * // result3 will be [] + */ +declare function tail(arr: readonly T[]): T[]; +//#endregion +export { tail }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/tail.js b/tools/ui/node_modules/es-toolkit/dist/array/tail.js new file mode 100644 index 0000000000000000000000000000000000000000..1d7325bbaf7b8407486f09908edc10cbe039b174 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/tail.js @@ -0,0 +1,30 @@ +//#region src/array/tail.ts +/** +* Returns a new array with all elements except for the first. +* +* This function takes an array and returns a new array containing all the elements +* except for the first one. If the input array is empty or has only one element, +* an empty array is returned. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array to get the tail of. +* @returns {T[]} A new array containing all elements of the input array except for the first one. +* +* @example +* const arr1 = [1, 2, 3]; +* const result = tail(arr1); +* // result will be [2, 3] +* +* const arr2 = [1]; +* const result2 = tail(arr2); +* // result2 will be [] +* +* const arr3 = []; +* const result3 = tail(arr3); +* // result3 will be [] +*/ +function tail(arr) { + return arr.slice(1); +} +//#endregion +exports.tail = tail; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/tail.mjs b/tools/ui/node_modules/es-toolkit/dist/array/tail.mjs new file mode 100644 index 0000000000000000000000000000000000000000..dd8d382029778a805b42bc63c591171b72c3fbc5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/tail.mjs @@ -0,0 +1,30 @@ +//#region src/array/tail.ts +/** +* Returns a new array with all elements except for the first. +* +* This function takes an array and returns a new array containing all the elements +* except for the first one. If the input array is empty or has only one element, +* an empty array is returned. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array to get the tail of. +* @returns {T[]} A new array containing all elements of the input array except for the first one. +* +* @example +* const arr1 = [1, 2, 3]; +* const result = tail(arr1); +* // result will be [2, 3] +* +* const arr2 = [1]; +* const result2 = tail(arr2); +* // result2 will be [] +* +* const arr3 = []; +* const result3 = tail(arr3); +* // result3 will be [] +*/ +function tail(arr) { + return arr.slice(1); +} +//#endregion +export { tail }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/take.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/take.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..0e7a1ad9ab89613400aa2a0c5049a41fab9aa26f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/take.d.mts @@ -0,0 +1,32 @@ +//#region src/array/take.d.ts +/** + * Returns a new array containing the first `count` elements from the input array `arr`. + * If `count` is greater than the length of `arr`, the entire array is returned. + * + * @template T - Type of elements in the input array. + * + * @param {T[]} arr - The array to take elements from. + * @param {number} count - The number of elements to take. + * @param {unknown} guard - If truthy, ignores `count` and defaults to 1. + * @returns {T[]} A new array containing the first `count` elements from `arr`. + * + * @example + * // Returns [1, 2, 3] + * take([1, 2, 3, 4, 5], 3); + * + * @example + * // Returns ['a', 'b'] + * take(['a', 'b', 'c'], 2); + * + * @example + * // Returns [1, 2, 3] + * take([1, 2, 3], 5); + * + * @example + * // Returns [[1], [1], [1]] + * const arr = [1, 2, 3]; + * const result = arr.map((v, i, array) => take(array, i, true)); + */ +declare function take(arr: readonly T[], count?: number, guard?: unknown): T[]; +//#endregion +export { take }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/take.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/take.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0e7a1ad9ab89613400aa2a0c5049a41fab9aa26f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/take.d.ts @@ -0,0 +1,32 @@ +//#region src/array/take.d.ts +/** + * Returns a new array containing the first `count` elements from the input array `arr`. + * If `count` is greater than the length of `arr`, the entire array is returned. + * + * @template T - Type of elements in the input array. + * + * @param {T[]} arr - The array to take elements from. + * @param {number} count - The number of elements to take. + * @param {unknown} guard - If truthy, ignores `count` and defaults to 1. + * @returns {T[]} A new array containing the first `count` elements from `arr`. + * + * @example + * // Returns [1, 2, 3] + * take([1, 2, 3, 4, 5], 3); + * + * @example + * // Returns ['a', 'b'] + * take(['a', 'b', 'c'], 2); + * + * @example + * // Returns [1, 2, 3] + * take([1, 2, 3], 5); + * + * @example + * // Returns [[1], [1], [1]] + * const arr = [1, 2, 3]; + * const result = arr.map((v, i, array) => take(array, i, true)); + */ +declare function take(arr: readonly T[], count?: number, guard?: unknown): T[]; +//#endregion +export { take }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/take.js b/tools/ui/node_modules/es-toolkit/dist/array/take.js new file mode 100644 index 0000000000000000000000000000000000000000..96e645b7641565b3436ac0edd9067aad69bb8265 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/take.js @@ -0,0 +1,36 @@ +const require_toInteger = require("../compat/util/toInteger.js"); +//#region src/array/take.ts +/** +* Returns a new array containing the first `count` elements from the input array `arr`. +* If `count` is greater than the length of `arr`, the entire array is returned. +* +* @template T - Type of elements in the input array. +* +* @param {T[]} arr - The array to take elements from. +* @param {number} count - The number of elements to take. +* @param {unknown} guard - If truthy, ignores `count` and defaults to 1. +* @returns {T[]} A new array containing the first `count` elements from `arr`. +* +* @example +* // Returns [1, 2, 3] +* take([1, 2, 3, 4, 5], 3); +* +* @example +* // Returns ['a', 'b'] +* take(['a', 'b', 'c'], 2); +* +* @example +* // Returns [1, 2, 3] +* take([1, 2, 3], 5); +* +* @example +* // Returns [[1], [1], [1]] +* const arr = [1, 2, 3]; +* const result = arr.map((v, i, array) => take(array, i, true)); +*/ +function take(arr, count, guard) { + count = guard || count === void 0 ? 1 : require_toInteger.toInteger(count); + return arr.slice(0, count); +} +//#endregion +exports.take = take; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/take.mjs b/tools/ui/node_modules/es-toolkit/dist/array/take.mjs new file mode 100644 index 0000000000000000000000000000000000000000..db92029ee3513cac53a7c6a24df2197b80a6c002 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/take.mjs @@ -0,0 +1,36 @@ +import { toInteger } from "../compat/util/toInteger.mjs"; +//#region src/array/take.ts +/** +* Returns a new array containing the first `count` elements from the input array `arr`. +* If `count` is greater than the length of `arr`, the entire array is returned. +* +* @template T - Type of elements in the input array. +* +* @param {T[]} arr - The array to take elements from. +* @param {number} count - The number of elements to take. +* @param {unknown} guard - If truthy, ignores `count` and defaults to 1. +* @returns {T[]} A new array containing the first `count` elements from `arr`. +* +* @example +* // Returns [1, 2, 3] +* take([1, 2, 3, 4, 5], 3); +* +* @example +* // Returns ['a', 'b'] +* take(['a', 'b', 'c'], 2); +* +* @example +* // Returns [1, 2, 3] +* take([1, 2, 3], 5); +* +* @example +* // Returns [[1], [1], [1]] +* const arr = [1, 2, 3]; +* const result = arr.map((v, i, array) => take(array, i, true)); +*/ +function take(arr, count, guard) { + count = guard || count === void 0 ? 1 : toInteger(count); + return arr.slice(0, count); +} +//#endregion +export { take }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/takeRight.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/takeRight.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..0f0573fa589e210c33d333e3ed56abd5764fd3e4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/takeRight.d.mts @@ -0,0 +1,25 @@ +//#region src/array/takeRight.d.ts +/** + * Returns a new array containing the last `count` elements from the input array `arr`. + * If `count` is greater than the length of `arr`, the entire array is returned. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to take elements from. + * @param {number} [count=1] - The number of elements to take. + * @returns {T[]} A new array containing the last `count` elements from `arr`. + * + * @example + * // Returns [4, 5] + * takeRight([1, 2, 3, 4, 5], 2); + * + * @example + * // Returns ['b', 'c'] + * takeRight(['a', 'b', 'c'], 2); + * + * @example + * // Returns [1, 2, 3] + * takeRight([1, 2, 3], 5); + */ +declare function takeRight(arr: readonly T[], count?: number, guard?: unknown): T[]; +//#endregion +export { takeRight }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/takeRight.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/takeRight.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0f0573fa589e210c33d333e3ed56abd5764fd3e4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/takeRight.d.ts @@ -0,0 +1,25 @@ +//#region src/array/takeRight.d.ts +/** + * Returns a new array containing the last `count` elements from the input array `arr`. + * If `count` is greater than the length of `arr`, the entire array is returned. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to take elements from. + * @param {number} [count=1] - The number of elements to take. + * @returns {T[]} A new array containing the last `count` elements from `arr`. + * + * @example + * // Returns [4, 5] + * takeRight([1, 2, 3, 4, 5], 2); + * + * @example + * // Returns ['b', 'c'] + * takeRight(['a', 'b', 'c'], 2); + * + * @example + * // Returns [1, 2, 3] + * takeRight([1, 2, 3], 5); + */ +declare function takeRight(arr: readonly T[], count?: number, guard?: unknown): T[]; +//#endregion +export { takeRight }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/takeRight.js b/tools/ui/node_modules/es-toolkit/dist/array/takeRight.js new file mode 100644 index 0000000000000000000000000000000000000000..19601e40a5f6ebfdad46daad0d53665c27047419 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/takeRight.js @@ -0,0 +1,30 @@ +const require_toInteger = require("../compat/util/toInteger.js"); +//#region src/array/takeRight.ts +/** +* Returns a new array containing the last `count` elements from the input array `arr`. +* If `count` is greater than the length of `arr`, the entire array is returned. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array to take elements from. +* @param {number} [count=1] - The number of elements to take. +* @returns {T[]} A new array containing the last `count` elements from `arr`. +* +* @example +* // Returns [4, 5] +* takeRight([1, 2, 3, 4, 5], 2); +* +* @example +* // Returns ['b', 'c'] +* takeRight(['a', 'b', 'c'], 2); +* +* @example +* // Returns [1, 2, 3] +* takeRight([1, 2, 3], 5); +*/ +function takeRight(arr, count, guard) { + count = guard || count === void 0 ? 1 : require_toInteger.toInteger(count); + if (count <= 0 || arr.length === 0) return []; + return arr.slice(-count); +} +//#endregion +exports.takeRight = takeRight; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/takeRight.mjs b/tools/ui/node_modules/es-toolkit/dist/array/takeRight.mjs new file mode 100644 index 0000000000000000000000000000000000000000..10b07d885aa937fbee1b80ec8bd6fb880207d0ee --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/takeRight.mjs @@ -0,0 +1,30 @@ +import { toInteger } from "../compat/util/toInteger.mjs"; +//#region src/array/takeRight.ts +/** +* Returns a new array containing the last `count` elements from the input array `arr`. +* If `count` is greater than the length of `arr`, the entire array is returned. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array to take elements from. +* @param {number} [count=1] - The number of elements to take. +* @returns {T[]} A new array containing the last `count` elements from `arr`. +* +* @example +* // Returns [4, 5] +* takeRight([1, 2, 3, 4, 5], 2); +* +* @example +* // Returns ['b', 'c'] +* takeRight(['a', 'b', 'c'], 2); +* +* @example +* // Returns [1, 2, 3] +* takeRight([1, 2, 3], 5); +*/ +function takeRight(arr, count, guard) { + count = guard || count === void 0 ? 1 : toInteger(count); + if (count <= 0 || arr.length === 0) return []; + return arr.slice(-count); +} +//#endregion +export { takeRight }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/takeRightWhile.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/takeRightWhile.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..d46d276998ec665ae86eddd5688da0de4c33d78b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/takeRightWhile.d.mts @@ -0,0 +1,26 @@ +//#region src/array/takeRightWhile.d.ts +/** + * Takes elements from the end of the array while the predicate function returns `true`. + * + * @template T - Type of elements in the input array. + * + * @param {T[]} arr - The array to take elements from. + * @param {(item: T, index: number, array: readonly T[]) => boolean} shouldContinueTaking - The function invoked per element with the item, its index, and the array. + * @returns {T[]} A new array containing the elements taken from the end while the predicate returns `true`. + * + * @example + * // Returns [3, 2, 1] + * takeRightWhile([5, 4, 3, 2, 1], n => n < 4); + * + * @example + * // Returns [] + * takeRightWhile([1, 2, 3], n => n > 3); + * + * @example + * // Using index parameter + * takeRightWhile([10, 20, 30, 40], (x, index) => index > 1); + * // Returns: [30, 40] + */ +declare function takeRightWhile(arr: readonly T[], shouldContinueTaking: (item: T, index: number, array: readonly T[]) => boolean): T[]; +//#endregion +export { takeRightWhile }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/takeRightWhile.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/takeRightWhile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d46d276998ec665ae86eddd5688da0de4c33d78b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/takeRightWhile.d.ts @@ -0,0 +1,26 @@ +//#region src/array/takeRightWhile.d.ts +/** + * Takes elements from the end of the array while the predicate function returns `true`. + * + * @template T - Type of elements in the input array. + * + * @param {T[]} arr - The array to take elements from. + * @param {(item: T, index: number, array: readonly T[]) => boolean} shouldContinueTaking - The function invoked per element with the item, its index, and the array. + * @returns {T[]} A new array containing the elements taken from the end while the predicate returns `true`. + * + * @example + * // Returns [3, 2, 1] + * takeRightWhile([5, 4, 3, 2, 1], n => n < 4); + * + * @example + * // Returns [] + * takeRightWhile([1, 2, 3], n => n > 3); + * + * @example + * // Using index parameter + * takeRightWhile([10, 20, 30, 40], (x, index) => index > 1); + * // Returns: [30, 40] + */ +declare function takeRightWhile(arr: readonly T[], shouldContinueTaking: (item: T, index: number, array: readonly T[]) => boolean): T[]; +//#endregion +export { takeRightWhile }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/takeRightWhile.js b/tools/ui/node_modules/es-toolkit/dist/array/takeRightWhile.js new file mode 100644 index 0000000000000000000000000000000000000000..9ea33bc9ab3cd92956f379accc6ba19f91d8423e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/takeRightWhile.js @@ -0,0 +1,29 @@ +//#region src/array/takeRightWhile.ts +/** +* Takes elements from the end of the array while the predicate function returns `true`. +* +* @template T - Type of elements in the input array. +* +* @param {T[]} arr - The array to take elements from. +* @param {(item: T, index: number, array: readonly T[]) => boolean} shouldContinueTaking - The function invoked per element with the item, its index, and the array. +* @returns {T[]} A new array containing the elements taken from the end while the predicate returns `true`. +* +* @example +* // Returns [3, 2, 1] +* takeRightWhile([5, 4, 3, 2, 1], n => n < 4); +* +* @example +* // Returns [] +* takeRightWhile([1, 2, 3], n => n > 3); +* +* @example +* // Using index parameter +* takeRightWhile([10, 20, 30, 40], (x, index) => index > 1); +* // Returns: [30, 40] +*/ +function takeRightWhile(arr, shouldContinueTaking) { + for (let i = arr.length - 1; i >= 0; i--) if (!shouldContinueTaking(arr[i], i, arr)) return arr.slice(i + 1); + return arr.slice(); +} +//#endregion +exports.takeRightWhile = takeRightWhile; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/takeRightWhile.mjs b/tools/ui/node_modules/es-toolkit/dist/array/takeRightWhile.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f643cdd9a362b534bce717a0432166193b1c2051 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/takeRightWhile.mjs @@ -0,0 +1,29 @@ +//#region src/array/takeRightWhile.ts +/** +* Takes elements from the end of the array while the predicate function returns `true`. +* +* @template T - Type of elements in the input array. +* +* @param {T[]} arr - The array to take elements from. +* @param {(item: T, index: number, array: readonly T[]) => boolean} shouldContinueTaking - The function invoked per element with the item, its index, and the array. +* @returns {T[]} A new array containing the elements taken from the end while the predicate returns `true`. +* +* @example +* // Returns [3, 2, 1] +* takeRightWhile([5, 4, 3, 2, 1], n => n < 4); +* +* @example +* // Returns [] +* takeRightWhile([1, 2, 3], n => n > 3); +* +* @example +* // Using index parameter +* takeRightWhile([10, 20, 30, 40], (x, index) => index > 1); +* // Returns: [30, 40] +*/ +function takeRightWhile(arr, shouldContinueTaking) { + for (let i = arr.length - 1; i >= 0; i--) if (!shouldContinueTaking(arr[i], i, arr)) return arr.slice(i + 1); + return arr.slice(); +} +//#endregion +export { takeRightWhile }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/takeWhile.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/takeWhile.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..4189cf433681503b0b8f0ad3a42ee3ce700d1f6b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/takeWhile.d.mts @@ -0,0 +1,27 @@ +//#region src/array/takeWhile.d.ts +/** + * Returns a new array containing the leading elements of the provided array + * that satisfy the provided predicate function. It stops taking elements as soon + * as an element does not satisfy the predicate. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to process. + * @param {(element: T, index: number, array: readonly T[]) => boolean} shouldContinueTaking - The predicate function that is called with each element, its index, and the array. Elements are included in the result as long as this function returns true. + * @returns {T[]} A new array containing the leading elements that satisfy the predicate. + * + * @example + * // Returns [1, 2] + * takeWhile([1, 2, 3, 4], x => x < 3); + * + * @example + * // Returns [] + * takeWhile([1, 2, 3, 4], x => x > 3); + * + * @example + * // Using index parameter + * takeWhile([10, 20, 30, 40], (x, index) => index < 2); + * // Returns: [10, 20] + */ +declare function takeWhile(arr: readonly T[], shouldContinueTaking: (element: T, index: number, array: readonly T[]) => boolean): T[]; +//#endregion +export { takeWhile }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/takeWhile.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/takeWhile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4189cf433681503b0b8f0ad3a42ee3ce700d1f6b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/takeWhile.d.ts @@ -0,0 +1,27 @@ +//#region src/array/takeWhile.d.ts +/** + * Returns a new array containing the leading elements of the provided array + * that satisfy the provided predicate function. It stops taking elements as soon + * as an element does not satisfy the predicate. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to process. + * @param {(element: T, index: number, array: readonly T[]) => boolean} shouldContinueTaking - The predicate function that is called with each element, its index, and the array. Elements are included in the result as long as this function returns true. + * @returns {T[]} A new array containing the leading elements that satisfy the predicate. + * + * @example + * // Returns [1, 2] + * takeWhile([1, 2, 3, 4], x => x < 3); + * + * @example + * // Returns [] + * takeWhile([1, 2, 3, 4], x => x > 3); + * + * @example + * // Using index parameter + * takeWhile([10, 20, 30, 40], (x, index) => index < 2); + * // Returns: [10, 20] + */ +declare function takeWhile(arr: readonly T[], shouldContinueTaking: (element: T, index: number, array: readonly T[]) => boolean): T[]; +//#endregion +export { takeWhile }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/takeWhile.js b/tools/ui/node_modules/es-toolkit/dist/array/takeWhile.js new file mode 100644 index 0000000000000000000000000000000000000000..99e2f816dbc17f4e87da9be6f083480177c0c36d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/takeWhile.js @@ -0,0 +1,35 @@ +//#region src/array/takeWhile.ts +/** +* Returns a new array containing the leading elements of the provided array +* that satisfy the provided predicate function. It stops taking elements as soon +* as an element does not satisfy the predicate. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array to process. +* @param {(element: T, index: number, array: readonly T[]) => boolean} shouldContinueTaking - The predicate function that is called with each element, its index, and the array. Elements are included in the result as long as this function returns true. +* @returns {T[]} A new array containing the leading elements that satisfy the predicate. +* +* @example +* // Returns [1, 2] +* takeWhile([1, 2, 3, 4], x => x < 3); +* +* @example +* // Returns [] +* takeWhile([1, 2, 3, 4], x => x > 3); +* +* @example +* // Using index parameter +* takeWhile([10, 20, 30, 40], (x, index) => index < 2); +* // Returns: [10, 20] +*/ +function takeWhile(arr, shouldContinueTaking) { + const result = []; + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + if (!shouldContinueTaking(item, i, arr)) break; + result.push(item); + } + return result; +} +//#endregion +exports.takeWhile = takeWhile; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/takeWhile.mjs b/tools/ui/node_modules/es-toolkit/dist/array/takeWhile.mjs new file mode 100644 index 0000000000000000000000000000000000000000..ce5a1951da4123c165ff44831c6411863a93bc65 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/takeWhile.mjs @@ -0,0 +1,35 @@ +//#region src/array/takeWhile.ts +/** +* Returns a new array containing the leading elements of the provided array +* that satisfy the provided predicate function. It stops taking elements as soon +* as an element does not satisfy the predicate. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array to process. +* @param {(element: T, index: number, array: readonly T[]) => boolean} shouldContinueTaking - The predicate function that is called with each element, its index, and the array. Elements are included in the result as long as this function returns true. +* @returns {T[]} A new array containing the leading elements that satisfy the predicate. +* +* @example +* // Returns [1, 2] +* takeWhile([1, 2, 3, 4], x => x < 3); +* +* @example +* // Returns [] +* takeWhile([1, 2, 3, 4], x => x > 3); +* +* @example +* // Using index parameter +* takeWhile([10, 20, 30, 40], (x, index) => index < 2); +* // Returns: [10, 20] +*/ +function takeWhile(arr, shouldContinueTaking) { + const result = []; + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + if (!shouldContinueTaking(item, i, arr)) break; + result.push(item); + } + return result; +} +//#endregion +export { takeWhile }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/toFilled.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/toFilled.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..06e304db4e880a50ced2ef87f0739104de4ac8b1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/toFilled.d.mts @@ -0,0 +1,93 @@ +//#region src/array/toFilled.d.ts +/** + * Creates a new array filled with the specified value from the start position up to, but not including, the end position. + * This function does not mutate the original array. + * + * @template T - The type of elements in the original array. + * @template U - The type of the value to fill the new array with. + * @param {Array} arr - The array to base the new array on. + * @param {U} value - The value to fill the new array with. + * @returns {Array} The new array with the filled values. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * let result = toFilled(array, '*', 2); + * console.log(result); // [1, 2, '*', '*', '*'] + * console.log(array); // [1, 2, 3, 4, 5] + * + * result = toFilled(array, '*', 1, 4); + * console.log(result); // [1, '*', '*', '*', 5] + * console.log(array); // [1, 2, 3, 4, 5] + * + * result = toFilled(array, '*'); + * console.log(result); // ['*', '*', '*', '*', '*'] + * console.log(array); // [1, 2, 3, 4, 5] + * + * result = toFilled(array, '*', -4, -1); + * console.log(result); // [1, '*', '*', '*', 5] + * console.log(array); // [1, 2, 3, 4, 5] + */ +declare function toFilled(arr: readonly T[], value: U): Array; +/** + * Creates a new array filled with the specified value from the start position up to, but not including, the end position. + * This function does not mutate the original array. + * + * @template T - The type of elements in the original array. + * @template U - The type of the value to fill the new array with. + * @param {Array} arr - The array to base the new array on. + * @param {U} value - The value to fill the new array with. + * @param {number} [start=0] - The start position. Defaults to 0. + * @returns {Array} The new array with the filled values. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * let result = toFilled(array, '*', 2); + * console.log(result); // [1, 2, '*', '*', '*'] + * console.log(array); // [1, 2, 3, 4, 5] + * + * result = toFilled(array, '*', 1, 4); + * console.log(result); // [1, '*', '*', '*', 5] + * console.log(array); // [1, 2, 3, 4, 5] + * + * result = toFilled(array, '*'); + * console.log(result); // ['*', '*', '*', '*', '*'] + * console.log(array); // [1, 2, 3, 4, 5] + * + * result = toFilled(array, '*', -4, -1); + * console.log(result); // [1, '*', '*', '*', 5] + * console.log(array); // [1, 2, 3, 4, 5] + */ +declare function toFilled(arr: readonly T[], value: U, start: number): Array; +/** + * Creates a new array filled with the specified value from the start position up to, but not including, the end position. + * This function does not mutate the original array. + * + * @template T - The type of elements in the original array. + * @template U - The type of the value to fill the new array with. + * @param {Array} arr - The array to base the new array on. + * @param {U} value - The value to fill the new array with. + * @param {number} [start=0] - The start position. Defaults to 0. + * @param {number} [end=arr.length] - The end position. Defaults to the array's length. + * @returns {Array} The new array with the filled values. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * let result = toFilled(array, '*', 2); + * console.log(result); // [1, 2, '*', '*', '*'] + * console.log(array); // [1, 2, 3, 4, 5] + * + * result = toFilled(array, '*', 1, 4); + * console.log(result); // [1, '*', '*', '*', 5] + * console.log(array); // [1, 2, 3, 4, 5] + * + * result = toFilled(array, '*'); + * console.log(result); // ['*', '*', '*', '*', '*'] + * console.log(array); // [1, 2, 3, 4, 5] + * + * result = toFilled(array, '*', -4, -1); + * console.log(result); // [1, '*', '*', '*', 5] + * console.log(array); // [1, 2, 3, 4, 5] + */ +declare function toFilled(arr: readonly T[], value: U, start: number, end: number): Array; +//#endregion +export { toFilled }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/toFilled.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/toFilled.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..06e304db4e880a50ced2ef87f0739104de4ac8b1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/toFilled.d.ts @@ -0,0 +1,93 @@ +//#region src/array/toFilled.d.ts +/** + * Creates a new array filled with the specified value from the start position up to, but not including, the end position. + * This function does not mutate the original array. + * + * @template T - The type of elements in the original array. + * @template U - The type of the value to fill the new array with. + * @param {Array} arr - The array to base the new array on. + * @param {U} value - The value to fill the new array with. + * @returns {Array} The new array with the filled values. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * let result = toFilled(array, '*', 2); + * console.log(result); // [1, 2, '*', '*', '*'] + * console.log(array); // [1, 2, 3, 4, 5] + * + * result = toFilled(array, '*', 1, 4); + * console.log(result); // [1, '*', '*', '*', 5] + * console.log(array); // [1, 2, 3, 4, 5] + * + * result = toFilled(array, '*'); + * console.log(result); // ['*', '*', '*', '*', '*'] + * console.log(array); // [1, 2, 3, 4, 5] + * + * result = toFilled(array, '*', -4, -1); + * console.log(result); // [1, '*', '*', '*', 5] + * console.log(array); // [1, 2, 3, 4, 5] + */ +declare function toFilled(arr: readonly T[], value: U): Array; +/** + * Creates a new array filled with the specified value from the start position up to, but not including, the end position. + * This function does not mutate the original array. + * + * @template T - The type of elements in the original array. + * @template U - The type of the value to fill the new array with. + * @param {Array} arr - The array to base the new array on. + * @param {U} value - The value to fill the new array with. + * @param {number} [start=0] - The start position. Defaults to 0. + * @returns {Array} The new array with the filled values. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * let result = toFilled(array, '*', 2); + * console.log(result); // [1, 2, '*', '*', '*'] + * console.log(array); // [1, 2, 3, 4, 5] + * + * result = toFilled(array, '*', 1, 4); + * console.log(result); // [1, '*', '*', '*', 5] + * console.log(array); // [1, 2, 3, 4, 5] + * + * result = toFilled(array, '*'); + * console.log(result); // ['*', '*', '*', '*', '*'] + * console.log(array); // [1, 2, 3, 4, 5] + * + * result = toFilled(array, '*', -4, -1); + * console.log(result); // [1, '*', '*', '*', 5] + * console.log(array); // [1, 2, 3, 4, 5] + */ +declare function toFilled(arr: readonly T[], value: U, start: number): Array; +/** + * Creates a new array filled with the specified value from the start position up to, but not including, the end position. + * This function does not mutate the original array. + * + * @template T - The type of elements in the original array. + * @template U - The type of the value to fill the new array with. + * @param {Array} arr - The array to base the new array on. + * @param {U} value - The value to fill the new array with. + * @param {number} [start=0] - The start position. Defaults to 0. + * @param {number} [end=arr.length] - The end position. Defaults to the array's length. + * @returns {Array} The new array with the filled values. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * let result = toFilled(array, '*', 2); + * console.log(result); // [1, 2, '*', '*', '*'] + * console.log(array); // [1, 2, 3, 4, 5] + * + * result = toFilled(array, '*', 1, 4); + * console.log(result); // [1, '*', '*', '*', 5] + * console.log(array); // [1, 2, 3, 4, 5] + * + * result = toFilled(array, '*'); + * console.log(result); // ['*', '*', '*', '*', '*'] + * console.log(array); // [1, 2, 3, 4, 5] + * + * result = toFilled(array, '*', -4, -1); + * console.log(result); // [1, '*', '*', '*', 5] + * console.log(array); // [1, 2, 3, 4, 5] + */ +declare function toFilled(arr: readonly T[], value: U, start: number, end: number): Array; +//#endregion +export { toFilled }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/toFilled.js b/tools/ui/node_modules/es-toolkit/dist/array/toFilled.js new file mode 100644 index 0000000000000000000000000000000000000000..c350e696c712515ecb5e5027b51774e8e89b7052 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/toFilled.js @@ -0,0 +1,23 @@ +//#region src/array/toFilled.ts +/** +* Creates a new array filled with the specified value from the start position up to, but not including, the end position. +* This function does not mutate the original array. +* +* @template T - The type of elements in the original array. +* @template U - The type of the value to fill the new array with. +* @param {Array} arr - The array to base the new array on. +* @param {U} value - The value to fill the new array with. +* @param {number} [start=0] - The start position. Defaults to 0. +* @param {number} [end=arr.length] - The end position. Defaults to the array's length. +* @returns {Array} The new array with the filled values. +*/ +function toFilled(arr, value, start = 0, end = arr.length) { + const length = arr.length; + const finalStart = Math.max(start >= 0 ? start : length + start, 0); + const finalEnd = Math.min(end >= 0 ? end : length + end, length); + const newArr = arr.slice(); + for (let i = finalStart; i < finalEnd; i++) newArr[i] = value; + return newArr; +} +//#endregion +exports.toFilled = toFilled; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/toFilled.mjs b/tools/ui/node_modules/es-toolkit/dist/array/toFilled.mjs new file mode 100644 index 0000000000000000000000000000000000000000..39e321363588836005dd162068e9d58b5025aa7c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/toFilled.mjs @@ -0,0 +1,23 @@ +//#region src/array/toFilled.ts +/** +* Creates a new array filled with the specified value from the start position up to, but not including, the end position. +* This function does not mutate the original array. +* +* @template T - The type of elements in the original array. +* @template U - The type of the value to fill the new array with. +* @param {Array} arr - The array to base the new array on. +* @param {U} value - The value to fill the new array with. +* @param {number} [start=0] - The start position. Defaults to 0. +* @param {number} [end=arr.length] - The end position. Defaults to the array's length. +* @returns {Array} The new array with the filled values. +*/ +function toFilled(arr, value, start = 0, end = arr.length) { + const length = arr.length; + const finalStart = Math.max(start >= 0 ? start : length + start, 0); + const finalEnd = Math.min(end >= 0 ? end : length + end, length); + const newArr = arr.slice(); + for (let i = finalStart; i < finalEnd; i++) newArr[i] = value; + return newArr; +} +//#endregion +export { toFilled }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/union.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/union.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..f05eac8464d1603276fd1c5e1c1ce40f5e17fc2d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/union.d.mts @@ -0,0 +1,21 @@ +//#region src/array/union.d.ts +/** + * Creates an array of unique values from all given arrays. + * + * This function takes two arrays, merges them into a single array, and returns a new array + * containing only the unique values from the merged array. + * + * @template T - The type of elements in the array. + * @param {T[]} arr1 - The first array to merge and filter for unique values. + * @param {T[]} arr2 - The second array to merge and filter for unique values. + * @returns {T[]} A new array of unique values. + * + * @example + * const array1 = [1, 2, 3]; + * const array2 = [3, 4, 5]; + * const result = union(array1, array2); + * // result will be [1, 2, 3, 4, 5] + */ +declare function union(arr1: readonly T[], arr2: readonly T[]): T[]; +//#endregion +export { union }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/union.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/union.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f05eac8464d1603276fd1c5e1c1ce40f5e17fc2d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/union.d.ts @@ -0,0 +1,21 @@ +//#region src/array/union.d.ts +/** + * Creates an array of unique values from all given arrays. + * + * This function takes two arrays, merges them into a single array, and returns a new array + * containing only the unique values from the merged array. + * + * @template T - The type of elements in the array. + * @param {T[]} arr1 - The first array to merge and filter for unique values. + * @param {T[]} arr2 - The second array to merge and filter for unique values. + * @returns {T[]} A new array of unique values. + * + * @example + * const array1 = [1, 2, 3]; + * const array2 = [3, 4, 5]; + * const result = union(array1, array2); + * // result will be [1, 2, 3, 4, 5] + */ +declare function union(arr1: readonly T[], arr2: readonly T[]): T[]; +//#endregion +export { union }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/union.js b/tools/ui/node_modules/es-toolkit/dist/array/union.js new file mode 100644 index 0000000000000000000000000000000000000000..eb021572d61c26d669432e61152d2d399b76f770 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/union.js @@ -0,0 +1,24 @@ +const require_uniq = require("./uniq.js"); +//#region src/array/union.ts +/** +* Creates an array of unique values from all given arrays. +* +* This function takes two arrays, merges them into a single array, and returns a new array +* containing only the unique values from the merged array. +* +* @template T - The type of elements in the array. +* @param {T[]} arr1 - The first array to merge and filter for unique values. +* @param {T[]} arr2 - The second array to merge and filter for unique values. +* @returns {T[]} A new array of unique values. +* +* @example +* const array1 = [1, 2, 3]; +* const array2 = [3, 4, 5]; +* const result = union(array1, array2); +* // result will be [1, 2, 3, 4, 5] +*/ +function union(arr1, arr2) { + return require_uniq.uniq(arr1.concat(arr2)); +} +//#endregion +exports.union = union; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/union.mjs b/tools/ui/node_modules/es-toolkit/dist/array/union.mjs new file mode 100644 index 0000000000000000000000000000000000000000..da47f2e0397f65ebeadd0c18972f4f59f45dd39b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/union.mjs @@ -0,0 +1,24 @@ +import { uniq } from "./uniq.mjs"; +//#region src/array/union.ts +/** +* Creates an array of unique values from all given arrays. +* +* This function takes two arrays, merges them into a single array, and returns a new array +* containing only the unique values from the merged array. +* +* @template T - The type of elements in the array. +* @param {T[]} arr1 - The first array to merge and filter for unique values. +* @param {T[]} arr2 - The second array to merge and filter for unique values. +* @returns {T[]} A new array of unique values. +* +* @example +* const array1 = [1, 2, 3]; +* const array2 = [3, 4, 5]; +* const result = union(array1, array2); +* // result will be [1, 2, 3, 4, 5] +*/ +function union(arr1, arr2) { + return uniq(arr1.concat(arr2)); +} +//#endregion +export { union }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/unionBy.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/unionBy.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..3231c15eb0b759e01726c259d3bdfcf7f6720178 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/unionBy.d.mts @@ -0,0 +1,26 @@ +//#region src/array/unionBy.d.ts +/** + * Creates an array of unique values, in order, from all given arrays using a provided mapping function to determine equality. + * + * @template T - The type of elements in the array. + * @template U - The type of mapped elements. + * @param {T[]} arr1 - The first array. + * @param {T[]} arr2 - The second array. + * @param {(item: T) => U} mapper - The function to map array elements to comparison values. + * @returns {T[]} A new array containing the union of unique elements from `arr1` and `arr2`, based on the values returned by the mapping function. + * + * @example + * // Custom mapping function for numbers (modulo comparison) + * const moduloMapper = (x) => x % 3; + * unionBy([1, 2, 3], [4, 5, 6], moduloMapper); + * // Returns [1, 2, 3] + * + * @example + * // Custom mapping function for objects with an 'id' property + * const idMapper = (obj) => obj.id; + * unionBy([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper); + * // Returns [{ id: 1 }, { id: 2 }, { id: 3 }] + */ +declare function unionBy(arr1: readonly T[], arr2: readonly T[], mapper: (item: T) => U): T[]; +//#endregion +export { unionBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/unionBy.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/unionBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3231c15eb0b759e01726c259d3bdfcf7f6720178 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/unionBy.d.ts @@ -0,0 +1,26 @@ +//#region src/array/unionBy.d.ts +/** + * Creates an array of unique values, in order, from all given arrays using a provided mapping function to determine equality. + * + * @template T - The type of elements in the array. + * @template U - The type of mapped elements. + * @param {T[]} arr1 - The first array. + * @param {T[]} arr2 - The second array. + * @param {(item: T) => U} mapper - The function to map array elements to comparison values. + * @returns {T[]} A new array containing the union of unique elements from `arr1` and `arr2`, based on the values returned by the mapping function. + * + * @example + * // Custom mapping function for numbers (modulo comparison) + * const moduloMapper = (x) => x % 3; + * unionBy([1, 2, 3], [4, 5, 6], moduloMapper); + * // Returns [1, 2, 3] + * + * @example + * // Custom mapping function for objects with an 'id' property + * const idMapper = (obj) => obj.id; + * unionBy([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper); + * // Returns [{ id: 1 }, { id: 2 }, { id: 3 }] + */ +declare function unionBy(arr1: readonly T[], arr2: readonly T[], mapper: (item: T) => U): T[]; +//#endregion +export { unionBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/unionBy.js b/tools/ui/node_modules/es-toolkit/dist/array/unionBy.js new file mode 100644 index 0000000000000000000000000000000000000000..96e04195492406dcdfd656c1a0a4a20999977bad --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/unionBy.js @@ -0,0 +1,29 @@ +const require_uniqBy = require("./uniqBy.js"); +//#region src/array/unionBy.ts +/** +* Creates an array of unique values, in order, from all given arrays using a provided mapping function to determine equality. +* +* @template T - The type of elements in the array. +* @template U - The type of mapped elements. +* @param {T[]} arr1 - The first array. +* @param {T[]} arr2 - The second array. +* @param {(item: T) => U} mapper - The function to map array elements to comparison values. +* @returns {T[]} A new array containing the union of unique elements from `arr1` and `arr2`, based on the values returned by the mapping function. +* +* @example +* // Custom mapping function for numbers (modulo comparison) +* const moduloMapper = (x) => x % 3; +* unionBy([1, 2, 3], [4, 5, 6], moduloMapper); +* // Returns [1, 2, 3] +* +* @example +* // Custom mapping function for objects with an 'id' property +* const idMapper = (obj) => obj.id; +* unionBy([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper); +* // Returns [{ id: 1 }, { id: 2 }, { id: 3 }] +*/ +function unionBy(arr1, arr2, mapper) { + return require_uniqBy.uniqBy(arr1.concat(arr2), mapper); +} +//#endregion +exports.unionBy = unionBy; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/unionBy.mjs b/tools/ui/node_modules/es-toolkit/dist/array/unionBy.mjs new file mode 100644 index 0000000000000000000000000000000000000000..80122e70b6aedf32cfee5f9fc14b67e25fd1bdf1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/unionBy.mjs @@ -0,0 +1,29 @@ +import { uniqBy } from "./uniqBy.mjs"; +//#region src/array/unionBy.ts +/** +* Creates an array of unique values, in order, from all given arrays using a provided mapping function to determine equality. +* +* @template T - The type of elements in the array. +* @template U - The type of mapped elements. +* @param {T[]} arr1 - The first array. +* @param {T[]} arr2 - The second array. +* @param {(item: T) => U} mapper - The function to map array elements to comparison values. +* @returns {T[]} A new array containing the union of unique elements from `arr1` and `arr2`, based on the values returned by the mapping function. +* +* @example +* // Custom mapping function for numbers (modulo comparison) +* const moduloMapper = (x) => x % 3; +* unionBy([1, 2, 3], [4, 5, 6], moduloMapper); +* // Returns [1, 2, 3] +* +* @example +* // Custom mapping function for objects with an 'id' property +* const idMapper = (obj) => obj.id; +* unionBy([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper); +* // Returns [{ id: 1 }, { id: 2 }, { id: 3 }] +*/ +function unionBy(arr1, arr2, mapper) { + return uniqBy(arr1.concat(arr2), mapper); +} +//#endregion +export { unionBy }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/unionWith.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/unionWith.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..cdb8f2808b157cf78de7604c34d744f088d384fd --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/unionWith.d.mts @@ -0,0 +1,24 @@ +//#region src/array/unionWith.d.ts +/** + * Creates an array of unique values from two given arrays based on a custom equality function. + * + * This function takes two arrays and a custom equality function, merges the arrays, and returns + * a new array containing only the unique values as determined by the custom equality function. + * + * @template T - The type of elements in the array. + * @param {T[]} arr1 - The first array to merge and filter for unique values. + * @param {T[]} arr2 - The second array to merge and filter for unique values. + * @param {(item1: T, item2: T) => boolean} areItemsEqual - A custom function to determine if two elements are equal. + * It takes two arguments and returns `true` if the elements are considered equal, and `false` otherwise. + * @returns {T[]} A new array of unique values based on the custom equality function. + * + * @example + * const array1 = [{ id: 1 }, { id: 2 }]; + * const array2 = [{ id: 2 }, { id: 3 }]; + * const areItemsEqual = (a, b) => a.id === b.id; + * const result = unionWith(array1, array2, areItemsEqual); + * // result will be [{ id: 1 }, { id: 2 }, { id: 3 }] since { id: 2 } is considered equal in both arrays + */ +declare function unionWith(arr1: readonly T[], arr2: readonly T[], areItemsEqual: (item1: T, item2: T) => boolean): T[]; +//#endregion +export { unionWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/unionWith.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/unionWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cdb8f2808b157cf78de7604c34d744f088d384fd --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/unionWith.d.ts @@ -0,0 +1,24 @@ +//#region src/array/unionWith.d.ts +/** + * Creates an array of unique values from two given arrays based on a custom equality function. + * + * This function takes two arrays and a custom equality function, merges the arrays, and returns + * a new array containing only the unique values as determined by the custom equality function. + * + * @template T - The type of elements in the array. + * @param {T[]} arr1 - The first array to merge and filter for unique values. + * @param {T[]} arr2 - The second array to merge and filter for unique values. + * @param {(item1: T, item2: T) => boolean} areItemsEqual - A custom function to determine if two elements are equal. + * It takes two arguments and returns `true` if the elements are considered equal, and `false` otherwise. + * @returns {T[]} A new array of unique values based on the custom equality function. + * + * @example + * const array1 = [{ id: 1 }, { id: 2 }]; + * const array2 = [{ id: 2 }, { id: 3 }]; + * const areItemsEqual = (a, b) => a.id === b.id; + * const result = unionWith(array1, array2, areItemsEqual); + * // result will be [{ id: 1 }, { id: 2 }, { id: 3 }] since { id: 2 } is considered equal in both arrays + */ +declare function unionWith(arr1: readonly T[], arr2: readonly T[], areItemsEqual: (item1: T, item2: T) => boolean): T[]; +//#endregion +export { unionWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/unionWith.js b/tools/ui/node_modules/es-toolkit/dist/array/unionWith.js new file mode 100644 index 0000000000000000000000000000000000000000..1f3dd5075b0ef6dbc959aabfa7956621c097f671 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/unionWith.js @@ -0,0 +1,27 @@ +const require_uniqWith = require("./uniqWith.js"); +//#region src/array/unionWith.ts +/** +* Creates an array of unique values from two given arrays based on a custom equality function. +* +* This function takes two arrays and a custom equality function, merges the arrays, and returns +* a new array containing only the unique values as determined by the custom equality function. +* +* @template T - The type of elements in the array. +* @param {T[]} arr1 - The first array to merge and filter for unique values. +* @param {T[]} arr2 - The second array to merge and filter for unique values. +* @param {(item1: T, item2: T) => boolean} areItemsEqual - A custom function to determine if two elements are equal. +* It takes two arguments and returns `true` if the elements are considered equal, and `false` otherwise. +* @returns {T[]} A new array of unique values based on the custom equality function. +* +* @example +* const array1 = [{ id: 1 }, { id: 2 }]; +* const array2 = [{ id: 2 }, { id: 3 }]; +* const areItemsEqual = (a, b) => a.id === b.id; +* const result = unionWith(array1, array2, areItemsEqual); +* // result will be [{ id: 1 }, { id: 2 }, { id: 3 }] since { id: 2 } is considered equal in both arrays +*/ +function unionWith(arr1, arr2, areItemsEqual) { + return require_uniqWith.uniqWith(arr1.concat(arr2), areItemsEqual); +} +//#endregion +exports.unionWith = unionWith; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/unionWith.mjs b/tools/ui/node_modules/es-toolkit/dist/array/unionWith.mjs new file mode 100644 index 0000000000000000000000000000000000000000..df25f53408b332f45d37f50bcc7bc38a392c22a1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/unionWith.mjs @@ -0,0 +1,27 @@ +import { uniqWith } from "./uniqWith.mjs"; +//#region src/array/unionWith.ts +/** +* Creates an array of unique values from two given arrays based on a custom equality function. +* +* This function takes two arrays and a custom equality function, merges the arrays, and returns +* a new array containing only the unique values as determined by the custom equality function. +* +* @template T - The type of elements in the array. +* @param {T[]} arr1 - The first array to merge and filter for unique values. +* @param {T[]} arr2 - The second array to merge and filter for unique values. +* @param {(item1: T, item2: T) => boolean} areItemsEqual - A custom function to determine if two elements are equal. +* It takes two arguments and returns `true` if the elements are considered equal, and `false` otherwise. +* @returns {T[]} A new array of unique values based on the custom equality function. +* +* @example +* const array1 = [{ id: 1 }, { id: 2 }]; +* const array2 = [{ id: 2 }, { id: 3 }]; +* const areItemsEqual = (a, b) => a.id === b.id; +* const result = unionWith(array1, array2, areItemsEqual); +* // result will be [{ id: 1 }, { id: 2 }, { id: 3 }] since { id: 2 } is considered equal in both arrays +*/ +function unionWith(arr1, arr2, areItemsEqual) { + return uniqWith(arr1.concat(arr2), areItemsEqual); +} +//#endregion +export { unionWith }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/uniq.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/uniq.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..5a3d4ad33345e489182fab6b02ac3c5cde705402 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/uniq.d.mts @@ -0,0 +1,19 @@ +//#region src/array/uniq.d.ts +/** + * Creates a duplicate-free version of an array. + * + * This function takes an array and returns a new array containing only the unique values + * from the original array, preserving the order of first occurrence. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to process. + * @returns {T[]} A new array with only unique values from the original array. + * + * @example + * const array = [1, 2, 2, 3, 4, 4, 5]; + * const result = uniq(array); + * // result will be [1, 2, 3, 4, 5] + */ +declare function uniq(arr: readonly T[]): T[]; +//#endregion +export { uniq }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/uniq.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/uniq.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5a3d4ad33345e489182fab6b02ac3c5cde705402 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/uniq.d.ts @@ -0,0 +1,19 @@ +//#region src/array/uniq.d.ts +/** + * Creates a duplicate-free version of an array. + * + * This function takes an array and returns a new array containing only the unique values + * from the original array, preserving the order of first occurrence. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to process. + * @returns {T[]} A new array with only unique values from the original array. + * + * @example + * const array = [1, 2, 2, 3, 4, 4, 5]; + * const result = uniq(array); + * // result will be [1, 2, 3, 4, 5] + */ +declare function uniq(arr: readonly T[]): T[]; +//#endregion +export { uniq }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/uniq.js b/tools/ui/node_modules/es-toolkit/dist/array/uniq.js new file mode 100644 index 0000000000000000000000000000000000000000..40f5f0852e1c25a61c5e65c935649f3ea5ab4021 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/uniq.js @@ -0,0 +1,21 @@ +//#region src/array/uniq.ts +/** +* Creates a duplicate-free version of an array. +* +* This function takes an array and returns a new array containing only the unique values +* from the original array, preserving the order of first occurrence. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array to process. +* @returns {T[]} A new array with only unique values from the original array. +* +* @example +* const array = [1, 2, 2, 3, 4, 4, 5]; +* const result = uniq(array); +* // result will be [1, 2, 3, 4, 5] +*/ +function uniq(arr) { + return [...new Set(arr)]; +} +//#endregion +exports.uniq = uniq; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/uniq.mjs b/tools/ui/node_modules/es-toolkit/dist/array/uniq.mjs new file mode 100644 index 0000000000000000000000000000000000000000..56ca725fda68a4d2ee7eb5556a79a8f35db9078a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/uniq.mjs @@ -0,0 +1,21 @@ +//#region src/array/uniq.ts +/** +* Creates a duplicate-free version of an array. +* +* This function takes an array and returns a new array containing only the unique values +* from the original array, preserving the order of first occurrence. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array to process. +* @returns {T[]} A new array with only unique values from the original array. +* +* @example +* const array = [1, 2, 2, 3, 4, 4, 5]; +* const result = uniq(array); +* // result will be [1, 2, 3, 4, 5] +*/ +function uniq(arr) { + return [...new Set(arr)]; +} +//#endregion +export { uniq }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/uniqBy.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/uniqBy.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..875ba0461342997aaea0ae7e69e0166c20c9b3f6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/uniqBy.d.mts @@ -0,0 +1,32 @@ +//#region src/array/uniqBy.d.ts +/** + * Returns a new array containing only the unique elements from the original array, + * based on the values returned by the mapper function. + * + * When duplicates are found, the first occurrence is kept and the rest are discarded. + * + * @template T - The type of elements in the array. + * @template U - The type of mapped elements. + * @param {T[]} arr - The array to process. + * @param {(item: T) => U} mapper - The function used to convert the array elements. + * @returns {T[]} A new array containing only the unique elements from the original array, based on the values returned by the mapper function. + * + * @example + * ```ts + * uniqBy([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], Math.floor); + * // [1.2, 2.1, 3.2, 5.7, 7.19] + * ``` + * + * @example + * const array = [ + * { category: 'fruit', name: 'apple' }, + * { category: 'fruit', name: 'banana' }, + * { category: 'vegetable', name: 'carrot' }, + * ]; + * uniqBy(array, item => item.category).length + * // 2 + * ``` + */ +declare function uniqBy(arr: readonly T[], mapper: (item: T, index: number, array: readonly T[]) => U): T[]; +//#endregion +export { uniqBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/uniqBy.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/uniqBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..875ba0461342997aaea0ae7e69e0166c20c9b3f6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/uniqBy.d.ts @@ -0,0 +1,32 @@ +//#region src/array/uniqBy.d.ts +/** + * Returns a new array containing only the unique elements from the original array, + * based on the values returned by the mapper function. + * + * When duplicates are found, the first occurrence is kept and the rest are discarded. + * + * @template T - The type of elements in the array. + * @template U - The type of mapped elements. + * @param {T[]} arr - The array to process. + * @param {(item: T) => U} mapper - The function used to convert the array elements. + * @returns {T[]} A new array containing only the unique elements from the original array, based on the values returned by the mapper function. + * + * @example + * ```ts + * uniqBy([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], Math.floor); + * // [1.2, 2.1, 3.2, 5.7, 7.19] + * ``` + * + * @example + * const array = [ + * { category: 'fruit', name: 'apple' }, + * { category: 'fruit', name: 'banana' }, + * { category: 'vegetable', name: 'carrot' }, + * ]; + * uniqBy(array, item => item.category).length + * // 2 + * ``` + */ +declare function uniqBy(arr: readonly T[], mapper: (item: T, index: number, array: readonly T[]) => U): T[]; +//#endregion +export { uniqBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/uniqBy.js b/tools/ui/node_modules/es-toolkit/dist/array/uniqBy.js new file mode 100644 index 0000000000000000000000000000000000000000..267b283aa2f5e83823d5f9bec733cd84bec6264f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/uniqBy.js @@ -0,0 +1,40 @@ +//#region src/array/uniqBy.ts +/** +* Returns a new array containing only the unique elements from the original array, +* based on the values returned by the mapper function. +* +* When duplicates are found, the first occurrence is kept and the rest are discarded. +* +* @template T - The type of elements in the array. +* @template U - The type of mapped elements. +* @param {T[]} arr - The array to process. +* @param {(item: T) => U} mapper - The function used to convert the array elements. +* @returns {T[]} A new array containing only the unique elements from the original array, based on the values returned by the mapper function. +* +* @example +* ```ts +* uniqBy([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], Math.floor); +* // [1.2, 2.1, 3.2, 5.7, 7.19] +* ``` +* +* @example +* const array = [ +* { category: 'fruit', name: 'apple' }, +* { category: 'fruit', name: 'banana' }, +* { category: 'vegetable', name: 'carrot' }, +* ]; +* uniqBy(array, item => item.category).length +* // 2 +* ``` +*/ +function uniqBy(arr, mapper) { + const map = /* @__PURE__ */ new Map(); + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + const key = mapper(item, i, arr); + if (!map.has(key)) map.set(key, item); + } + return Array.from(map.values()); +} +//#endregion +exports.uniqBy = uniqBy; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/uniqBy.mjs b/tools/ui/node_modules/es-toolkit/dist/array/uniqBy.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f8742826a82e01cf62914ef704857f5f02e61420 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/uniqBy.mjs @@ -0,0 +1,40 @@ +//#region src/array/uniqBy.ts +/** +* Returns a new array containing only the unique elements from the original array, +* based on the values returned by the mapper function. +* +* When duplicates are found, the first occurrence is kept and the rest are discarded. +* +* @template T - The type of elements in the array. +* @template U - The type of mapped elements. +* @param {T[]} arr - The array to process. +* @param {(item: T) => U} mapper - The function used to convert the array elements. +* @returns {T[]} A new array containing only the unique elements from the original array, based on the values returned by the mapper function. +* +* @example +* ```ts +* uniqBy([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], Math.floor); +* // [1.2, 2.1, 3.2, 5.7, 7.19] +* ``` +* +* @example +* const array = [ +* { category: 'fruit', name: 'apple' }, +* { category: 'fruit', name: 'banana' }, +* { category: 'vegetable', name: 'carrot' }, +* ]; +* uniqBy(array, item => item.category).length +* // 2 +* ``` +*/ +function uniqBy(arr, mapper) { + const map = /* @__PURE__ */ new Map(); + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + const key = mapper(item, i, arr); + if (!map.has(key)) map.set(key, item); + } + return Array.from(map.values()); +} +//#endregion +export { uniqBy }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/uniqWith.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/uniqWith.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..50fe04c481803202a83e7c7152d110da7973b867 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/uniqWith.d.mts @@ -0,0 +1,19 @@ +//#region src/array/uniqWith.d.ts +/** + * Returns a new array containing only the unique elements from the original array, + * based on the values returned by the comparator function. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to process. + * @param {(item1: T, item2: T) => boolean} areItemsEqual - The function used to compare the array elements. + * @returns {T[]} A new array containing only the unique elements from the original array, based on the values returned by the comparator function. + * + * @example + * ```ts + * uniqWith([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], (a, b) => Math.abs(a - b) < 1); + * // [1.2, 3.2, 5.7, 7.19] + * ``` + */ +declare function uniqWith(arr: readonly T[], areItemsEqual: (item1: T, item2: T) => boolean): T[]; +//#endregion +export { uniqWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/uniqWith.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/uniqWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..50fe04c481803202a83e7c7152d110da7973b867 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/uniqWith.d.ts @@ -0,0 +1,19 @@ +//#region src/array/uniqWith.d.ts +/** + * Returns a new array containing only the unique elements from the original array, + * based on the values returned by the comparator function. + * + * @template T - The type of elements in the array. + * @param {T[]} arr - The array to process. + * @param {(item1: T, item2: T) => boolean} areItemsEqual - The function used to compare the array elements. + * @returns {T[]} A new array containing only the unique elements from the original array, based on the values returned by the comparator function. + * + * @example + * ```ts + * uniqWith([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], (a, b) => Math.abs(a - b) < 1); + * // [1.2, 3.2, 5.7, 7.19] + * ``` + */ +declare function uniqWith(arr: readonly T[], areItemsEqual: (item1: T, item2: T) => boolean): T[]; +//#endregion +export { uniqWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/uniqWith.js b/tools/ui/node_modules/es-toolkit/dist/array/uniqWith.js new file mode 100644 index 0000000000000000000000000000000000000000..bb15b72d8a3be396f9d4e350981022c4c1bef245 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/uniqWith.js @@ -0,0 +1,26 @@ +//#region src/array/uniqWith.ts +/** +* Returns a new array containing only the unique elements from the original array, +* based on the values returned by the comparator function. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array to process. +* @param {(item1: T, item2: T) => boolean} areItemsEqual - The function used to compare the array elements. +* @returns {T[]} A new array containing only the unique elements from the original array, based on the values returned by the comparator function. +* +* @example +* ```ts +* uniqWith([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], (a, b) => Math.abs(a - b) < 1); +* // [1.2, 3.2, 5.7, 7.19] +* ``` +*/ +function uniqWith(arr, areItemsEqual) { + const result = []; + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + if (result.every((v) => !areItemsEqual(v, item))) result.push(item); + } + return result; +} +//#endregion +exports.uniqWith = uniqWith; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/uniqWith.mjs b/tools/ui/node_modules/es-toolkit/dist/array/uniqWith.mjs new file mode 100644 index 0000000000000000000000000000000000000000..e0f0783b3e5f2d2432c27edecd2afd95d0c043ec --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/uniqWith.mjs @@ -0,0 +1,26 @@ +//#region src/array/uniqWith.ts +/** +* Returns a new array containing only the unique elements from the original array, +* based on the values returned by the comparator function. +* +* @template T - The type of elements in the array. +* @param {T[]} arr - The array to process. +* @param {(item1: T, item2: T) => boolean} areItemsEqual - The function used to compare the array elements. +* @returns {T[]} A new array containing only the unique elements from the original array, based on the values returned by the comparator function. +* +* @example +* ```ts +* uniqWith([1.2, 1.5, 2.1, 3.2, 5.7, 5.3, 7.19], (a, b) => Math.abs(a - b) < 1); +* // [1.2, 3.2, 5.7, 7.19] +* ``` +*/ +function uniqWith(arr, areItemsEqual) { + const result = []; + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + if (result.every((v) => !areItemsEqual(v, item))) result.push(item); + } + return result; +} +//#endregion +export { uniqWith }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/unzip.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/unzip.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..6e4758e05671f02db45a68f10448d38fb1fdfa6c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/unzip.d.mts @@ -0,0 +1,18 @@ +//#region src/array/unzip.d.ts +/** + * Gathers elements in the same position in an internal array + * from a grouped array of elements and returns them as a new array. + * + * @template T - The type of elements in the nested array. + * @param {Array<[...T]>} zipped - The nested array to unzip. + * @returns {Unzip} A new array of unzipped elements. + * + * @example + * const zipped = [['a', true, 1],['b', false, 2]]; + * const result = unzip(zipped); + * // result will be [['a', 'b'], [true, false], [1, 2]] + */ +declare function unzip(zipped: ReadonlyArray<[...T]>): Unzip; +type Unzip = { [I in keyof K]: Array }; +//#endregion +export { unzip }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/unzip.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/unzip.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6e4758e05671f02db45a68f10448d38fb1fdfa6c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/unzip.d.ts @@ -0,0 +1,18 @@ +//#region src/array/unzip.d.ts +/** + * Gathers elements in the same position in an internal array + * from a grouped array of elements and returns them as a new array. + * + * @template T - The type of elements in the nested array. + * @param {Array<[...T]>} zipped - The nested array to unzip. + * @returns {Unzip} A new array of unzipped elements. + * + * @example + * const zipped = [['a', true, 1],['b', false, 2]]; + * const result = unzip(zipped); + * // result will be [['a', 'b'], [true, false], [1, 2]] + */ +declare function unzip(zipped: ReadonlyArray<[...T]>): Unzip; +type Unzip = { [I in keyof K]: Array }; +//#endregion +export { unzip }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/unzip.js b/tools/ui/node_modules/es-toolkit/dist/array/unzip.js new file mode 100644 index 0000000000000000000000000000000000000000..1e56d4162594ba1a4019054c79994fc746d6590e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/unzip.js @@ -0,0 +1,26 @@ +//#region src/array/unzip.ts +/** +* Gathers elements in the same position in an internal array +* from a grouped array of elements and returns them as a new array. +* +* @template T - The type of elements in the nested array. +* @param {Array<[...T]>} zipped - The nested array to unzip. +* @returns {Unzip} A new array of unzipped elements. +* +* @example +* const zipped = [['a', true, 1],['b', false, 2]]; +* const result = unzip(zipped); +* // result will be [['a', 'b'], [true, false], [1, 2]] +*/ +function unzip(zipped) { + let maxLen = 0; + for (let i = 0; i < zipped.length; i++) if (zipped[i].length > maxLen) maxLen = zipped[i].length; + const result = new Array(maxLen); + for (let i = 0; i < maxLen; i++) { + result[i] = new Array(zipped.length); + for (let j = 0; j < zipped.length; j++) result[i][j] = zipped[j][i]; + } + return result; +} +//#endregion +exports.unzip = unzip; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/unzip.mjs b/tools/ui/node_modules/es-toolkit/dist/array/unzip.mjs new file mode 100644 index 0000000000000000000000000000000000000000..c6d9157bc0fa069fc1bc15b8a7a706fdee95f947 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/unzip.mjs @@ -0,0 +1,26 @@ +//#region src/array/unzip.ts +/** +* Gathers elements in the same position in an internal array +* from a grouped array of elements and returns them as a new array. +* +* @template T - The type of elements in the nested array. +* @param {Array<[...T]>} zipped - The nested array to unzip. +* @returns {Unzip} A new array of unzipped elements. +* +* @example +* const zipped = [['a', true, 1],['b', false, 2]]; +* const result = unzip(zipped); +* // result will be [['a', 'b'], [true, false], [1, 2]] +*/ +function unzip(zipped) { + let maxLen = 0; + for (let i = 0; i < zipped.length; i++) if (zipped[i].length > maxLen) maxLen = zipped[i].length; + const result = new Array(maxLen); + for (let i = 0; i < maxLen; i++) { + result[i] = new Array(zipped.length); + for (let j = 0; j < zipped.length; j++) result[i][j] = zipped[j][i]; + } + return result; +} +//#endregion +export { unzip }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/unzipWith.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/unzipWith.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..f8d4f28f328ea68083a473123162582e071a2dff --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/unzipWith.d.mts @@ -0,0 +1,18 @@ +//#region src/array/unzipWith.d.ts +/** + * Unzips an array of arrays, applying an `iteratee` function to regrouped elements. + * + * @template T, R + * @param {T[][]} target - The nested array to unzip. This is an array of arrays, + * where each inner array contains elements to be unzipped. + * @param {(...args: T[]) => R} iteratee - A function to transform the unzipped elements. + * @returns {R[]} A new array of unzipped and transformed elements. + * + * @example + * const nestedArray = [[1, 2], [3, 4], [5, 6]]; + * const result = unzipWith(nestedArray, (item, item2, item3) => item + item2 + item3); + * // result will be [9, 12] + */ +declare function unzipWith(target: readonly T[][], iteratee: (...args: T[]) => R): R[]; +//#endregion +export { unzipWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/unzipWith.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/unzipWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f8d4f28f328ea68083a473123162582e071a2dff --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/unzipWith.d.ts @@ -0,0 +1,18 @@ +//#region src/array/unzipWith.d.ts +/** + * Unzips an array of arrays, applying an `iteratee` function to regrouped elements. + * + * @template T, R + * @param {T[][]} target - The nested array to unzip. This is an array of arrays, + * where each inner array contains elements to be unzipped. + * @param {(...args: T[]) => R} iteratee - A function to transform the unzipped elements. + * @returns {R[]} A new array of unzipped and transformed elements. + * + * @example + * const nestedArray = [[1, 2], [3, 4], [5, 6]]; + * const result = unzipWith(nestedArray, (item, item2, item3) => item + item2 + item3); + * // result will be [9, 12] + */ +declare function unzipWith(target: readonly T[][], iteratee: (...args: T[]) => R): R[]; +//#endregion +export { unzipWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/unzipWith.js b/tools/ui/node_modules/es-toolkit/dist/array/unzipWith.js new file mode 100644 index 0000000000000000000000000000000000000000..fd54580796424bbc8990bf3e12546db90d66c577 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/unzipWith.js @@ -0,0 +1,27 @@ +//#region src/array/unzipWith.ts +/** +* Unzips an array of arrays, applying an `iteratee` function to regrouped elements. +* +* @template T, R +* @param {T[][]} target - The nested array to unzip. This is an array of arrays, +* where each inner array contains elements to be unzipped. +* @param {(...args: T[]) => R} iteratee - A function to transform the unzipped elements. +* @returns {R[]} A new array of unzipped and transformed elements. +* +* @example +* const nestedArray = [[1, 2], [3, 4], [5, 6]]; +* const result = unzipWith(nestedArray, (item, item2, item3) => item + item2 + item3); +* // result will be [9, 12] +*/ +function unzipWith(target, iteratee) { + const maxLength = Math.max(...target.map((innerArray) => innerArray.length)); + const result = new Array(maxLength); + for (let i = 0; i < maxLength; i++) { + const group = new Array(target.length); + for (let j = 0; j < target.length; j++) group[j] = target[j][i]; + result[i] = iteratee(...group); + } + return result; +} +//#endregion +exports.unzipWith = unzipWith; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/unzipWith.mjs b/tools/ui/node_modules/es-toolkit/dist/array/unzipWith.mjs new file mode 100644 index 0000000000000000000000000000000000000000..e5e1e023ab5c779ea95925dcea89425c3911cfb6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/unzipWith.mjs @@ -0,0 +1,27 @@ +//#region src/array/unzipWith.ts +/** +* Unzips an array of arrays, applying an `iteratee` function to regrouped elements. +* +* @template T, R +* @param {T[][]} target - The nested array to unzip. This is an array of arrays, +* where each inner array contains elements to be unzipped. +* @param {(...args: T[]) => R} iteratee - A function to transform the unzipped elements. +* @returns {R[]} A new array of unzipped and transformed elements. +* +* @example +* const nestedArray = [[1, 2], [3, 4], [5, 6]]; +* const result = unzipWith(nestedArray, (item, item2, item3) => item + item2 + item3); +* // result will be [9, 12] +*/ +function unzipWith(target, iteratee) { + const maxLength = Math.max(...target.map((innerArray) => innerArray.length)); + const result = new Array(maxLength); + for (let i = 0; i < maxLength; i++) { + const group = new Array(target.length); + for (let j = 0; j < target.length; j++) group[j] = target[j][i]; + result[i] = iteratee(...group); + } + return result; +} +//#endregion +export { unzipWith }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/windowed.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/windowed.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..362bcd2a50f22702a9c999105bec34f09afc9aea --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/windowed.d.mts @@ -0,0 +1,53 @@ +//#region src/array/windowed.d.ts +/** + * Options for the windowed function. + * + * @interface WindowedOptions + * @property {boolean} [partialWindows=false] - Whether to include partial windows at the end of the array. + */ +interface WindowedOptions { + /** + * Whether to include partial windows at the end of the array. + * + * By default, `windowed` only includes full windows in the result, + * ignoring any leftover elements that can't form a full window. + * + * If `partialWindows` is true, the function will also include these smaller, partial windows at the end of the result. + */ + partialWindows?: boolean; +} +/** + * Creates an array of sub-arrays (windows) from the input array, each of the specified size. + * The windows can overlap depending on the step size provided. + * + * By default, only full windows are included in the result, and any leftover elements that can't form a full window are ignored. + * + * If the `partialWindows` option is set to true in the options object, the function will also include partial windows at the end of the result. + * Partial windows are smaller sub-arrays created when there aren't enough elements left in the input array to form a full window. + * + * @template T + * @param {readonly T[]} arr - The input array to create windows from. + * @param {number} size - The size of each window. Must be a positive integer. + * @param {number} [step=1] - The step size between the start of each window. Must be a positive integer. + * @param {WindowedOptions} [options={}] - Options object to configure the behavior of the function. + * @param {boolean} [options.partialWindows=false] - Whether to include partial windows at the end of the array. + * @returns {T[][]} An array of windows (sub-arrays) created from the input array. + * @throws {Error} If the size or step is not a positive integer. + * + * @example + * windowed([1, 2, 3, 4], 2); + * // => [[1, 2], [2, 3], [3, 4]] + * + * @example + * windowed([1, 2, 3, 4, 5, 6], 3, 2); + * // => [[1, 2, 3], [3, 4, 5]] + * + * @example + * windowed([1, 2, 3, 4, 5, 6], 3, 2, { partialWindows: true }); + * // => [[1, 2, 3], [3, 4, 5], [5, 6]] + */ +declare function windowed(arr: readonly T[], size: number, step?: number, { + partialWindows +}?: WindowedOptions): T[][]; +//#endregion +export { windowed }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/windowed.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/windowed.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..362bcd2a50f22702a9c999105bec34f09afc9aea --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/windowed.d.ts @@ -0,0 +1,53 @@ +//#region src/array/windowed.d.ts +/** + * Options for the windowed function. + * + * @interface WindowedOptions + * @property {boolean} [partialWindows=false] - Whether to include partial windows at the end of the array. + */ +interface WindowedOptions { + /** + * Whether to include partial windows at the end of the array. + * + * By default, `windowed` only includes full windows in the result, + * ignoring any leftover elements that can't form a full window. + * + * If `partialWindows` is true, the function will also include these smaller, partial windows at the end of the result. + */ + partialWindows?: boolean; +} +/** + * Creates an array of sub-arrays (windows) from the input array, each of the specified size. + * The windows can overlap depending on the step size provided. + * + * By default, only full windows are included in the result, and any leftover elements that can't form a full window are ignored. + * + * If the `partialWindows` option is set to true in the options object, the function will also include partial windows at the end of the result. + * Partial windows are smaller sub-arrays created when there aren't enough elements left in the input array to form a full window. + * + * @template T + * @param {readonly T[]} arr - The input array to create windows from. + * @param {number} size - The size of each window. Must be a positive integer. + * @param {number} [step=1] - The step size between the start of each window. Must be a positive integer. + * @param {WindowedOptions} [options={}] - Options object to configure the behavior of the function. + * @param {boolean} [options.partialWindows=false] - Whether to include partial windows at the end of the array. + * @returns {T[][]} An array of windows (sub-arrays) created from the input array. + * @throws {Error} If the size or step is not a positive integer. + * + * @example + * windowed([1, 2, 3, 4], 2); + * // => [[1, 2], [2, 3], [3, 4]] + * + * @example + * windowed([1, 2, 3, 4, 5, 6], 3, 2); + * // => [[1, 2, 3], [3, 4, 5]] + * + * @example + * windowed([1, 2, 3, 4, 5, 6], 3, 2, { partialWindows: true }); + * // => [[1, 2, 3], [3, 4, 5], [5, 6]] + */ +declare function windowed(arr: readonly T[], size: number, step?: number, { + partialWindows +}?: WindowedOptions): T[][]; +//#endregion +export { windowed }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/windowed.js b/tools/ui/node_modules/es-toolkit/dist/array/windowed.js new file mode 100644 index 0000000000000000000000000000000000000000..af17197caa9b6e93db02f1432a4af39f01485e5a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/windowed.js @@ -0,0 +1,41 @@ +//#region src/array/windowed.ts +/** +* Creates an array of sub-arrays (windows) from the input array, each of the specified size. +* The windows can overlap depending on the step size provided. +* +* By default, only full windows are included in the result, and any leftover elements that can't form a full window are ignored. +* +* If the `partialWindows` option is set to true in the options object, the function will also include partial windows at the end of the result. +* Partial windows are smaller sub-arrays created when there aren't enough elements left in the input array to form a full window. +* +* @template T +* @param {readonly T[]} arr - The input array to create windows from. +* @param {number} size - The size of each window. Must be a positive integer. +* @param {number} [step=1] - The step size between the start of each window. Must be a positive integer. +* @param {WindowedOptions} [options={}] - Options object to configure the behavior of the function. +* @param {boolean} [options.partialWindows=false] - Whether to include partial windows at the end of the array. +* @returns {T[][]} An array of windows (sub-arrays) created from the input array. +* @throws {Error} If the size or step is not a positive integer. +* +* @example +* windowed([1, 2, 3, 4], 2); +* // => [[1, 2], [2, 3], [3, 4]] +* +* @example +* windowed([1, 2, 3, 4, 5, 6], 3, 2); +* // => [[1, 2, 3], [3, 4, 5]] +* +* @example +* windowed([1, 2, 3, 4, 5, 6], 3, 2, { partialWindows: true }); +* // => [[1, 2, 3], [3, 4, 5], [5, 6]] +*/ +function windowed(arr, size, step = 1, { partialWindows = false } = {}) { + if (size <= 0 || !Number.isInteger(size)) throw new Error("Size must be a positive integer."); + if (step <= 0 || !Number.isInteger(step)) throw new Error("Step must be a positive integer."); + const result = []; + const end = partialWindows ? arr.length : arr.length - size + 1; + for (let i = 0; i < end; i += step) result.push(arr.slice(i, i + size)); + return result; +} +//#endregion +exports.windowed = windowed; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/windowed.mjs b/tools/ui/node_modules/es-toolkit/dist/array/windowed.mjs new file mode 100644 index 0000000000000000000000000000000000000000..5db42aa354a7725923f5ca131bfd0fe1d88de93d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/windowed.mjs @@ -0,0 +1,41 @@ +//#region src/array/windowed.ts +/** +* Creates an array of sub-arrays (windows) from the input array, each of the specified size. +* The windows can overlap depending on the step size provided. +* +* By default, only full windows are included in the result, and any leftover elements that can't form a full window are ignored. +* +* If the `partialWindows` option is set to true in the options object, the function will also include partial windows at the end of the result. +* Partial windows are smaller sub-arrays created when there aren't enough elements left in the input array to form a full window. +* +* @template T +* @param {readonly T[]} arr - The input array to create windows from. +* @param {number} size - The size of each window. Must be a positive integer. +* @param {number} [step=1] - The step size between the start of each window. Must be a positive integer. +* @param {WindowedOptions} [options={}] - Options object to configure the behavior of the function. +* @param {boolean} [options.partialWindows=false] - Whether to include partial windows at the end of the array. +* @returns {T[][]} An array of windows (sub-arrays) created from the input array. +* @throws {Error} If the size or step is not a positive integer. +* +* @example +* windowed([1, 2, 3, 4], 2); +* // => [[1, 2], [2, 3], [3, 4]] +* +* @example +* windowed([1, 2, 3, 4, 5, 6], 3, 2); +* // => [[1, 2, 3], [3, 4, 5]] +* +* @example +* windowed([1, 2, 3, 4, 5, 6], 3, 2, { partialWindows: true }); +* // => [[1, 2, 3], [3, 4, 5], [5, 6]] +*/ +function windowed(arr, size, step = 1, { partialWindows = false } = {}) { + if (size <= 0 || !Number.isInteger(size)) throw new Error("Size must be a positive integer."); + if (step <= 0 || !Number.isInteger(step)) throw new Error("Step must be a positive integer."); + const result = []; + const end = partialWindows ? arr.length : arr.length - size + 1; + for (let i = 0; i < end; i += step) result.push(arr.slice(i, i + size)); + return result; +} +//#endregion +export { windowed }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/without.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/without.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..22d92027c31e3fc4902f1be3e2ab1f2a247fae19 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/without.d.mts @@ -0,0 +1,24 @@ +//#region src/array/without.d.ts +/** + * Creates an array that excludes all specified values. + * + * It correctly excludes `NaN`, as it compares values using [SameValueZero](https://tc39.es/ecma262/multipage/abstract-operations.html#sec-samevaluezero). + * + * @template T The type of elements in the array. + * @param {T[]} array - The array to filter. + * @param {...T[]} values - The values to exclude. + * @returns {T[]} A new array without the specified values. + * + * @example + * // Removes the specified values from the array + * without([1, 2, 3, 4, 5], 2, 4); + * // Returns: [1, 3, 5] + * + * @example + * // Removes specified string values from the array + * without(['a', 'b', 'c', 'a'], 'a'); + * // Returns: ['b', 'c'] + */ +declare function without(array: readonly T[], ...values: T[]): T[]; +//#endregion +export { without }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/without.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/without.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..22d92027c31e3fc4902f1be3e2ab1f2a247fae19 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/without.d.ts @@ -0,0 +1,24 @@ +//#region src/array/without.d.ts +/** + * Creates an array that excludes all specified values. + * + * It correctly excludes `NaN`, as it compares values using [SameValueZero](https://tc39.es/ecma262/multipage/abstract-operations.html#sec-samevaluezero). + * + * @template T The type of elements in the array. + * @param {T[]} array - The array to filter. + * @param {...T[]} values - The values to exclude. + * @returns {T[]} A new array without the specified values. + * + * @example + * // Removes the specified values from the array + * without([1, 2, 3, 4, 5], 2, 4); + * // Returns: [1, 3, 5] + * + * @example + * // Removes specified string values from the array + * without(['a', 'b', 'c', 'a'], 'a'); + * // Returns: ['b', 'c'] + */ +declare function without(array: readonly T[], ...values: T[]): T[]; +//#endregion +export { without }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/without.js b/tools/ui/node_modules/es-toolkit/dist/array/without.js new file mode 100644 index 0000000000000000000000000000000000000000..2c0ac62f4aeaa72da7d44716eafdca6c9d39f768 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/without.js @@ -0,0 +1,27 @@ +const require_difference = require("./difference.js"); +//#region src/array/without.ts +/** +* Creates an array that excludes all specified values. +* +* It correctly excludes `NaN`, as it compares values using [SameValueZero](https://tc39.es/ecma262/multipage/abstract-operations.html#sec-samevaluezero). +* +* @template T The type of elements in the array. +* @param {T[]} array - The array to filter. +* @param {...T[]} values - The values to exclude. +* @returns {T[]} A new array without the specified values. +* +* @example +* // Removes the specified values from the array +* without([1, 2, 3, 4, 5], 2, 4); +* // Returns: [1, 3, 5] +* +* @example +* // Removes specified string values from the array +* without(['a', 'b', 'c', 'a'], 'a'); +* // Returns: ['b', 'c'] +*/ +function without(array, ...values) { + return require_difference.difference(array, values); +} +//#endregion +exports.without = without; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/without.mjs b/tools/ui/node_modules/es-toolkit/dist/array/without.mjs new file mode 100644 index 0000000000000000000000000000000000000000..8fc55088cb3b7e578d6af3a0d5222b27d71b3802 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/without.mjs @@ -0,0 +1,27 @@ +import { difference } from "./difference.mjs"; +//#region src/array/without.ts +/** +* Creates an array that excludes all specified values. +* +* It correctly excludes `NaN`, as it compares values using [SameValueZero](https://tc39.es/ecma262/multipage/abstract-operations.html#sec-samevaluezero). +* +* @template T The type of elements in the array. +* @param {T[]} array - The array to filter. +* @param {...T[]} values - The values to exclude. +* @returns {T[]} A new array without the specified values. +* +* @example +* // Removes the specified values from the array +* without([1, 2, 3, 4, 5], 2, 4); +* // Returns: [1, 3, 5] +* +* @example +* // Removes specified string values from the array +* without(['a', 'b', 'c', 'a'], 'a'); +* // Returns: ['b', 'c'] +*/ +function without(array, ...values) { + return difference(array, values); +} +//#endregion +export { without }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/xor.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/xor.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..075e1b61e857ab351810bc3641cfa888f8b35e7b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/xor.d.mts @@ -0,0 +1,21 @@ +//#region src/array/xor.d.ts +/** + * Computes the symmetric difference between two arrays. The symmetric difference is the set of elements + * which are in either of the arrays, but not in their intersection. + * + * @template T - The type of elements in the array. + * @param {T[]} arr1 - The first array. + * @param {T[]} arr2 - The second array. + * @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both. + * + * @example + * // Returns [1, 2, 5, 6] + * xor([1, 2, 3, 4], [3, 4, 5, 6]); + * + * @example + * // Returns ['a', 'c'] + * xor(['a', 'b'], ['b', 'c']); + */ +declare function xor(arr1: readonly T[], arr2: readonly T[]): T[]; +//#endregion +export { xor }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/xor.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/xor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..075e1b61e857ab351810bc3641cfa888f8b35e7b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/xor.d.ts @@ -0,0 +1,21 @@ +//#region src/array/xor.d.ts +/** + * Computes the symmetric difference between two arrays. The symmetric difference is the set of elements + * which are in either of the arrays, but not in their intersection. + * + * @template T - The type of elements in the array. + * @param {T[]} arr1 - The first array. + * @param {T[]} arr2 - The second array. + * @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both. + * + * @example + * // Returns [1, 2, 5, 6] + * xor([1, 2, 3, 4], [3, 4, 5, 6]); + * + * @example + * // Returns ['a', 'c'] + * xor(['a', 'b'], ['b', 'c']); + */ +declare function xor(arr1: readonly T[], arr2: readonly T[]): T[]; +//#endregion +export { xor }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/xor.js b/tools/ui/node_modules/es-toolkit/dist/array/xor.js new file mode 100644 index 0000000000000000000000000000000000000000..6041ce891ec809167b6d827571692a1ecf913754 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/xor.js @@ -0,0 +1,26 @@ +const require_difference = require("./difference.js"); +const require_intersection = require("./intersection.js"); +const require_union = require("./union.js"); +//#region src/array/xor.ts +/** +* Computes the symmetric difference between two arrays. The symmetric difference is the set of elements +* which are in either of the arrays, but not in their intersection. +* +* @template T - The type of elements in the array. +* @param {T[]} arr1 - The first array. +* @param {T[]} arr2 - The second array. +* @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both. +* +* @example +* // Returns [1, 2, 5, 6] +* xor([1, 2, 3, 4], [3, 4, 5, 6]); +* +* @example +* // Returns ['a', 'c'] +* xor(['a', 'b'], ['b', 'c']); +*/ +function xor(arr1, arr2) { + return require_difference.difference(require_union.union(arr1, arr2), require_intersection.intersection(arr1, arr2)); +} +//#endregion +exports.xor = xor; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/xor.mjs b/tools/ui/node_modules/es-toolkit/dist/array/xor.mjs new file mode 100644 index 0000000000000000000000000000000000000000..e9ac8330b59f31639a5e25540ee5feafd085beef --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/xor.mjs @@ -0,0 +1,26 @@ +import { difference } from "./difference.mjs"; +import { intersection } from "./intersection.mjs"; +import { union } from "./union.mjs"; +//#region src/array/xor.ts +/** +* Computes the symmetric difference between two arrays. The symmetric difference is the set of elements +* which are in either of the arrays, but not in their intersection. +* +* @template T - The type of elements in the array. +* @param {T[]} arr1 - The first array. +* @param {T[]} arr2 - The second array. +* @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both. +* +* @example +* // Returns [1, 2, 5, 6] +* xor([1, 2, 3, 4], [3, 4, 5, 6]); +* +* @example +* // Returns ['a', 'c'] +* xor(['a', 'b'], ['b', 'c']); +*/ +function xor(arr1, arr2) { + return difference(union(arr1, arr2), intersection(arr1, arr2)); +} +//#endregion +export { xor }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/xorBy.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/xorBy.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..abdde2000a998daacf74ccc7a3ff39a6fbe1985f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/xorBy.d.mts @@ -0,0 +1,23 @@ +//#region src/array/xorBy.d.ts +/** + * Computes the symmetric difference between two arrays using a custom mapping function. + * The symmetric difference is the set of elements which are in either of the arrays, + * but not in their intersection, determined by the result of the mapping function. + * + * @template T - Type of elements in the input arrays. + * @template U - Type of the values returned by the mapping function. + * + * @param {T[]} arr1 - The first array. + * @param {T[]} arr2 - The second array. + * @param {(item: T) => U} mapper - The function to map array elements to comparison values. + * @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both, based on the values returned by the mapping function. + * + * @example + * // Custom mapping function for objects with an 'id' property + * const idMapper = obj => obj.id; + * xorBy([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper); + * // Returns [{ id: 1 }, { id: 3 }] + */ +declare function xorBy(arr1: readonly T[], arr2: readonly T[], mapper: (item: T) => U): T[]; +//#endregion +export { xorBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/xorBy.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/xorBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..abdde2000a998daacf74ccc7a3ff39a6fbe1985f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/xorBy.d.ts @@ -0,0 +1,23 @@ +//#region src/array/xorBy.d.ts +/** + * Computes the symmetric difference between two arrays using a custom mapping function. + * The symmetric difference is the set of elements which are in either of the arrays, + * but not in their intersection, determined by the result of the mapping function. + * + * @template T - Type of elements in the input arrays. + * @template U - Type of the values returned by the mapping function. + * + * @param {T[]} arr1 - The first array. + * @param {T[]} arr2 - The second array. + * @param {(item: T) => U} mapper - The function to map array elements to comparison values. + * @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both, based on the values returned by the mapping function. + * + * @example + * // Custom mapping function for objects with an 'id' property + * const idMapper = obj => obj.id; + * xorBy([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper); + * // Returns [{ id: 1 }, { id: 3 }] + */ +declare function xorBy(arr1: readonly T[], arr2: readonly T[], mapper: (item: T) => U): T[]; +//#endregion +export { xorBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/xorBy.js b/tools/ui/node_modules/es-toolkit/dist/array/xorBy.js new file mode 100644 index 0000000000000000000000000000000000000000..e63017152976d354e7cf0066650f377cd1b21d0a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/xorBy.js @@ -0,0 +1,30 @@ +const require_differenceBy = require("./differenceBy.js"); +const require_intersectionBy = require("./intersectionBy.js"); +const require_unionBy = require("./unionBy.js"); +//#region src/array/xorBy.ts +/** +* Computes the symmetric difference between two arrays using a custom mapping function. +* The symmetric difference is the set of elements which are in either of the arrays, +* but not in their intersection, determined by the result of the mapping function. +* +* @template T - Type of elements in the input arrays. +* @template U - Type of the values returned by the mapping function. +* +* @param {T[]} arr1 - The first array. +* @param {T[]} arr2 - The second array. +* @param {(item: T) => U} mapper - The function to map array elements to comparison values. +* @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both, based on the values returned by the mapping function. +* +* @example +* // Custom mapping function for objects with an 'id' property +* const idMapper = obj => obj.id; +* xorBy([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper); +* // Returns [{ id: 1 }, { id: 3 }] +*/ +function xorBy(arr1, arr2, mapper) { + const union = require_unionBy.unionBy(arr1, arr2, mapper); + const intersection = require_intersectionBy.intersectionBy(arr1, arr2, mapper); + return require_differenceBy.differenceBy(union, intersection, mapper); +} +//#endregion +exports.xorBy = xorBy; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/xorBy.mjs b/tools/ui/node_modules/es-toolkit/dist/array/xorBy.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f58bdb2f39db79f32b720403a6ffb4bec2b887f7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/xorBy.mjs @@ -0,0 +1,28 @@ +import { differenceBy } from "./differenceBy.mjs"; +import { intersectionBy } from "./intersectionBy.mjs"; +import { unionBy } from "./unionBy.mjs"; +//#region src/array/xorBy.ts +/** +* Computes the symmetric difference between two arrays using a custom mapping function. +* The symmetric difference is the set of elements which are in either of the arrays, +* but not in their intersection, determined by the result of the mapping function. +* +* @template T - Type of elements in the input arrays. +* @template U - Type of the values returned by the mapping function. +* +* @param {T[]} arr1 - The first array. +* @param {T[]} arr2 - The second array. +* @param {(item: T) => U} mapper - The function to map array elements to comparison values. +* @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both, based on the values returned by the mapping function. +* +* @example +* // Custom mapping function for objects with an 'id' property +* const idMapper = obj => obj.id; +* xorBy([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], idMapper); +* // Returns [{ id: 1 }, { id: 3 }] +*/ +function xorBy(arr1, arr2, mapper) { + return differenceBy(unionBy(arr1, arr2, mapper), intersectionBy(arr1, arr2, mapper), mapper); +} +//#endregion +export { xorBy }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/xorWith.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/xorWith.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..f6416608209b0704df817013204e238b35f40822 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/xorWith.d.mts @@ -0,0 +1,22 @@ +//#region src/array/xorWith.d.ts +/** + * Computes the symmetric difference between two arrays using a custom equality function. + * The symmetric difference is the set of elements which are in either of the arrays, + * but not in their intersection. + * + * @template T - Type of elements in the input arrays. + * + * @param {T[]} arr1 - The first array. + * @param {T[]} arr2 - The second array. + * @param {(item1: T, item2: T) => boolean} areElementsEqual - The custom equality function to compare elements. + * @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both, based on the custom equality function. + * + * @example + * // Custom equality function for objects with an 'id' property + * const areObjectsEqual = (a, b) => a.id === b.id; + * xorWith([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], areObjectsEqual); + * // Returns [{ id: 1 }, { id: 3 }] + */ +declare function xorWith(arr1: readonly T[], arr2: readonly T[], areElementsEqual: (item1: T, item2: T) => boolean): T[]; +//#endregion +export { xorWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/xorWith.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/xorWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f6416608209b0704df817013204e238b35f40822 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/xorWith.d.ts @@ -0,0 +1,22 @@ +//#region src/array/xorWith.d.ts +/** + * Computes the symmetric difference between two arrays using a custom equality function. + * The symmetric difference is the set of elements which are in either of the arrays, + * but not in their intersection. + * + * @template T - Type of elements in the input arrays. + * + * @param {T[]} arr1 - The first array. + * @param {T[]} arr2 - The second array. + * @param {(item1: T, item2: T) => boolean} areElementsEqual - The custom equality function to compare elements. + * @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both, based on the custom equality function. + * + * @example + * // Custom equality function for objects with an 'id' property + * const areObjectsEqual = (a, b) => a.id === b.id; + * xorWith([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], areObjectsEqual); + * // Returns [{ id: 1 }, { id: 3 }] + */ +declare function xorWith(arr1: readonly T[], arr2: readonly T[], areElementsEqual: (item1: T, item2: T) => boolean): T[]; +//#endregion +export { xorWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/xorWith.js b/tools/ui/node_modules/es-toolkit/dist/array/xorWith.js new file mode 100644 index 0000000000000000000000000000000000000000..43a52d8785e722222cb55cda2529afdbcb590c6e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/xorWith.js @@ -0,0 +1,29 @@ +const require_differenceWith = require("./differenceWith.js"); +const require_intersectionWith = require("./intersectionWith.js"); +const require_unionWith = require("./unionWith.js"); +//#region src/array/xorWith.ts +/** +* Computes the symmetric difference between two arrays using a custom equality function. +* The symmetric difference is the set of elements which are in either of the arrays, +* but not in their intersection. +* +* @template T - Type of elements in the input arrays. +* +* @param {T[]} arr1 - The first array. +* @param {T[]} arr2 - The second array. +* @param {(item1: T, item2: T) => boolean} areElementsEqual - The custom equality function to compare elements. +* @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both, based on the custom equality function. +* +* @example +* // Custom equality function for objects with an 'id' property +* const areObjectsEqual = (a, b) => a.id === b.id; +* xorWith([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], areObjectsEqual); +* // Returns [{ id: 1 }, { id: 3 }] +*/ +function xorWith(arr1, arr2, areElementsEqual) { + const union = require_unionWith.unionWith(arr1, arr2, areElementsEqual); + const intersection = require_intersectionWith.intersectionWith(arr1, arr2, areElementsEqual); + return require_differenceWith.differenceWith(union, intersection, areElementsEqual); +} +//#endregion +exports.xorWith = xorWith; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/xorWith.mjs b/tools/ui/node_modules/es-toolkit/dist/array/xorWith.mjs new file mode 100644 index 0000000000000000000000000000000000000000..416bd428c528a5dc5a1874e11ce56dfe291f8254 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/xorWith.mjs @@ -0,0 +1,27 @@ +import { differenceWith } from "./differenceWith.mjs"; +import { intersectionWith } from "./intersectionWith.mjs"; +import { unionWith } from "./unionWith.mjs"; +//#region src/array/xorWith.ts +/** +* Computes the symmetric difference between two arrays using a custom equality function. +* The symmetric difference is the set of elements which are in either of the arrays, +* but not in their intersection. +* +* @template T - Type of elements in the input arrays. +* +* @param {T[]} arr1 - The first array. +* @param {T[]} arr2 - The second array. +* @param {(item1: T, item2: T) => boolean} areElementsEqual - The custom equality function to compare elements. +* @returns {T[]} An array containing the elements that are present in either `arr1` or `arr2` but not in both, based on the custom equality function. +* +* @example +* // Custom equality function for objects with an 'id' property +* const areObjectsEqual = (a, b) => a.id === b.id; +* xorWith([{ id: 1 }, { id: 2 }], [{ id: 2 }, { id: 3 }], areObjectsEqual); +* // Returns [{ id: 1 }, { id: 3 }] +*/ +function xorWith(arr1, arr2, areElementsEqual) { + return differenceWith(unionWith(arr1, arr2, areElementsEqual), intersectionWith(arr1, arr2, areElementsEqual), areElementsEqual); +} +//#endregion +export { xorWith }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/zip.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/zip.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..ed90b662039d7ec5a8386968a5c720d671a92564 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/zip.d.mts @@ -0,0 +1,107 @@ +//#region src/array/zip.d.ts +/** + * Combines multiple arrays into a single array of tuples. + * + * This function takes multiple arrays and returns a new array where each element is a tuple + * containing the corresponding elements from the input arrays. If the input arrays are of + * different lengths, the resulting array will have the length of the longest input array, + * with undefined values for missing elements. + * + * @template T + * @param {T[]} arr1 - The first array to zip. + * @returns {Array<[T]>} A new array of tuples containing the corresponding elements from the input arrays. + * + * @example + * const arr1 = [1, 2, 3]; + * const result = zip(arr1); + * // result will be [[1], [2], [3]] + */ +declare function zip(arr1: readonly T[]): Array<[T]>; +/** + * Combines multiple arrays into a single array of tuples. + * + * This function takes multiple arrays and returns a new array where each element is a tuple + * containing the corresponding elements from the input arrays. If the input arrays are of + * different lengths, the resulting array will have the length of the longest input array, + * with undefined values for missing elements. + * + * @template T, U + * @param {T[]} arr1 - The first array to zip. + * @param {U[]} arr2 - The second array to zip. + * @returns {Array<[T, U]>} A new array of tuples containing the corresponding elements from the input arrays. + * + * @example + * const arr1 = [1, 2, 3]; + * const arr2 = ['a', 'b', 'c']; + * const result = zip(arr1, arr2); + * // result will be [[1, 'a'], [2, 'b'], [3, 'c']] + */ +declare function zip(arr1: readonly T[], arr2: readonly U[]): Array<[T, U]>; +/** + * Combines multiple arrays into a single array of tuples. + * + * This function takes multiple arrays and returns a new array where each element is a tuple + * containing the corresponding elements from the input arrays. If the input arrays are of + * different lengths, the resulting array will have the length of the longest input array, + * with undefined values for missing elements. + * + * @template T, U, V + * @param {T[]} arr1 - The first array to zip. + * @param {U[]} arr2 - The second array to zip. + * @param {V[]} arr3 - The third array to zip. + * @returns {Array<[T, U, V]>} A new array of tuples containing the corresponding elements from the input arrays. + * + * @example + * const arr1 = [1, 2, 3]; + * const arr2 = ['a', 'b', 'c']; + * const arr3 = [true, false]; + * const result = zip(arr1, arr2, arr3); + * // result will be [[1, 'a', true], [2, 'b', false], [3, 'c', undefined]] + */ +declare function zip(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[]): Array<[T, U, V]>; +/** + * Combines multiple arrays into a single array of tuples. + * + * This function takes multiple arrays and returns a new array where each element is a tuple + * containing the corresponding elements from the input arrays. If the input arrays are of + * different lengths, the resulting array will have the length of the longest input array, + * with undefined values for missing elements. + * + * @template T, U, V, W + * @param {T[]} arr1 - The first array to zip. + * @param {U[]} arr2 - The second array to zip. + * @param {V[]} arr3 - The third array to zip. + * @param {W[]} arr4 - The fourth array to zip. + * @returns {Array<[T, U, V, W]>} A new array of tuples containing the corresponding elements from the input arrays. + * + * @example + * const arr1 = [1, 2, 3]; + * const arr2 = ['a', 'b', 'c']; + * const arr3 = [true, false]; + * const arr4 = [null, null, null]; + * const result = zip(arr1, arr2, arr3, arr4); + * // result will be [[1, 'a', true, null], [2, 'b', false, null], [3, 'c', undefined, null]] + */ +declare function zip(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[], arr4: readonly W[]): Array<[T, U, V, W]>; +/** + * Combines multiple arrays into a single array of tuples. + * + * This function takes multiple arrays and returns a new array where each element is a tuple + * containing the corresponding elements from the input arrays. If the input arrays are of + * different lengths, the resulting array will have the length of the longest input array, + * with undefined values for missing elements. + * + * @template T + * @param {...Array} arrs - The arrays to zip together. + * @returns {T[][]} A new array of tuples containing the corresponding elements from the input arrays. + * + * @example + * const arr1 = [1, 2, 3]; + * const arr2 = ['a', 'b', 'c']; + * const arr3 = [true, false]; + * const result = zip(arr1, arr2, arr3); + * // result will be [[1, 'a', true], [2, 'b', false], [3, 'c', undefined]] + */ +declare function zip(...arrs: Array): T[][]; +//#endregion +export { zip }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/zip.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/zip.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ed90b662039d7ec5a8386968a5c720d671a92564 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/zip.d.ts @@ -0,0 +1,107 @@ +//#region src/array/zip.d.ts +/** + * Combines multiple arrays into a single array of tuples. + * + * This function takes multiple arrays and returns a new array where each element is a tuple + * containing the corresponding elements from the input arrays. If the input arrays are of + * different lengths, the resulting array will have the length of the longest input array, + * with undefined values for missing elements. + * + * @template T + * @param {T[]} arr1 - The first array to zip. + * @returns {Array<[T]>} A new array of tuples containing the corresponding elements from the input arrays. + * + * @example + * const arr1 = [1, 2, 3]; + * const result = zip(arr1); + * // result will be [[1], [2], [3]] + */ +declare function zip(arr1: readonly T[]): Array<[T]>; +/** + * Combines multiple arrays into a single array of tuples. + * + * This function takes multiple arrays and returns a new array where each element is a tuple + * containing the corresponding elements from the input arrays. If the input arrays are of + * different lengths, the resulting array will have the length of the longest input array, + * with undefined values for missing elements. + * + * @template T, U + * @param {T[]} arr1 - The first array to zip. + * @param {U[]} arr2 - The second array to zip. + * @returns {Array<[T, U]>} A new array of tuples containing the corresponding elements from the input arrays. + * + * @example + * const arr1 = [1, 2, 3]; + * const arr2 = ['a', 'b', 'c']; + * const result = zip(arr1, arr2); + * // result will be [[1, 'a'], [2, 'b'], [3, 'c']] + */ +declare function zip(arr1: readonly T[], arr2: readonly U[]): Array<[T, U]>; +/** + * Combines multiple arrays into a single array of tuples. + * + * This function takes multiple arrays and returns a new array where each element is a tuple + * containing the corresponding elements from the input arrays. If the input arrays are of + * different lengths, the resulting array will have the length of the longest input array, + * with undefined values for missing elements. + * + * @template T, U, V + * @param {T[]} arr1 - The first array to zip. + * @param {U[]} arr2 - The second array to zip. + * @param {V[]} arr3 - The third array to zip. + * @returns {Array<[T, U, V]>} A new array of tuples containing the corresponding elements from the input arrays. + * + * @example + * const arr1 = [1, 2, 3]; + * const arr2 = ['a', 'b', 'c']; + * const arr3 = [true, false]; + * const result = zip(arr1, arr2, arr3); + * // result will be [[1, 'a', true], [2, 'b', false], [3, 'c', undefined]] + */ +declare function zip(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[]): Array<[T, U, V]>; +/** + * Combines multiple arrays into a single array of tuples. + * + * This function takes multiple arrays and returns a new array where each element is a tuple + * containing the corresponding elements from the input arrays. If the input arrays are of + * different lengths, the resulting array will have the length of the longest input array, + * with undefined values for missing elements. + * + * @template T, U, V, W + * @param {T[]} arr1 - The first array to zip. + * @param {U[]} arr2 - The second array to zip. + * @param {V[]} arr3 - The third array to zip. + * @param {W[]} arr4 - The fourth array to zip. + * @returns {Array<[T, U, V, W]>} A new array of tuples containing the corresponding elements from the input arrays. + * + * @example + * const arr1 = [1, 2, 3]; + * const arr2 = ['a', 'b', 'c']; + * const arr3 = [true, false]; + * const arr4 = [null, null, null]; + * const result = zip(arr1, arr2, arr3, arr4); + * // result will be [[1, 'a', true, null], [2, 'b', false, null], [3, 'c', undefined, null]] + */ +declare function zip(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[], arr4: readonly W[]): Array<[T, U, V, W]>; +/** + * Combines multiple arrays into a single array of tuples. + * + * This function takes multiple arrays and returns a new array where each element is a tuple + * containing the corresponding elements from the input arrays. If the input arrays are of + * different lengths, the resulting array will have the length of the longest input array, + * with undefined values for missing elements. + * + * @template T + * @param {...Array} arrs - The arrays to zip together. + * @returns {T[][]} A new array of tuples containing the corresponding elements from the input arrays. + * + * @example + * const arr1 = [1, 2, 3]; + * const arr2 = ['a', 'b', 'c']; + * const arr3 = [true, false]; + * const result = zip(arr1, arr2, arr3); + * // result will be [[1, 'a', true], [2, 'b', false], [3, 'c', undefined]] + */ +declare function zip(...arrs: Array): T[][]; +//#endregion +export { zip }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/zip.js b/tools/ui/node_modules/es-toolkit/dist/array/zip.js new file mode 100644 index 0000000000000000000000000000000000000000..143ce457dee5c4d2e0bf0f10e533cbf4627f7602 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/zip.js @@ -0,0 +1,34 @@ +//#region src/array/zip.ts +/** +* Combines multiple arrays into a single array of tuples. +* +* This function takes multiple arrays and returns a new array where each element is a tuple +* containing the corresponding elements from the input arrays. If the input arrays are of +* different lengths, the resulting array will have the length of the longest input array, +* with undefined values for missing elements. +* +* @template T +* @param {...Array} arrs - The arrays to zip together. +* @returns {T[][]} A new array of tuples containing the corresponding elements from the input arrays. +* +* @example +* const arr1 = [1, 2, 3]; +* const arr2 = ['a', 'b', 'c']; +* const arr3 = [true, false]; +* const result = zip(arr1, arr2, arr3); +* // result will be [[1, 'a', true], [2, 'b', false], [3, 'c', undefined]] +*/ +function zip(...arrs) { + let rowCount = 0; + for (let i = 0; i < arrs.length; i++) if (arrs[i].length > rowCount) rowCount = arrs[i].length; + const columnCount = arrs.length; + const result = Array(rowCount); + for (let i = 0; i < rowCount; ++i) { + const row = Array(columnCount); + for (let j = 0; j < columnCount; ++j) row[j] = arrs[j][i]; + result[i] = row; + } + return result; +} +//#endregion +exports.zip = zip; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/zip.mjs b/tools/ui/node_modules/es-toolkit/dist/array/zip.mjs new file mode 100644 index 0000000000000000000000000000000000000000..8f6eac9a223979ddaecb8eca8711d7cf9e5d3cfe --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/zip.mjs @@ -0,0 +1,34 @@ +//#region src/array/zip.ts +/** +* Combines multiple arrays into a single array of tuples. +* +* This function takes multiple arrays and returns a new array where each element is a tuple +* containing the corresponding elements from the input arrays. If the input arrays are of +* different lengths, the resulting array will have the length of the longest input array, +* with undefined values for missing elements. +* +* @template T +* @param {...Array} arrs - The arrays to zip together. +* @returns {T[][]} A new array of tuples containing the corresponding elements from the input arrays. +* +* @example +* const arr1 = [1, 2, 3]; +* const arr2 = ['a', 'b', 'c']; +* const arr3 = [true, false]; +* const result = zip(arr1, arr2, arr3); +* // result will be [[1, 'a', true], [2, 'b', false], [3, 'c', undefined]] +*/ +function zip(...arrs) { + let rowCount = 0; + for (let i = 0; i < arrs.length; i++) if (arrs[i].length > rowCount) rowCount = arrs[i].length; + const columnCount = arrs.length; + const result = Array(rowCount); + for (let i = 0; i < rowCount; ++i) { + const row = Array(columnCount); + for (let j = 0; j < columnCount; ++j) row[j] = arrs[j][i]; + result[i] = row; + } + return result; +} +//#endregion +export { zip }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/zipObject.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/zipObject.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..6d283a13e52768600a74dc6ef3b958139d3b01e4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/zipObject.d.mts @@ -0,0 +1,34 @@ +//#region src/array/zipObject.d.ts +/** + * Combines two arrays, one of property names and one of corresponding values, into a single object. + * + * This function takes two arrays: one containing property names and another containing corresponding values. + * It returns a new object where the property names from the first array are keys, and the corresponding elements + * from the second array are values. If the `keys` array is longer than the `values` array, the remaining keys will + * have `undefined` as their values. + * + * @template P - The type of elements in the array. + * @template V - The type of elements in the array. + * @param {P[]} keys - An array of property names. + * @param {V[]} values - An array of values corresponding to the property names. + * @returns {Record} - A new object composed of the given property names and values. + * + * @example + * const keys = ['a', 'b', 'c']; + * const values = [1, 2, 3]; + * const result = zipObject(keys, values); + * // result will be { a: 1, b: 2, c: 3 } + * + * const keys2 = ['a', 'b', 'c']; + * const values2 = [1, 2]; + * const result2 = zipObject(keys2, values2); + * // result2 will be { a: 1, b: 2, c: undefined } + * + * const keys2 = ['a', 'b']; + * const values2 = [1, 2, 3]; + * const result2 = zipObject(keys2, values2); + * // result2 will be { a: 1, b: 2 } + */ +declare function zipObject

(keys: readonly P[], values: readonly V[]): Record; +//#endregion +export { zipObject }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/zipObject.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/zipObject.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6d283a13e52768600a74dc6ef3b958139d3b01e4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/zipObject.d.ts @@ -0,0 +1,34 @@ +//#region src/array/zipObject.d.ts +/** + * Combines two arrays, one of property names and one of corresponding values, into a single object. + * + * This function takes two arrays: one containing property names and another containing corresponding values. + * It returns a new object where the property names from the first array are keys, and the corresponding elements + * from the second array are values. If the `keys` array is longer than the `values` array, the remaining keys will + * have `undefined` as their values. + * + * @template P - The type of elements in the array. + * @template V - The type of elements in the array. + * @param {P[]} keys - An array of property names. + * @param {V[]} values - An array of values corresponding to the property names. + * @returns {Record} - A new object composed of the given property names and values. + * + * @example + * const keys = ['a', 'b', 'c']; + * const values = [1, 2, 3]; + * const result = zipObject(keys, values); + * // result will be { a: 1, b: 2, c: 3 } + * + * const keys2 = ['a', 'b', 'c']; + * const values2 = [1, 2]; + * const result2 = zipObject(keys2, values2); + * // result2 will be { a: 1, b: 2, c: undefined } + * + * const keys2 = ['a', 'b']; + * const values2 = [1, 2, 3]; + * const result2 = zipObject(keys2, values2); + * // result2 will be { a: 1, b: 2 } + */ +declare function zipObject

(keys: readonly P[], values: readonly V[]): Record; +//#endregion +export { zipObject }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/zipObject.js b/tools/ui/node_modules/es-toolkit/dist/array/zipObject.js new file mode 100644 index 0000000000000000000000000000000000000000..0a1aa7148808b7d6be10e9c836b051efea52f708 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/zipObject.js @@ -0,0 +1,38 @@ +//#region src/array/zipObject.ts +/** +* Combines two arrays, one of property names and one of corresponding values, into a single object. +* +* This function takes two arrays: one containing property names and another containing corresponding values. +* It returns a new object where the property names from the first array are keys, and the corresponding elements +* from the second array are values. If the `keys` array is longer than the `values` array, the remaining keys will +* have `undefined` as their values. +* +* @template P - The type of elements in the array. +* @template V - The type of elements in the array. +* @param {P[]} keys - An array of property names. +* @param {V[]} values - An array of values corresponding to the property names. +* @returns {Record} - A new object composed of the given property names and values. +* +* @example +* const keys = ['a', 'b', 'c']; +* const values = [1, 2, 3]; +* const result = zipObject(keys, values); +* // result will be { a: 1, b: 2, c: 3 } +* +* const keys2 = ['a', 'b', 'c']; +* const values2 = [1, 2]; +* const result2 = zipObject(keys2, values2); +* // result2 will be { a: 1, b: 2, c: undefined } +* +* const keys2 = ['a', 'b']; +* const values2 = [1, 2, 3]; +* const result2 = zipObject(keys2, values2); +* // result2 will be { a: 1, b: 2 } +*/ +function zipObject(keys, values) { + const result = {}; + for (let i = 0; i < keys.length; i++) result[keys[i]] = values[i]; + return result; +} +//#endregion +exports.zipObject = zipObject; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/zipObject.mjs b/tools/ui/node_modules/es-toolkit/dist/array/zipObject.mjs new file mode 100644 index 0000000000000000000000000000000000000000..a7a57e134dcc4a1d6f3d78be0336abaa182a6cd7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/zipObject.mjs @@ -0,0 +1,38 @@ +//#region src/array/zipObject.ts +/** +* Combines two arrays, one of property names and one of corresponding values, into a single object. +* +* This function takes two arrays: one containing property names and another containing corresponding values. +* It returns a new object where the property names from the first array are keys, and the corresponding elements +* from the second array are values. If the `keys` array is longer than the `values` array, the remaining keys will +* have `undefined` as their values. +* +* @template P - The type of elements in the array. +* @template V - The type of elements in the array. +* @param {P[]} keys - An array of property names. +* @param {V[]} values - An array of values corresponding to the property names. +* @returns {Record} - A new object composed of the given property names and values. +* +* @example +* const keys = ['a', 'b', 'c']; +* const values = [1, 2, 3]; +* const result = zipObject(keys, values); +* // result will be { a: 1, b: 2, c: 3 } +* +* const keys2 = ['a', 'b', 'c']; +* const values2 = [1, 2]; +* const result2 = zipObject(keys2, values2); +* // result2 will be { a: 1, b: 2, c: undefined } +* +* const keys2 = ['a', 'b']; +* const values2 = [1, 2, 3]; +* const result2 = zipObject(keys2, values2); +* // result2 will be { a: 1, b: 2 } +*/ +function zipObject(keys, values) { + const result = {}; + for (let i = 0; i < keys.length; i++) result[keys[i]] = values[i]; + return result; +} +//#endregion +export { zipObject }; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/zipWith.d.mts b/tools/ui/node_modules/es-toolkit/dist/array/zipWith.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..3cbf9fa567ce0ee63b64a87ca43162534470c123 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/zipWith.d.mts @@ -0,0 +1,73 @@ +//#region src/array/zipWith.d.ts +/** + * Combines multiple arrays into a single array using a custom combiner function. + * + * This function takes multiple arrays and a combiner function, and returns a new array where each element + * is the result of applying the combiner function to the corresponding elements of the input arrays. + * + * @template T - The type of elements in the first array. + * @template R - The type of elements in the resulting array. + * @param {T[]} arr1 - The first array to zip. + * @param {(item: T, index: number) => R} combine - The combiner function that takes corresponding elements from each array, their index, and returns a single value. + * @returns {R[]} A new array where each element is the result of applying the combiner function to the corresponding elements of the input arrays. + * + * @example + * // Example usage with two arrays: + * const arr1 = [1, 2, 3]; + * const arr2 = [4, 5, 6]; + * const result = zipWith(arr1, arr2, (a, b) => a + b); + * // result will be [5, 7, 9] + * + * @example + * // Example usage with three arrays: + * const arr1 = [1, 2]; + * const arr2 = [3, 4]; + * const arr3 = [5, 6]; + * const result = zipWith(arr1, arr2, arr3, (a, b, c) => `${a}${b}${c}`); + * // result will be [`135`, `246`] + */ +declare function zipWith(arr1: readonly T[], combine: (item: T, index: number) => R): R[]; +/** + * Combines two arrays into a single array using a custom combiner function. + * + * @template T - The type of elements in the first array. + * @template U - The type of elements in the second array. + * @template R - The type of elements in the resulting array. + * @param {T[]} arr1 - The first array to zip. + * @param {U[]} arr2 - The second array to zip. + * @param {(item1: T, item2: U, index: number) => R} combine - The combiner function that takes corresponding elements from each array, their index, and returns a single value. + * @returns {R[]} A new array where each element is the result of applying the combiner function to the corresponding elements of the input arrays. + */ +declare function zipWith(arr1: readonly T[], arr2: readonly U[], combine: (item1: T, item2: U, index: number) => R): R[]; +/** + * Combines three arrays into a single array using a custom combiner function. + * + * @template T - The type of elements in the first array. + * @template U - The type of elements in the second array. + * @template V - The type of elements in the third array. + * @template R - The type of elements in the resulting array. + * @param {T[]} arr1 - The first array to zip. + * @param {U[]} arr2 - The second array to zip. + * @param {V[]} arr3 - The third array to zip. + * @param {(item1: T, item2: U, item3: V, index: number) => R} combine - The combiner function that takes corresponding elements from each array, their index, and returns a single value. + * @returns {R[]} A new array where each element is the result of applying the combiner function to the corresponding elements of the input arrays. + */ +declare function zipWith(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[], combine: (item1: T, item2: U, item3: V, index: number) => R): R[]; +/** + * Combines four arrays into a single array using a custom combiner function. + * + * @template T - The type of elements in the first array. + * @template U - The type of elements in the second array. + * @template V - The type of elements in the third array. + * @template W - The type of elements in the fourth array. + * @template R - The type of elements in the resulting array. + * @param {T[]} arr1 - The first array to zip. + * @param {U[]} arr2 - The second array to zip. + * @param {V[]} arr3 - The third array to zip. + * @param {W[]} arr4 - The fourth array to zip. + * @param {(item1: T, item2: U, item3: V, item4: W, index: number) => R} combine - The combiner function that takes corresponding elements from each array, their index, and returns a single value. + * @returns {R[]} A new array where each element is the result of applying the combiner function to the corresponding elements of the input arrays. + */ +declare function zipWith(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[], arr4: readonly W[], combine: (item1: T, item2: U, item3: V, item4: W, index: number) => R): R[]; +//#endregion +export { zipWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/zipWith.d.ts b/tools/ui/node_modules/es-toolkit/dist/array/zipWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3cbf9fa567ce0ee63b64a87ca43162534470c123 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/zipWith.d.ts @@ -0,0 +1,73 @@ +//#region src/array/zipWith.d.ts +/** + * Combines multiple arrays into a single array using a custom combiner function. + * + * This function takes multiple arrays and a combiner function, and returns a new array where each element + * is the result of applying the combiner function to the corresponding elements of the input arrays. + * + * @template T - The type of elements in the first array. + * @template R - The type of elements in the resulting array. + * @param {T[]} arr1 - The first array to zip. + * @param {(item: T, index: number) => R} combine - The combiner function that takes corresponding elements from each array, their index, and returns a single value. + * @returns {R[]} A new array where each element is the result of applying the combiner function to the corresponding elements of the input arrays. + * + * @example + * // Example usage with two arrays: + * const arr1 = [1, 2, 3]; + * const arr2 = [4, 5, 6]; + * const result = zipWith(arr1, arr2, (a, b) => a + b); + * // result will be [5, 7, 9] + * + * @example + * // Example usage with three arrays: + * const arr1 = [1, 2]; + * const arr2 = [3, 4]; + * const arr3 = [5, 6]; + * const result = zipWith(arr1, arr2, arr3, (a, b, c) => `${a}${b}${c}`); + * // result will be [`135`, `246`] + */ +declare function zipWith(arr1: readonly T[], combine: (item: T, index: number) => R): R[]; +/** + * Combines two arrays into a single array using a custom combiner function. + * + * @template T - The type of elements in the first array. + * @template U - The type of elements in the second array. + * @template R - The type of elements in the resulting array. + * @param {T[]} arr1 - The first array to zip. + * @param {U[]} arr2 - The second array to zip. + * @param {(item1: T, item2: U, index: number) => R} combine - The combiner function that takes corresponding elements from each array, their index, and returns a single value. + * @returns {R[]} A new array where each element is the result of applying the combiner function to the corresponding elements of the input arrays. + */ +declare function zipWith(arr1: readonly T[], arr2: readonly U[], combine: (item1: T, item2: U, index: number) => R): R[]; +/** + * Combines three arrays into a single array using a custom combiner function. + * + * @template T - The type of elements in the first array. + * @template U - The type of elements in the second array. + * @template V - The type of elements in the third array. + * @template R - The type of elements in the resulting array. + * @param {T[]} arr1 - The first array to zip. + * @param {U[]} arr2 - The second array to zip. + * @param {V[]} arr3 - The third array to zip. + * @param {(item1: T, item2: U, item3: V, index: number) => R} combine - The combiner function that takes corresponding elements from each array, their index, and returns a single value. + * @returns {R[]} A new array where each element is the result of applying the combiner function to the corresponding elements of the input arrays. + */ +declare function zipWith(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[], combine: (item1: T, item2: U, item3: V, index: number) => R): R[]; +/** + * Combines four arrays into a single array using a custom combiner function. + * + * @template T - The type of elements in the first array. + * @template U - The type of elements in the second array. + * @template V - The type of elements in the third array. + * @template W - The type of elements in the fourth array. + * @template R - The type of elements in the resulting array. + * @param {T[]} arr1 - The first array to zip. + * @param {U[]} arr2 - The second array to zip. + * @param {V[]} arr3 - The third array to zip. + * @param {W[]} arr4 - The fourth array to zip. + * @param {(item1: T, item2: U, item3: V, item4: W, index: number) => R} combine - The combiner function that takes corresponding elements from each array, their index, and returns a single value. + * @returns {R[]} A new array where each element is the result of applying the combiner function to the corresponding elements of the input arrays. + */ +declare function zipWith(arr1: readonly T[], arr2: readonly U[], arr3: readonly V[], arr4: readonly W[], combine: (item1: T, item2: U, item3: V, item4: W, index: number) => R): R[]; +//#endregion +export { zipWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/array/zipWith.js b/tools/ui/node_modules/es-toolkit/dist/array/zipWith.js new file mode 100644 index 0000000000000000000000000000000000000000..4c15f09d33640f6c5bc7e50c4160b0d512415fc2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/zipWith.js @@ -0,0 +1,32 @@ +//#region src/array/zipWith.ts +/** +* Combines multiple arrays into a single array using a custom combiner function. +* +* This function takes one array and a variable number of additional arrays, +* applying the provided combiner function to the corresponding elements of each array. +* If the input arrays are of different lengths, the resulting array will have the length +* of the longest input array, with undefined values for missing elements. +* +* @template T - The type of elements in the input arrays. +* @template R - The type of elements in the resulting array. +* @param {T[]} arr1 - The first array to zip. +* @param {...Array} rest - The additional arrays to zip together, followed by the combiner function. +* @param {(...items: [...T[], number]) => R} combine - The combiner function that takes corresponding elements from each array, followed by their index, and returns a single value. +* @returns {R[]} A new array where each element is the result of applying the combiner function to the corresponding elements of the input arrays. +* +* @example +* const arr1 = [1, 2, 3]; +* const arr2 = ['a', 'b', 'c']; +* const result = zipWith(arr1, arr2, (num, char) => `${num}${char}`); +* // result will be ['1a', '2b', '3c'] +*/ +function zipWith(arr1, ...rest) { + const arrs = [arr1, ...rest.slice(0, -1)]; + const combine = rest[rest.length - 1]; + const maxIndex = Math.max(...arrs.map((arr) => arr.length)); + const result = Array(maxIndex); + for (let i = 0; i < maxIndex; i++) result[i] = combine(...arrs.map((arr) => arr[i]), i); + return result; +} +//#endregion +exports.zipWith = zipWith; diff --git a/tools/ui/node_modules/es-toolkit/dist/array/zipWith.mjs b/tools/ui/node_modules/es-toolkit/dist/array/zipWith.mjs new file mode 100644 index 0000000000000000000000000000000000000000..62c3772a53e84719e7cedf4e7b5d2eaf86a34201 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/array/zipWith.mjs @@ -0,0 +1,32 @@ +//#region src/array/zipWith.ts +/** +* Combines multiple arrays into a single array using a custom combiner function. +* +* This function takes one array and a variable number of additional arrays, +* applying the provided combiner function to the corresponding elements of each array. +* If the input arrays are of different lengths, the resulting array will have the length +* of the longest input array, with undefined values for missing elements. +* +* @template T - The type of elements in the input arrays. +* @template R - The type of elements in the resulting array. +* @param {T[]} arr1 - The first array to zip. +* @param {...Array} rest - The additional arrays to zip together, followed by the combiner function. +* @param {(...items: [...T[], number]) => R} combine - The combiner function that takes corresponding elements from each array, followed by their index, and returns a single value. +* @returns {R[]} A new array where each element is the result of applying the combiner function to the corresponding elements of the input arrays. +* +* @example +* const arr1 = [1, 2, 3]; +* const arr2 = ['a', 'b', 'c']; +* const result = zipWith(arr1, arr2, (num, char) => `${num}${char}`); +* // result will be ['1a', '2b', '3c'] +*/ +function zipWith(arr1, ...rest) { + const arrs = [arr1, ...rest.slice(0, -1)]; + const combine = rest[rest.length - 1]; + const maxIndex = Math.max(...arrs.map((arr) => arr.length)); + const result = Array(maxIndex); + for (let i = 0; i < maxIndex; i++) result[i] = combine(...arrs.map((arr) => arr[i]), i); + return result; +} +//#endregion +export { zipWith }; diff --git a/tools/ui/node_modules/es-toolkit/dist/browser.global.js b/tools/ui/node_modules/es-toolkit/dist/browser.global.js new file mode 100644 index 0000000000000000000000000000000000000000..f265b0fd29bf620d574b1280f4d871fbbec18e31 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/browser.global.js @@ -0,0 +1,8 @@ +(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e._={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(...e){if(e.length===0)return[[]];let t=1;for(let n=0;n=0;r--){let n=e[r],i=n.length;t[r]=n[a%i],a=Math.floor(a/i)}r[i]=t}return r}function n(e,t){if(!Number.isInteger(t)||t<=0)throw Error(`Size must be an integer greater than zero.`);let n=Math.ceil(e.length/t),r=Array(n);for(let i=0;in)return[];if(t===0)return[[]];let r=Array(t);for(let e=0;e=0&&r[o]===o+n-t;)o--;if(o<0)return i;r[o]++;for(let e=o+1;e!n.has(e))}function o(e,t,n){let r=new Set(t.map(e=>n(e)));return e.filter(e=>!r.has(n(e)))}function s(e,t,n){return e.filter(e=>t.every(t=>!n(e,t)))}function c(e,t){return t=Math.max(t,0),e.slice(t)}function l(e,t){return t=Math.min(-t,0),t===0?e.slice():e.slice(0,t)}function u(e,t){for(let n=e.length-1;n>=0;n--)if(!t(e[n],n,e))return e.slice(0,n+1);return[]}function d(e,t){let n=e.findIndex((e,n,r)=>!t(e,n,r));return n===-1?[]:e.slice(n)}function f(e,t,n=0,r=e.length){let i=e.length,a=Math.max(n>=0?n:i+n,0),o=Math.min(r>=0?r:i+r,i);for(let n=a;n0){this.available--;return}return new Promise(e=>{this.deferredTasks.push(e)})}release(){let e=this.deferredTasks.shift();if(e!=null){e();return}this.availabler[t])}function g(e,t=1){let n=[],r=Math.floor(t),i=(e,t)=>{for(let a=0;an.has(e))}function oe(e,t,n){let r=[],i=new Set(t.map(n));for(let t=0;tt.some(t=>n(e,t)))}function ce(e,t){return a(t,e).length===0}function le(e,t,n){return s(t,e,n).length===0}function ue(e){return e[e.length-1]}function de(e,t,n){return n?.concurrency!=null&&(t=m(t,n.concurrency)),Promise.all(e.map(t))}function fe(e,t){if(e.length===0)return;let n=e[0],r=t(n,0,e);for(let i=1;ir&&(r=o,n=a)}return n}function pe(e,t){if(e.length===0)return;let n=e[0],r=t(n,0,e);for(let i=1;i=t)throw Error(`Invalid input: The maximum value must be greater than the minimum value.`);return Math.random()*(t-e)+e}function ye(e,t){return Math.floor(ve(e,t))}function be(e,t){if(t>e.length)throw Error(`Size must be less than or equal to the length of array.`);let n=Array(t),r=new Set;for(let i=e.length-t,a=0;i=1;e--){let n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t}function Se(e){return e.slice(1)}function _(e){return typeof e==`symbol`||e instanceof Symbol}function v(e){return _(e)?NaN:Number(e)}function y(e){return e?(e=v(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function b(e){let t=y(e),n=t%1;return n?t-n:t}function Ce(e,t,n){return t=n||t===void 0?1:b(t),e.slice(0,t)}function we(e,t,n){return t=n||t===void 0?1:b(t),t<=0||e.length===0?[]:e.slice(-t)}function Te(e,t,n=0,r=e.length){let i=e.length,a=Math.max(n>=0?n:i+n,0),o=Math.min(r>=0?r:i+r,i),s=e.slice();for(let e=a;e!t(e,i))&&n.push(i)}return n}function ke(e){let t=0;for(let n=0;nt&&(t=e[n].length);let n=Array(t);for(let r=0;rt&&(t=e[n].length);let n=e.length,r=Array(t);for(let i=0;i{if(++n>=e)return t(...r)}}function Re(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}async function ze(){}function Be(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}function Ve(...e){return function(...t){let n=e.length?e[0].apply(this,t):t[0];for(let t=1;t!e(...t))}function We(){}function Ge(e){let t=!1,n;return function(...r){return t||(t=!0,n=e(...r)),n}}function Ke(e,...t){return qe(e,Je,...t)}function qe(e,t,...n){let r=function(...r){let i=0,a=n.slice().map(e=>e===t?r[i++]:e),o=r.slice(i);return e.apply(this,a.concat(o))};return e.prototype&&(r.prototype=Object.create(e.prototype)),r}let Je=Symbol(`partial.placeholder`);Ke.placeholder=Je;function Ye(e,...t){return Xe(e,Ze,...t)}function Xe(e,t,...n){let r=function(...r){let i=n.filter(e=>e===t).length,a=Math.max(r.length-i,0),o=r.slice(0,a),s=a,c=n.slice().map(e=>e===t?r[s++]:e);return e.apply(this,o.concat(c))};return e.prototype&&(r.prototype=Object.create(e.prototype)),r}let Ze=Symbol(`partialRight.placeholder`);Ye.placeholder=Ze;function Qe(e,t=e.length-1){return function(...n){let r=n.slice(t),i=n.slice(0,t);for(;i.length{let i=()=>{r(new Fe)},a=()=>{clearTimeout(o),i()};if(t?.aborted)return i();let o=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e);t?.addEventListener(`abort`,a,{once:!0})})}let et=()=>!0;async function tt(e,t){let n,r,i,a;typeof t==`number`?(n=0,r=t,i=void 0,a=et):(n=t?.delay??0,r=t?.retries??1/0,i=t?.signal,a=t?.shouldRetry??et);let o;for(let t=0;t<=r;t++){if(i?.aborted)throw o??Error(`The retry operation was aborted due to an abort signal.`);try{return await e()}catch(e){if(o=e,!a(e,t))throw e;await $e(typeof n==`function`?n(t):n)}}throw o}function nt(e,t,n){if(n??(n=t,t=0),t>=n)throw Error(`The maximum value must be greater than the minimum value.`);return t<=e&&et(e))/e.length}function at(e){if(e.length===0)return NaN;let t=e.slice().sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length%2==0?(t[n-1]+t[n])/2:t[n]}function ot(e,t){return at(e.map(e=>t(e)))}function st(e,t){if(Number.isNaN(Number(t)))throw Error(`Expected percentile to be a number but got "${t}".`);if(t<0)throw Error(`Expected percentile to be >= 0 but got "${t}".`);if(t>100)throw Error(`Expected percentile to be <= 100 but got "${t}".`);if(e.length===0)return NaN;let n=e.slice().sort((e,t)=>(Number.isNaN(e)?-1/0:e)-(Number.isNaN(t)?-1/0:t));return t===0?n[0]:n[Math.ceil(n.length*(t/100))-1]}function ct(e,t,n=1){if(t??(t=e,e=0),!Number.isInteger(n)||n===0)throw Error(`The step value must be a non-zero integer.`);let r=Math.max(Math.ceil((t-e)/n),0),i=Array(r);for(let t=0;tObject.prototype.propertyIsEnumerable.call(e,t))}function C(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}let ft=`[object RegExp]`,pt=`[object String]`,mt=`[object Number]`,ht=`[object Boolean]`,gt=`[object Arguments]`,_t=`[object Symbol]`,vt=`[object Date]`,yt=`[object Map]`,bt=`[object Set]`,xt=`[object Array]`,St=`[object ArrayBuffer]`,Ct=`[object Object]`,wt=`[object DataView]`,Tt=`[object Uint8Array]`,Et=`[object Uint8ClampedArray]`,Dt=`[object Uint16Array]`,Ot=`[object Uint32Array]`,kt=`[object Int8Array]`,At=`[object Int16Array]`,jt=`[object Int32Array]`,Mt=`[object Float32Array]`,Nt=`[object Float64Array]`;function w(e){return Ne.Buffer!==void 0&&Ne.Buffer.isBuffer(e)}function Pt(e,t){return T(e,void 0,e,new Map,t)}function T(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(S(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;at(e[n],n,e))}function D(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)===`[object Object]`:!1}function Rt(e,{delimiter:t=`.`}={}){return zt(e,``,t)}function zt(e,t,n){let r={},i=Object.keys(e);for(let a=0;a0){Object.assign(r,zt(s,c,n));continue}if(Array.isArray(s)&&s.length>0){Object.assign(r,zt(s,c,n));continue}r[c]=s}return r}function Bt(e){let t={},n=Object.keys(e);for(let r=0;rWt(e)).join(``)}`}function qt(e){if(A(e))return e.map(e=>qt(e));if(D(e)){let t={},n=Object.keys(e);for(let r=0;re.toLowerCase()).join(`_`)}function Xt(e){if(A(e))return e.map(e=>Xt(e));if(M(e)){let t={},n=Object.keys(e);for(let r=0;r`u`?!1:e instanceof Blob}function $t(){return typeof window<`u`&&window?.document!=null}function en(e){return e instanceof Date}function tn(e){return D(e)&&Object.keys(e).length===0}function N(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function nn(e,t,n){return rn(e,t,void 0,void 0,void 0,void 0,n)}function rn(e,t,n,r,i,a,o){let s=o(e,t,n,r,i,a);if(s!==void 0)return s;if(typeof e==typeof t)switch(typeof e){case`bigint`:case`string`:case`boolean`:case`symbol`:case`undefined`:return e===t;case`number`:return e===t||Object.is(e,t);case`function`:return e===t;case`object`:return an(e,t,a,o)}return an(e,t,a,o)}function an(e,t,n,r){if(Object.is(e,t))return!0;let i=C(e),a=C(t);if(i===`[object Arguments]`&&(i=Ct),a===`[object Arguments]`&&(a=Ct),i!==a)return!1;switch(i){case pt:return e.toString()===t.toString();case mt:return N(e.valueOf(),t.valueOf());case ht:case vt:case _t:return Object.is(e.valueOf(),t.valueOf());case ft:return e.source===t.source&&e.flags===t.flags;case`[object Function]`:return e===t}n??=new Map;let o=n.get(e),s=n.get(t);if(o!=null&&s!=null)return o===t;n.set(e,t),n.set(t,e);try{switch(i){case yt:if(e.size!==t.size)return!1;for(let[i,a]of e.entries())if(!t.has(i)||!rn(a,t.get(i),i,e,t,n,r))return!1;return!0;case bt:{if(e.size!==t.size)return!1;let i=Array.from(e.values()),a=Array.from(t.values());for(let o=0;orn(s,i,void 0,e,t,n,r));if(c===-1)return!1;a.splice(c,1)}return!0}case xt:case Tt:case Et:case Dt:case Ot:case`[object BigUint64Array]`:case kt:case At:case jt:case`[object BigInt64Array]`:case Mt:case Nt:if(w(e)!==w(t)||e.length!==t.length)return!1;for(let i=0;i`u`?!1:Qt(e)&&e instanceof File}function cn(e){return typeof e==`function`}function ln(e){if(typeof e!=`string`)return!1;try{return JSON.parse(e),!0}catch{return!1}}function un(e){switch(typeof e){case`object`:return e===null||dn(e)||fn(e);case`string`:case`number`:case`boolean`:return!0;default:return!1}}function dn(e){return Array.isArray(e)?e.every(e=>un(e)):!1}function fn(e){if(!D(e))return!1;let t=Reflect.ownKeys(e);for(let n=0;n=0}function mn(e){return e instanceof Map}function P(e){return e==null}function hn(){return typeof process<`u`&&process?.versions?.node!=null}function gn(e){return e!=null}function _n(e){return e===null}function vn(e){return e instanceof Promise}function yn(e){return e instanceof RegExp}function bn(e){return e instanceof Set}function xn(e){return typeof e==`symbol`}function Sn(e){return e===void 0}function Cn(e){return e instanceof WeakMap}function wn(e){return e instanceof WeakSet}async function Tn(e){let t=Object.keys(e),n=await Promise.all(t.map(t=>e[t])),r={};for(let e=0;ee.toUpperCase()).join(`_`)}let An=new Map([[`Æ`,`Ae`],[`Ð`,`D`],[`Ø`,`O`],[`Þ`,`Th`],[`ß`,`ss`],[`æ`,`ae`],[`ð`,`d`],[`ø`,`o`],[`þ`,`th`],[`Đ`,`D`],[`đ`,`d`],[`Ħ`,`H`],[`ħ`,`h`],[`ı`,`i`],[`IJ`,`IJ`],[`ij`,`ij`],[`ĸ`,`k`],[`Ŀ`,`L`],[`ŀ`,`l`],[`Ł`,`L`],[`ł`,`l`],[`ʼn`,`'n`],[`Ŋ`,`N`],[`ŋ`,`n`],[`Œ`,`Oe`],[`œ`,`oe`],[`Ŧ`,`T`],[`ŧ`,`t`],[`ſ`,`s`]]);function jn(e){e=e.normalize(`NFD`);let t=``;for(let n=0;n=`̀`&&r<=`ͯ`||r>=`︠`&&r<=`︣`||(t+=An.get(r)??r)}return t}let Mn={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function Nn(e){return e.replace(/[&<>"']/g,e=>Mn[e])}function Pn(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`)}function Fn(e){return j(e).map(e=>e.toLowerCase()).join(`-`)}function In(e){return j(e).map(e=>e.toLowerCase()).join(` `)}function Ln(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function Rn(e,t,n=` `){return e.padStart(Math.floor((t-e.length)/2)+e.length,n).padEnd(t,n)}function zn(e){return j(e).map(e=>Wt(e)).join(``)}function Bn(e){return[...e].reverse().join(``)}function Vn(e,t){if(t===void 0)return e.trimEnd();let n=e.length;switch(typeof t){case`string`:if(t.length!==1)throw Error(`The 'chars' parameter should be a single character string.`);for(;n>0&&e[n-1]===t;)n--;break;case`object`:for(;n>0&&t.includes(e[n-1]);)n--}return e.substring(0,n)}function Hn(e,t){if(t===void 0)return e.trimStart();let n=0;switch(typeof t){case`string`:for(;n`,""":`"`,"'":`'`};function Gn(e){return e.replace(/&(?:amp|lt|gt|quot|#(0+)?39);/g,e=>Wn[e]||`'`)}function Kn(e){let t=j(e),n=``;for(let e=0;evoid 0)}function rr(e,t,n,r){if(t===e)return!0;switch(typeof t){case`object`:return ir(e,t,n,r);case`function`:return Object.keys(t).length>0?rr(e,{...t},n,r):N(e,t);default:return H(e)?typeof t==`string`?t===``:!0:N(e,t)}}function ir(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return or(e,t,n,r);if(t instanceof Map)return ar(e,t,n,r);if(t instanceof Set)return sr(e,t,n,r);let i=Object.keys(t);if(e==null||S(e))return i.length===0;if(i.length===0)return!0;if(r?.has(t))return r.get(t)===e;r?.set(t,e);try{for(let a=0;avoid 0)}function U(e){return e=It(e),t=>cr(t,e)}function lr(e,t){return Pt(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(C(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),E(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case mt:case pt:case ht:{let t=new e.constructor(e?.valueOf());return E(t,e),t}case gt:{let t={};return E(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function ur(e){return lr(e)}let dr=/^(?:0|[1-9]\d*)$/;function fr(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e!!t(e,n,r));case`object`:if(Array.isArray(t)&&t.length===2){let n=t[0],r=t[1];return u(e,W(n,r))}else return u(e,U(t));case`symbol`:case`number`:case`string`:return u(e,V(t))}}function wr(e,t=x){return I(e)?Tr(F(e),t):[]}function Tr(e,t){switch(typeof t){case`function`:return d(e,(e,n,r)=>!!t(e,n,r));case`object`:if(Array.isArray(t)&&t.length===2){let n=t[0],r=t[1];return d(e,W(n,r))}else return d(e,U(t));case`number`:case`symbol`:case`string`:return d(e,V(t))}}function Er(e,t=x){if(!e)return e;let n=I(e)||Array.isArray(e)?ct(0,e.length):Object.keys(e);for(let r=0;r=0;r--){let i=n[r],a=e[i];if(t(a,i,e)===!1)break}return e}function Y(e,t,n){return H(n)&&(typeof t==`number`&&I(n)&&fr(t)&&t=0;r--){let n=t[r],a=e[n];if(i(a,n,e))return a}return}return e.slice(0,n+1).findLast(i)}function Fr(e,t=x,n=e?e.length-1:0){if(!e)return-1;n=n<0?Math.max(e.length+n,0):Math.min(n,e.length-1);let r=F(e).slice(0,n+1);switch(typeof t){case`function`:return r.findLastIndex(t);case`object`:if(Array.isArray(t)&&t.length===2){let e=t[0],n=t[1];return r.findLastIndex(W(e,n))}else return r.findLastIndex(U(t));case`number`:case`symbol`:case`string`:return r.findLastIndex(V(t))}}function Ir(e){if(I(e))return re(F(e))}function Lr(e,t=1){let n=[],r=Math.floor(t);if(!I(e))return n;let i=(e,t)=>{for(let a=0;ae.length||t instanceof RegExp?!1:(n<0&&(n=Math.max(0,e.length+n)),e.includes(t,n));if(Array.isArray(e))return e.includes(t,n);let i=Object.keys(e);n<0&&(n=Math.max(0,i.length+n));for(let r=n;rn(e)):typeof n==`string`&&(r=oe(r,Array.from(i),V(n)))}return r}function Xr(e){return I(e)?Ee(Array.from(e)):[]}function Zr(e,...t){if(e==null)return[];let n=J(t),r=N,i=Xr;typeof n==`function`&&(r=n,i=Qr,t.pop());let a=i(Array.from(e));for(let e=0;e0&&(s=B(a,e))}else typeof t==`string`&&t.includes(`.`)&&(s=B(a,t.split(`.`).slice(0,-1).join(`.`)));i.push(o?.apply(s,n))}return i}function ei(e,t){return I(e)?Array.from(e).join(t):``}function ti(e,t=x,n){if(!e)return n;let r,i=0;I(e)?(r=ct(0,e.length),n==null&&e.length>0&&(n=e[0],i+=1)):(r=Object.keys(e),n??(n=e[r[0]],i+=1));for(let a=i;a{let r=n(t);return e[r]=t,e},{})}function ri(e,t,n){if(!I(e)||e.length===0)return-1;let r=e.length,i=n??r-1;if(n!=null&&(i=i<0?Math.max(r+i,0):Math.min(i,r-1)),Number.isNaN(t)){for(let t=i;t>=0;t--)if(Number.isNaN(e[t]))return t}return Array.from(e).lastIndexOf(t,i)}function ii(e,t=0){if(!(!q(e)||e.length===0))return t=b(t),t<0&&(t+=e.length),e[t]}function ai(e){return typeof e==`symbol`?1:e===null?2:e===void 0?3:e===e?0:4}let oi=(e,t,n)=>{if(e!==t){let r=ai(e),i=ai(t);if(r===i&&r===0){if(et)return n===`desc`?-1:1}return n===`desc`?i-r:r-i}return 0},si=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ci=/^\w*$/;function li(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||_(e)?!0:typeof e==`string`&&(ci.test(e)||!si.test(e))||t!=null&&Object.hasOwn(t,e)}function ui(e,t,n,r){if(e==null)return[];n=r?void 0:n,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(e=>String(e));let i=(e,t)=>{let n=e;for(let e=0;et==null||e==null?t:typeof e==`object`&&`key`in e?Object.hasOwn(t,e.key)?t[e.key]:i(t,e.path):typeof e==`function`?e(t):Array.isArray(e)?i(t,e):typeof t==`object`?t[e]:t,o=t.map(e=>(Array.isArray(e)&&e.length===1&&(e=e[0]),e==null||typeof e==`function`||Array.isArray(e)||li(e)?e:{key:e,path:z(e)}));return e.map(e=>({original:e,criteria:o.map(t=>a(t,e))})).slice().sort((e,t)=>{for(let r=0;re.original)}function di(e,t=x){if(!e)return[[],[]];let n=I(e)?e:Object.values(e);t=G(t);let r=[],i=[];for(let e=0;er(e))),a=0;for(let t=0;tN(e,t);let i=Array.isArray(t)?t:Array.from(t),a=i.includes(void 0);for(let t=0;tn(e[t],r))||(e[r++]=e[t]);continue}a||delete e[r++]}return e.length=r,e}function _i(e,...t){if(t.length===0)return[];let n=[];for(let e=0;efr(t,e.length)?Number(t):t).sort((e,t)=>t-e);for(let t of new Set(i)){if(fr(t,e.length)){Array.prototype.splice.call(e,t,1);continue}if(li(t,e)){delete e[L(t)];continue}vi(e,A(t)?t:z(t))}return r}function xi(e,t=x,n){if(!e)return n;let r,i;I(e)?(r=ct(0,e.length).reverse(),n==null&&e.length>0?(n=e[e.length-1],i=1):i=0):(r=Object.keys(e).reverse(),n==null?(n=e[r[0]],i=1):i=0);for(let a=i;a1&&Y(e,t[0],t[1])?t=[]:n>2&&Y(t[0],t[1],t[2])&&(t=[t[0]]),ui(e,g(t),[`asc`])}function Ri(e){return Number.isNaN(e)}function zi(e,t,n=X,r){if(Mi(e)||e.length===0)return 0;let i=0,a=e.length,o=G(n),s=o(t),c=Ri(s),l=_n(s),u=_(s),d=Sn(s);for(;i>>1,a=e[i];!_n(a)&&!xn(a)&&ae)}function Hi(e,t){if(!e?.length)return-1;let n=Vi(e,t);return n2147483647)return Ui(e,t,e=>e);let r=0;for(;r>>1,a=e[i];!_n(a)&&!xn(a)&&a<=t?r=i+1:n=i}return n}function Gi(e,t){if(!e?.length)return-1;let n=Wi(e,t)-1;return n>=0&&N(e[n],t)?n:-1}function Ki(e){return I(e)?Se(F(e)):[]}function qi(e,t=1,n){return t=n?1:b(t),t<1||!I(e)?[]:Ce(F(e),t)}function Ji(e,t=1,n){return t=n?1:b(t),t<=0||!I(e)?[]:we(F(e),t)}function Yi(e,t){if(!q(e))return[];let n=F(e),r=n.findLastIndex(Ue(G(t??x)));return n.slice(r+1)}function Xi(e,t){if(!q(e))return[];let n=F(e),r=n.findIndex(Si(G(t??X)));return r===-1?n:n.slice(0,r)}function Zi(...e){return Ee(Vr(e.filter(q),e=>Array.from(e),1))}function Qi(...e){let t=ue(e),n=_r(e);return q(t)||t==null?Ee(n):De(n,Re(G(t),1))}function $i(...e){let t=ue(e),n=_r(e);return q(t)||t==null?Ee(n):Oe(n,t)}function ea(e,t=x){return q(e)?De(Array.from(e),Re(G(t),1)):[]}function ta(e,t){return I(e)?typeof t==`function`?Oe(Array.from(e),(e,n)=>t(n,e)):Xr(Array.from(e)):[]}function na(e){return!q(e)||!e.length?[]:(e=A(e)?e:Array.from(e),e=e.filter(e=>q(e)),ke(e))}function ra(e,t){if(!q(e)||!e.length)return[];let n=A(e)?ke(e):ke(Array.from(e,e=>Array.from(e)));if(!t)return n;let r=Array(n.length);for(let e=0;eYr(e,t,n)),n),n)}function sa(...e){let t=J(e),n=(e,t)=>e===t;typeof t==`function`&&(n=t,e=e.slice(0,-1));let r=e.filter(q);return yr($i(...r,n),$i(...Ae(r,2).map(([e,t])=>Zr(e,t,n)),n),n)}function ca(...e){return e.length?Me(...e.filter(e=>q(e))):[]}let la=(e,t,n)=>{let r=e[t];(!(Object.hasOwn(e,t)&&N(r,n))||n===void 0&&!(t in e))&&(e[t]=n)};function ua(e=[],t=[]){let n={};for(let r=0;rn,()=>void 0)}function pa(e,t){let n={};if(!I(e))return n;I(t)||(t=[]);let r=Me(Array.from(e),Array.from(t));for(let e=0;et(...e))}function ha(e,t){if(typeof t!=`function`)throw TypeError(`Expected a function`);return e=b(e),function(...n){if(--e<1)return t.apply(this,n)}}function ga(e,t=e.length,n){return n&&(t=e.length),(Number.isNaN(t)||t<0)&&(t=0),Re(e,t)}function _a(e,...t){try{return e(...t)}catch(e){return e instanceof Error?e:Error(e)}}function va(e,t){if(typeof t!=`function`)throw TypeError(`Expected a function`);let n;return e=b(e),function(...r){return--e>0&&(n=t.apply(this,r)),e<=1&&t&&(t=void 0),n}}function ya(e,t,...n){let r=function(...i){let a=[],o=0;for(let e=0;ee===xa.placeholder),a=n.length-i.length;return ae===xa.placeholder),o=i.length-a.length;return i=Ca(i,n),oe===Ta.placeholder),a=n.length-i.length;return ae===Ta.placeholder),o=i.length-a.length;return i=Da(i,n),oe===Ta.placeholder).length,r=Math.max(e.length-n,0),i=[],a=0;for(let t=0;t=a)?(s=e.apply(this,t),c=Date.now(),l.cancel(),l.schedule(),s):(l.apply(this,t),s)};return u.cancel=l.cancel,u.flush=()=>(l.flush(),s),u}function Aa(e,...t){if(typeof e!=`function`)throw TypeError(`Expected a function`);return setTimeout(e,1,...t)}function ja(e,t,...n){if(typeof e!=`function`)throw TypeError(`Expected a function`);return setTimeout(e,v(t)||0,...n)}function Ma(e){return function(...t){return e.apply(this,t.reverse())}}function Na(...e){let t=g(e,1);if(t.some(e=>typeof e!=`function`))throw TypeError(`Expected a function`);return Ve(...t)}function Pa(...e){let t=g(e,1);if(t.some(e=>typeof e!=`function`))throw TypeError(`Expected a function`);return He(...t)}function Fa(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(`Expected a function`);let n=function(...r){let i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);let o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Fa.Cache||Map),n}Fa.Cache=Map;function Ia(e=0){return function(...t){return t.at(b(e))}}function La(e){return Ge(e)}function Ra(e,...t){if(typeof e!=`function`)throw TypeError(`Expected a function`);let n=t.flat();return function(...t){let r=Math.min(t.length,n.length),i=[...t];for(let e=0;et[e]).slice(0,t.length);for(let e=r.length;en&&([t,n]=[n,t]),t===n)?!1:nt(e,t,n)}function $a(e){if(!e||e.length===0)return;let t;for(let n=0;nt)&&(t=r)}return t}function eo(e,t){if(e!=null)return fe(Array.from(e),G(t??x))}function to(e,t){if(!e||!e.length)return 0;t!=null&&(t=G(t));let n;for(let r=0;rn&&([t,n]=[n,t]),t=Di(t,-(2**53-1),2**53-1),n=Di(n,-(2**53-1),2**53-1),t===n?t:r?ve(t,n+1):ye(t,n+1)}function uo(e,t,n){n&&typeof n!=`number`&&Y(e,t,n)&&(t=n=void 0),e=y(e),t===void 0?(t=e,e=0):t=y(t),n=n===void 0?e=0;t--)i[t]=e,e+=n;return i}function po(e,t=0){return Ja(`round`,e,t)}function mo(e,t){return e===void 0&&t===void 0?0:e===void 0||t===void 0?e??t:(typeof e==`string`||typeof t==`string`?(e=R(e),t=R(t)):(e=v(e),t=v(t)),e-t)}function ho(...e){}function go(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function Z(e){return lt(e)}function _o(e,t){if(e=b(e),e<1||!Number.isSafeInteger(e))return[];let n=Array(e);for(let r=0;re!==`constructor`):t}function vo(e){let t=_o(e.length,e=>`${e}`),n=new Set(t);w(e)&&(n.add(`offset`),n.add(`parent`)),Z(e)&&(n.add(`buffer`),n.add(`byteLength`),n.add(`byteOffset`));let r=Object.keys(e).filter(e=>!n.has(e));return Array.isArray(e)?[...t,...r]:[...t.filter(t=>Object.hasOwn(e,t)),...r]}function yo(e,...t){for(let n=0;ne!==`constructor`)}function Co(e){let t=_o(e.length,e=>`${e}`),n=new Set(t);w(e)&&(n.add(`offset`),n.add(`parent`)),Z(e)&&(n.add(`buffer`),n.add(`byteLength`),n.add(`byteOffset`));let r=xo(e).filter(e=>!n.has(e));return Array.isArray(e)?[...t,...r]:[...t.filter(t=>Object.hasOwn(e,t)),...r]}function wo(e,...t){for(let n=0;n0&&typeof e[0]==`string`&&Object.hasOwn(e,`index`)&&(t.index=e.index,t.input=e.input),t}if(Z(e)){let t=e,n=t.constructor;return new n(t.buffer,t.byteOffset,t.length)}if(t===`[object ArrayBuffer]`)return new ArrayBuffer(e.byteLength);if(t===`[object DataView]`){let t=e,n=t.buffer,r=t.byteOffset,i=t.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(n,r,i);return new Uint8Array(a).set(o),new DataView(a)}if(t===`[object Boolean]`||t===`[object Number]`||t===`[object String]`){let n=e.constructor,r=new n(e.valueOf());return t===`[object String]`?Po(r,e):Mo(r,e),r}if(t===`[object Date]`)return new Date(Number(e));if(t===`[object RegExp]`){let t=e,n=new RegExp(t.source,t.flags);return n.lastIndex=t.lastIndex,n}if(t===`[object Symbol]`)return Object(Symbol.prototype.valueOf.call(e));if(t===`[object Map]`){let t=e,n=new Map;return t.forEach((e,t)=>{n.set(t,e)}),n}if(t===`[object Set]`){let t=e,n=new Set;return t.forEach(e=>{n.add(e)}),n}if(t===`[object Arguments]`){let t=e,n={};return Mo(n,t),n.length=t.length,n[Symbol.iterator]=t[Symbol.iterator],n}let n={};return Fo(n,e),Mo(n,e),No(n,e),n}function jo(e){switch(C(e)){case gt:case xt:case St:case wt:case ht:case vt:case Mt:case Nt:case kt:case At:case jt:case yt:case mt:case Ct:case ft:case bt:case pt:case _t:case Tt:case Et:case Dt:case Ot:return!0;default:return!1}}function Mo(e,t){for(let n in t)Object.hasOwn(t,n)&&(e[n]=t[n])}function No(e,t){let n=Object.getOwnPropertySymbols(t);for(let r=0;r=n)&&(e[r]=t[r])}function Fo(e,t){let n=Object.getPrototypeOf(t);n!==null&&typeof t.constructor==`function`&&Object.setPrototypeOf(e,n)}function Io(e,t){if(!t)return Ao(e);let n=t(e);return n===void 0?Ao(e):n}function Lo(e,t){let n=H(e)?Object.create(e):{};if(t!=null){let e=Q(t);for(let r=0;r2?t[2]:void 0;i&&Y(t[0],t[1],i)&&(r=1);for(let i=0;in(e[t],t,e))}function Ko(e,t=x){if(e==null)return e;for(let n in e)if(t(e[n],n,e)===!1)break;return e}function qo(e,t=x){if(e==null)return e;let n=[];for(let t in e)n.push(t);for(let r=n.length-1;r>=0;r--){let i=n[r];if(t(e[i],i,e)===!1)break}return e}function Jo(e,t=x){if(e==null)return e;let n=Object(e),r=Q(e);for(let e=0;e=0;--e){let i=r[e];if(t(n[i],i,n)===!1)break}return e}function Xo(e){if(!I(e))return{};let t={};for(let n=0;ntypeof e[t]==`function`)}function Qo(e){if(e==null)return[];let t=[];for(let n in e)cn(e[n])&&t.push(n);return t}function $o(e,t){if(e==null)return!1;let n;if(n=Array.isArray(t)?t:typeof t==`string`&&er(t)&&e[t]==null?z(t):[t],n.length===0)return!1;let r=e;for(let e=0;eArray.isArray(e)||er(e))?ds(e):us(e)}function us(e){let t={},n=[...$(e),...ss(e)];for(let r=0;r{if(!M(e))return e})}return t}function fs(e,t){if(e==null)return{};let n={},r=G(t??X),i=[...$(e),...ss(e)];for(let t=0;tvoid 0,da(e,t,()=>n,i)}function vs(e,...t){return Ro(ur(e),...t)}function ys(e){let t=Array(e.size),n=e.keys(),r=e.values();for(let e=0;et(n,e,r,i)),n}function Ts(e,t,n){return da(e,t,n,()=>void 0)}function Es(e){let t=$(e),n=Array(t.length);for(let r=0;r=0}let ks=Function.prototype.toString,As=RegExp(`^${ks.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)}$`);function js(e){if(typeof e!=`function`)return!1;if(globalThis?.[`__core-js_shared__`]!=null)throw Error(`Unsupported core-js use. Try https://npms.io/search?q=ponyfill.`);return As.test(ks.call(e))}function Ms(e){return e===null}function Ns(e){return Sn(e)}function Ps(e,t){if(t==null)return!0;if(e==null)return Object.keys(t).length===0;let n=Object.keys(t);for(let r=0;re!==`constructor`).length===0:t.length===0}return!0}function Vs(e,t,n){return typeof n!=`function`&&(n=()=>void 0),nn(e,t,(...r)=>{let i=n(...r);if(i!==void 0)return!!i;if(e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set)return Vs(Array.from(e),Array.from(t),Le(2,n))})}function Hs(e){return C(e)===`[object Error]`}function Us(e){return Number.isFinite(e)}function Ws(e){return Number.isInteger(e)}function Gs(e){return yn(e)}function Ks(e){return Number.isSafeInteger(e)}function qs(e){return bn(e)}function Js(e){return Cn(e)}function Ys(e){return wn(e)}function Xs(e){return Wt(R(e))}function Zs(e,...t){if(e==null||!H(e)||A(e)&&t.length===0)return e;let n=[];for(let e=0;euc?``:R(e).repeat(t)}function fc(e,t,n){return arguments.length<3?R(e):R(e).replace(t,n)}function pc(e){return Yt($s(Qs(e)))}function mc(e,t,n){return R(e).split(t,n)}function hc(e){let t=j($s(Qs(e)).trim()),n=``;for(let e=0;e/g,Cc={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:Sc,variable:``,imports:{_:{escape:nc,template:wc}}};function wc(e,t,n){e=R(e),n&&(t=Cc),t=Ro({...t},Cc);let r=new RegExp([t.escape?.source??yc.source,t.interpolate?.source??yc.source,t.interpolate===Sc?_c.source:yc.source,t.evaluate?.source??yc.source,`$`].join(`|`),`g`),i=0,a=!1,o=`__p += ''`;for(let t of e.matchAll(r)){let[n,r,s,c,l]=t,{index:u}=t;o+=` + '${e.slice(i,u).replace(vc,xc)}'`,r&&(o+=` + _.escape(${r})`),s?o+=` + ((${s}) == null ? '' : ${s})`:c&&(o+=` + ((${c}) == null ? '' : ${c})`),l&&(o+=`;\n${l};\n __p += ''`,a=!0),i=u+n.length}let s=Ro({...t.imports},Cc.imports),c=Object.keys(s),l=Object.values(s),u=`//# sourceURL=${t.sourceURL?String(t.sourceURL).replace(/[\r\n]/g,` `):`es-toolkit.templateSource[${Date.now()}]`}\n`,d=`function(${t.variable||`obj`}) { + let __p = ''; + ${t.variable?``:`if (obj == null) { obj = {}; }`} + ${a?`function print() { __p += Array.prototype.join.call(arguments, ''); }`:``} + ${t.variable?o:`with(obj) {\n${o}\n}`} + return __p; + }`,f=_a(()=>Function(...c,`${u}return ${d}`)(...l));if(f.source=d,f instanceof Error)throw f;return f}function Tc(e){return R(e).toLowerCase()}function Ec(e){return R(e).toUpperCase()}function Dc(e,t,n){if(e==null)return``;if(n!=null||t==null)return e.toString().trim();switch(typeof t){case`object`:return Array.isArray(t)?Un(e,t.flatMap(e=>e.toString().split(``))):Un(e,t.toString().split(``));default:return Un(e,t.toString().split(``))}}function Oc(e,t,n){return e==null?``:n!=null||t==null?e.toString().trimEnd():Vn(e,t.toString().split(``))}function kc(e,t,n){return e==null?``:n!=null||t==null?e.toString().trimStart():Hn(e,t.toString().split(``))}let Ac=/[\u200d\ud800-\udfff\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff\ufe0e\ufe0f]/;function jc(e,t){e=e==null?``:`${e}`;let n=30,r=`...`;H(t)&&(n=Mc(t.length),r=`omission`in t?`${t.omission}`:`...`);let i=e.length,a=Array.from(r).length,o=Math.max(n-a,0),s;if(Ac.test(e)&&(s=Array.from(e),i=s.length),n>=i)return e;if(i<=a)return r;let c=s===void 0?e.slice(0,o):s?.slice(0,o).join(``),l=t?.separator;if(!l)return c+=r,c;let u=l instanceof RegExp?l.source:l,d=`u`+(l instanceof RegExp?l.flags.replace(`u`,``):``),f=RegExp(`(?.*(?:(?!${u}).))(?:${u})`,d).exec(c);return(f?.groups?f.groups.result:c)+r}function Mc(e){return e==null?30:e<=0?0:e}function Nc(e){return Gn(R(e))}function Pc(e){return Kn($s(Qs(e)))}function Fc(e){return qn(R(e))}let Ic=`\\p{Lu}`,Lc=`\\p{Ll}`,Rc=`(?:[\\p{Lm}\\p{Lo}]\\p{M}*)`,zc=`(?:['’](?:d|ll|m|re|s|t|ve))?`,Bc=`(?:['’](?:D|LL|M|RE|S|T|VE))?`,Vc=`[\\p{Z}\\p{P}\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\xd7\\xf7]`,Hc=`(?:${Ic}|${Rc})`,Uc=`(?:${Lc}|${Rc})`,Wc=RegExp([`${Ic}?${Lc}+${zc}(?=${Vc}|${Ic}|$)`,`${Hc}+${Bc}(?=${Vc}|${Ic}${Uc}|$)`,`${Ic}?${Uc}+${zc}`,`${Ic}+${Bc}`,`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,`\\d+`,`\\p{Emoji_Presentation}`,`\\p{Extended_Pictographic}`].join(`|`),`gu`);function Gc(e,t=Wc,n){let r=R(e);return n&&(t=Wc),typeof t==`number`&&(t=t.toString()),Array.from(r.match(t)??[]).filter(e=>e!==``)}function Kc(e){let t=e.length,n=e.map(e=>{let t=e[0],n=e[1];if(!cn(n))throw TypeError(`Expected a function`);return[G(t),n]});return function(...e){for(let r=0;re}function Jc(e,t){return e==null||Number.isNaN(e)?t:e}function Yc(e,t){return typeof e==`string`&&typeof t==`string`?e>t:v(e)>v(t)}function Xc(e,t){return typeof e==`string`&&typeof t==`string`?e>=t:v(e)>=v(t)}function Zc(e,t,...n){if(n=n.flat(1),e!=null)switch(typeof t){case`string`:return typeof e==`object`&&Object.hasOwn(e,t)?Qc(e,[t],n):Qc(e,z(t),n);case`number`:case`symbol`:return Qc(e,[t],n);default:return Array.isArray(t)?Qc(e,t,n):Qc(e,[t],n)}}function Qc(e,t,n){let r=B(e,t.slice(0,-1),e);if(r==null)return;let i=J(t),a=i?.valueOf();return i=typeof a==`number`?L(a):String(i),B(r,i)?.apply(r,n)}function $c(e,t){return typeof e==`string`&&typeof t==`string`?eG(e));return function(...e){return t.map(t=>t.apply(this,e))}}function al(...e){return function(...t){for(let n=0;n = (value: T, index: number, collection: T[]) => R; +//#endregion +export { ArrayIterator }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ArrayIterator.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ArrayIterator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..78fec16c7fc5acb17eb380dd8f8f764dbe01f2b0 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ArrayIterator.d.ts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/ArrayIterator.d.ts +type ArrayIterator = (value: T, index: number, collection: T[]) => R; +//#endregion +export { ArrayIterator }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ConformsPredicateObject.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ConformsPredicateObject.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..c2f238b62c3a1d724b1925f3c71067a1cd3d362b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ConformsPredicateObject.d.mts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/ConformsPredicateObject.d.ts +type ConformsPredicateObject = { [P in keyof T]: T[P] extends ((arg: infer A) => any) ? A : any }; +//#endregion +export { ConformsPredicateObject }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ConformsPredicateObject.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ConformsPredicateObject.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c2f238b62c3a1d724b1925f3c71067a1cd3d362b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ConformsPredicateObject.d.ts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/ConformsPredicateObject.d.ts +type ConformsPredicateObject = { [P in keyof T]: T[P] extends ((arg: infer A) => any) ? A : any }; +//#endregion +export { ConformsPredicateObject }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/EmptyObjectOf.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/EmptyObjectOf.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..94e2c00570cb2047e970e7f4a8c67c48f8d80c6c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/EmptyObjectOf.d.mts @@ -0,0 +1,5 @@ +//#region src/compat/_internal/EmptyObjectOf.d.ts +type EmptyObject = { [K in keyof T]?: never }; +type EmptyObjectOf = EmptyObject extends T ? EmptyObject : never; +//#endregion +export { EmptyObjectOf }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/EmptyObjectOf.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/EmptyObjectOf.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..94e2c00570cb2047e970e7f4a8c67c48f8d80c6c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/EmptyObjectOf.d.ts @@ -0,0 +1,5 @@ +//#region src/compat/_internal/EmptyObjectOf.d.ts +type EmptyObject = { [K in keyof T]?: never }; +type EmptyObjectOf = EmptyObject extends T ? EmptyObject : never; +//#endregion +export { EmptyObjectOf }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/Equals.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/Equals.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..e8a8b266910c4d3c16dc105e0f44bb3e96e15d93 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/Equals.d.mts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/Equals.d.ts +type Equals = (() => X extends T ? 1 : 2) extends (() => X extends U ? 1 : 2) ? true : false; +//#endregion +export { Equals }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/Equals.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/Equals.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e8a8b266910c4d3c16dc105e0f44bb3e96e15d93 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/Equals.d.ts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/Equals.d.ts +type Equals = (() => X extends T ? 1 : 2) extends (() => X extends U ? 1 : 2) ? true : false; +//#endregion +export { Equals }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/GetFieldType.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/GetFieldType.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..9810fa47393ef29293d7a39fa7aaf352572c9ebc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/GetFieldType.d.mts @@ -0,0 +1,13 @@ +//#region src/compat/_internal/GetFieldType.d.ts +type GetFieldTypeOfArrayLikeByKey = K extends number ? T[K] : K extends `${infer N extends number}` ? T[N] : K extends keyof T ? T[K] : undefined; +type GetFieldTypeOfStringByKey = K extends number ? T[K] : K extends `${infer N extends number}` ? T[N] : K extends keyof T ? T[K] : undefined; +type GetFieldTypeOfNarrowedByKey = T extends unknown[] ? GetFieldTypeOfArrayLikeByKey : T extends string ? GetFieldTypeOfStringByKey : K extends keyof T ? T[K] : K extends number ? `${K}` extends keyof T ? T[`${K}`] : undefined : K extends `${infer N extends number}` ? N extends keyof T ? T[N] : undefined : undefined; +type GetFieldTypeOfNarrowedByDotPath = P extends `${infer L}.${infer R}` ? GetFieldType, R, 'DotPath'> : GetFieldTypeOfNarrowedByKey; +type GetFieldTypeOfNarrowedByLcKR = '' extends R ? GetFieldType, K, 'Key'> : R extends `.${infer Rc}` ? GetFieldType, K, 'Key'>, Rc> : GetFieldType, K, 'Key'>, R>; +type GetFieldTypeOfNarrowedByLKR = '' extends L ? '' extends R ? GetFieldTypeOfNarrowedByKey : R extends `.${infer Rc}` ? GetFieldType, Rc> : GetFieldType, R> : L extends `${infer Lc}.` ? GetFieldTypeOfNarrowedByLcKR : GetFieldTypeOfNarrowedByLcKR; +type GetFieldTypeOfNarrowed = XT extends 'Key' ? GetFieldTypeOfNarrowedByKey : XT extends 'DotPath' ? GetFieldTypeOfNarrowedByDotPath : X extends `${infer L}['${infer K}']${infer R}` ? GetFieldTypeOfNarrowedByLKR : X extends `${infer L}["${infer K}"]${infer R}` ? GetFieldTypeOfNarrowedByLKR : X extends `${infer L}[${infer K}]${infer R}` ? GetFieldTypeOfNarrowedByLKR : GetFieldTypeOfNarrowedByDotPath; +type GetFieldTypeOfObject = Extract extends never ? GetFieldTypeOfNarrowed : GetFieldTypeOfNarrowed, X, XT> | GetFieldTypeOfNarrowed, X, XT>; +type GetFieldTypeOfPrimitive = Extract extends never ? T extends never ? never : undefined : (Exclude extends never ? never : undefined) | GetFieldTypeOfNarrowed, X, XT>; +type GetFieldType = Extract extends never ? GetFieldTypeOfPrimitive : GetFieldTypeOfPrimitive, X, XT> | GetFieldTypeOfObject, X, XT>; +//#endregion +export { GetFieldType }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/GetFieldType.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/GetFieldType.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9810fa47393ef29293d7a39fa7aaf352572c9ebc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/GetFieldType.d.ts @@ -0,0 +1,13 @@ +//#region src/compat/_internal/GetFieldType.d.ts +type GetFieldTypeOfArrayLikeByKey = K extends number ? T[K] : K extends `${infer N extends number}` ? T[N] : K extends keyof T ? T[K] : undefined; +type GetFieldTypeOfStringByKey = K extends number ? T[K] : K extends `${infer N extends number}` ? T[N] : K extends keyof T ? T[K] : undefined; +type GetFieldTypeOfNarrowedByKey = T extends unknown[] ? GetFieldTypeOfArrayLikeByKey : T extends string ? GetFieldTypeOfStringByKey : K extends keyof T ? T[K] : K extends number ? `${K}` extends keyof T ? T[`${K}`] : undefined : K extends `${infer N extends number}` ? N extends keyof T ? T[N] : undefined : undefined; +type GetFieldTypeOfNarrowedByDotPath = P extends `${infer L}.${infer R}` ? GetFieldType, R, 'DotPath'> : GetFieldTypeOfNarrowedByKey; +type GetFieldTypeOfNarrowedByLcKR = '' extends R ? GetFieldType, K, 'Key'> : R extends `.${infer Rc}` ? GetFieldType, K, 'Key'>, Rc> : GetFieldType, K, 'Key'>, R>; +type GetFieldTypeOfNarrowedByLKR = '' extends L ? '' extends R ? GetFieldTypeOfNarrowedByKey : R extends `.${infer Rc}` ? GetFieldType, Rc> : GetFieldType, R> : L extends `${infer Lc}.` ? GetFieldTypeOfNarrowedByLcKR : GetFieldTypeOfNarrowedByLcKR; +type GetFieldTypeOfNarrowed = XT extends 'Key' ? GetFieldTypeOfNarrowedByKey : XT extends 'DotPath' ? GetFieldTypeOfNarrowedByDotPath : X extends `${infer L}['${infer K}']${infer R}` ? GetFieldTypeOfNarrowedByLKR : X extends `${infer L}["${infer K}"]${infer R}` ? GetFieldTypeOfNarrowedByLKR : X extends `${infer L}[${infer K}]${infer R}` ? GetFieldTypeOfNarrowedByLKR : GetFieldTypeOfNarrowedByDotPath; +type GetFieldTypeOfObject = Extract extends never ? GetFieldTypeOfNarrowed : GetFieldTypeOfNarrowed, X, XT> | GetFieldTypeOfNarrowed, X, XT>; +type GetFieldTypeOfPrimitive = Extract extends never ? T extends never ? never : undefined : (Exclude extends never ? never : undefined) | GetFieldTypeOfNarrowed, X, XT>; +type GetFieldType = Extract extends never ? GetFieldTypeOfPrimitive : GetFieldTypeOfPrimitive, X, XT> | GetFieldTypeOfObject, X, XT>; +//#endregion +export { GetFieldType }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IsEqualCustomizer.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IsEqualCustomizer.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..c13f1f46cea8e1285442015edd2c6c4702769eba --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IsEqualCustomizer.d.mts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/IsEqualCustomizer.d.ts +type IsEqualCustomizer = (value: any, other: any, indexOrKey: PropertyKey | undefined, parent: any, otherParent: any, stack: any) => boolean | undefined; +//#endregion +export { IsEqualCustomizer }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IsEqualCustomizer.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IsEqualCustomizer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c13f1f46cea8e1285442015edd2c6c4702769eba --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IsEqualCustomizer.d.ts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/IsEqualCustomizer.d.ts +type IsEqualCustomizer = (value: any, other: any, indexOrKey: PropertyKey | undefined, parent: any, otherParent: any, stack: any) => boolean | undefined; +//#endregion +export { IsEqualCustomizer }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IsMatchWithCustomizer.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IsMatchWithCustomizer.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..7a7114d7c5df7343a6862c5d20a1f9293855a5e2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IsMatchWithCustomizer.d.mts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/IsMatchWithCustomizer.d.ts +type IsMatchWithCustomizer = (value: any, other: any, indexOrKey: PropertyKey, object: object, source: object) => boolean | undefined; +//#endregion +export { IsMatchWithCustomizer }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IsMatchWithCustomizer.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IsMatchWithCustomizer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7a7114d7c5df7343a6862c5d20a1f9293855a5e2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IsMatchWithCustomizer.d.ts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/IsMatchWithCustomizer.d.ts +type IsMatchWithCustomizer = (value: any, other: any, indexOrKey: PropertyKey, object: object, source: object) => boolean | undefined; +//#endregion +export { IsMatchWithCustomizer }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IsWritable.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IsWritable.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..43a46a87f1c9573d5a7d8aafec56289ce21ee09b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IsWritable.d.mts @@ -0,0 +1,6 @@ +import { Equals } from "./Equals.mjs"; + +//#region src/compat/_internal/IsWritable.d.ts +type IsWritable = Equals<{ [K in keyof T]: T[K] }, { -readonly [K in keyof T]: T[K] }>; +//#endregion +export { IsWritable }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IsWritable.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IsWritable.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e44e9feb7b488db04a13084d56784eaad203f87e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IsWritable.d.ts @@ -0,0 +1,6 @@ +import { Equals } from "./Equals.js"; + +//#region src/compat/_internal/IsWritable.d.ts +type IsWritable = Equals<{ [K in keyof T]: T[K] }, { -readonly [K in keyof T]: T[K] }>; +//#endregion +export { IsWritable }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IterateeShorthand.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IterateeShorthand.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..a886b139299386769eb31dd796c4f802551c686a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IterateeShorthand.d.mts @@ -0,0 +1,6 @@ +import { PartialShallow } from "./PartialShallow.mjs"; + +//#region src/compat/_internal/IterateeShorthand.d.ts +type IterateeShorthand = PropertyKey | [PropertyKey, any] | PartialShallow; +//#endregion +export { IterateeShorthand }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IterateeShorthand.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IterateeShorthand.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1030890638056c9d9dac60bde778430494ffe54c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/IterateeShorthand.d.ts @@ -0,0 +1,6 @@ +import { PartialShallow } from "./PartialShallow.js"; + +//#region src/compat/_internal/IterateeShorthand.d.ts +type IterateeShorthand = PropertyKey | [PropertyKey, any] | PartialShallow; +//#endregion +export { IterateeShorthand }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIteratee.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIteratee.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..3fc27821a60459c6b9c5719e806c469df7675ba0 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIteratee.d.mts @@ -0,0 +1,6 @@ +import { PartialShallow } from "./PartialShallow.mjs"; + +//#region src/compat/_internal/ListIteratee.d.ts +type ListIteratee = ((value: T, index: number, collection: ArrayLike) => unknown) | (PropertyKey | [PropertyKey, any] | PartialShallow); +//#endregion +export { ListIteratee }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIteratee.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIteratee.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8ce28214685f07d5e1217cf019610b08900bbc60 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIteratee.d.ts @@ -0,0 +1,6 @@ +import { PartialShallow } from "./PartialShallow.js"; + +//#region src/compat/_internal/ListIteratee.d.ts +type ListIteratee = ((value: T, index: number, collection: ArrayLike) => unknown) | (PropertyKey | [PropertyKey, any] | PartialShallow); +//#endregion +export { ListIteratee }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIterateeCustom.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIterateeCustom.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..9912e96e2e898c0bb5cac46e97e14f85ffd4ee11 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIterateeCustom.d.mts @@ -0,0 +1,6 @@ +import { PartialShallow } from "./PartialShallow.mjs"; + +//#region src/compat/_internal/ListIterateeCustom.d.ts +type ListIterateeCustom = ((value: T, index: number, collection: ArrayLike) => R) | (PropertyKey | [PropertyKey, any] | PartialShallow); +//#endregion +export { ListIterateeCustom }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIterateeCustom.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIterateeCustom.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..99bdb8fd8138886cdb88c876761bc032b0d59bac --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIterateeCustom.d.ts @@ -0,0 +1,6 @@ +import { PartialShallow } from "./PartialShallow.js"; + +//#region src/compat/_internal/ListIterateeCustom.d.ts +type ListIterateeCustom = ((value: T, index: number, collection: ArrayLike) => R) | (PropertyKey | [PropertyKey, any] | PartialShallow); +//#endregion +export { ListIterateeCustom }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIterator.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIterator.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..ddcfcadf9f57d62e873b728dc34189b878f22c31 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIterator.d.mts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/ListIterator.d.ts +type ListIterator = (value: T, index: number, collection: ArrayLike) => R; +//#endregion +export { ListIterator }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIterator.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIterator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ddcfcadf9f57d62e873b728dc34189b878f22c31 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIterator.d.ts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/ListIterator.d.ts +type ListIterator = (value: T, index: number, collection: ArrayLike) => R; +//#endregion +export { ListIterator }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIteratorTypeGuard.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIteratorTypeGuard.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..421b42a6f40596f2c73c44fc05fa74d2a5357ca1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIteratorTypeGuard.d.mts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/ListIteratorTypeGuard.d.ts +type ListIteratorTypeGuard = (value: T, index: number, collection: ArrayLike) => value is S; +//#endregion +export { ListIteratorTypeGuard }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIteratorTypeGuard.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIteratorTypeGuard.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..421b42a6f40596f2c73c44fc05fa74d2a5357ca1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListIteratorTypeGuard.d.ts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/ListIteratorTypeGuard.d.ts +type ListIteratorTypeGuard = (value: T, index: number, collection: ArrayLike) => value is S; +//#endregion +export { ListIteratorTypeGuard }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListOfRecursiveArraysOrValues.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListOfRecursiveArraysOrValues.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..2810ae9324fb31a19bc29b74cae97c6fa50537e2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListOfRecursiveArraysOrValues.d.mts @@ -0,0 +1,6 @@ +import { RecursiveArray } from "./RecursiveArray.mjs"; + +//#region src/compat/_internal/ListOfRecursiveArraysOrValues.d.ts +interface ListOfRecursiveArraysOrValues extends ArrayLike> {} +//#endregion +export { ListOfRecursiveArraysOrValues }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListOfRecursiveArraysOrValues.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListOfRecursiveArraysOrValues.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2b8db9b7cd91167909be5c32e5895e24f950f1d4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ListOfRecursiveArraysOrValues.d.ts @@ -0,0 +1,6 @@ +import { RecursiveArray } from "./RecursiveArray.js"; + +//#region src/compat/_internal/ListOfRecursiveArraysOrValues.d.ts +interface ListOfRecursiveArraysOrValues extends ArrayLike> {} +//#endregion +export { ListOfRecursiveArraysOrValues }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MAX_ARRAY_LENGTH.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MAX_ARRAY_LENGTH.js new file mode 100644 index 0000000000000000000000000000000000000000..7784d549697b9821319a6365554ecf66f5a01da1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MAX_ARRAY_LENGTH.js @@ -0,0 +1,4 @@ +//#region src/compat/_internal/MAX_ARRAY_LENGTH.ts +const MAX_ARRAY_LENGTH = 4294967295; +//#endregion +exports.MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MAX_ARRAY_LENGTH.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MAX_ARRAY_LENGTH.mjs new file mode 100644 index 0000000000000000000000000000000000000000..6cc42fd309f363f3d480f95db326fa73a8f65dcb --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MAX_ARRAY_LENGTH.mjs @@ -0,0 +1,4 @@ +//#region src/compat/_internal/MAX_ARRAY_LENGTH.ts +const MAX_ARRAY_LENGTH = 4294967295; +//#endregion +export { MAX_ARRAY_LENGTH }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MAX_SAFE_INTEGER.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MAX_SAFE_INTEGER.js new file mode 100644 index 0000000000000000000000000000000000000000..b2685f7e08720e009f2c2d0f926f360136603ce0 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MAX_SAFE_INTEGER.js @@ -0,0 +1,4 @@ +//#region src/compat/_internal/MAX_SAFE_INTEGER.ts +const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER; +//#endregion +exports.MAX_SAFE_INTEGER = MAX_SAFE_INTEGER; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MAX_SAFE_INTEGER.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MAX_SAFE_INTEGER.mjs new file mode 100644 index 0000000000000000000000000000000000000000..942fd4f7d75fc82879219ba07f8aaec4ba4a9320 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MAX_SAFE_INTEGER.mjs @@ -0,0 +1,4 @@ +//#region src/compat/_internal/MAX_SAFE_INTEGER.ts +const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER; +//#endregion +export { MAX_SAFE_INTEGER }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/Many.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/Many.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..fc7645f22de8baf3a3c20c19808adcb07d4332cc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/Many.d.mts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/Many.d.ts +type Many = T | readonly T[]; +//#endregion +export { Many }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/Many.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/Many.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc7645f22de8baf3a3c20c19808adcb07d4332cc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/Many.d.ts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/Many.d.ts +type Many = T | readonly T[]; +//#endregion +export { Many }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MemoListIterator.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MemoListIterator.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..d8c1c6ec6094e91066c377689a911faa83487489 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MemoListIterator.d.mts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/MemoListIterator.d.ts +type MemoListIterator = (prev: R, curr: T, index: number, list: A) => R; +//#endregion +export { MemoListIterator }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MemoListIterator.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MemoListIterator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d8c1c6ec6094e91066c377689a911faa83487489 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MemoListIterator.d.ts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/MemoListIterator.d.ts +type MemoListIterator = (prev: R, curr: T, index: number, list: A) => R; +//#endregion +export { MemoListIterator }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MemoObjectIterator.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MemoObjectIterator.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..ff39fa6111f0af3a3d034be726f2c9e7785c9f77 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MemoObjectIterator.d.mts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/MemoObjectIterator.d.ts +type MemoObjectIterator = (prev: R, curr: T, key: string, list: A) => R; +//#endregion +export { MemoObjectIterator }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MemoObjectIterator.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MemoObjectIterator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ff39fa6111f0af3a3d034be726f2c9e7785c9f77 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MemoObjectIterator.d.ts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/MemoObjectIterator.d.ts +type MemoObjectIterator = (prev: R, curr: T, key: string, list: A) => R; +//#endregion +export { MemoObjectIterator }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MutableList.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MutableList.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..d10dc114dadc0e208bde6c36ca75ca3d36771900 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MutableList.d.mts @@ -0,0 +1,7 @@ +//#region src/compat/_internal/MutableList.d.ts +interface MutableList { + length: number; + [k: number]: T; +} +//#endregion +export { MutableList }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MutableList.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MutableList.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d10dc114dadc0e208bde6c36ca75ca3d36771900 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/MutableList.d.ts @@ -0,0 +1,7 @@ +//#region src/compat/_internal/MutableList.d.ts +interface MutableList { + length: number; + [k: number]: T; +} +//#endregion +export { MutableList }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ObjectIteratee.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ObjectIteratee.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..66b44b63e05778335af83578fb267c1220360a0d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ObjectIteratee.d.mts @@ -0,0 +1,8 @@ +import { ObjectIterator } from "./ObjectIterator.mjs"; +import { IterateeShorthand } from "./IterateeShorthand.mjs"; + +//#region src/compat/_internal/ObjectIteratee.d.ts +type ObjectIteratee = ObjectIterator | IterateeShorthand; +type ObjectIterateeCustom = ObjectIterator | IterateeShorthand; +//#endregion +export { ObjectIteratee, ObjectIterateeCustom }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ObjectIteratee.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ObjectIteratee.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2cd5edf90730123f503936c9b9b6f3ab76090023 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ObjectIteratee.d.ts @@ -0,0 +1,8 @@ +import { ObjectIterator } from "./ObjectIterator.js"; +import { IterateeShorthand } from "./IterateeShorthand.js"; + +//#region src/compat/_internal/ObjectIteratee.d.ts +type ObjectIteratee = ObjectIterator | IterateeShorthand; +type ObjectIterateeCustom = ObjectIterator | IterateeShorthand; +//#endregion +export { ObjectIteratee, ObjectIterateeCustom }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ObjectIterator.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ObjectIterator.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..a4ffda1f0e19a4de7913dbdb1ca6540a7d2b2c65 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ObjectIterator.d.mts @@ -0,0 +1,5 @@ +//#region src/compat/_internal/ObjectIterator.d.ts +type ObjectIterator = (value: T[keyof T], key: string, collection: T) => R; +type ObjectIteratorTypeGuard = (value: T[keyof T], key: string, collection: T) => value is U; +//#endregion +export { ObjectIterator, ObjectIteratorTypeGuard }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ObjectIterator.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ObjectIterator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a4ffda1f0e19a4de7913dbdb1ca6540a7d2b2c65 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ObjectIterator.d.ts @@ -0,0 +1,5 @@ +//#region src/compat/_internal/ObjectIterator.d.ts +type ObjectIterator = (value: T[keyof T], key: string, collection: T) => R; +type ObjectIteratorTypeGuard = (value: T[keyof T], key: string, collection: T) => value is U; +//#endregion +export { ObjectIterator, ObjectIteratorTypeGuard }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/PartialShallow.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/PartialShallow.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..a24ea20bf2d0ee91602cf90353520915f0920b00 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/PartialShallow.d.mts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/PartialShallow.d.ts +type PartialShallow = { [P in keyof T]?: T[P] extends object ? object : T[P] }; +//#endregion +export { PartialShallow }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/PartialShallow.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/PartialShallow.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a24ea20bf2d0ee91602cf90353520915f0920b00 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/PartialShallow.d.ts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/PartialShallow.d.ts +type PartialShallow = { [P in keyof T]?: T[P] extends object ? object : T[P] }; +//#endregion +export { PartialShallow }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/PropertyPath.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/PropertyPath.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..e5925cda5aced6b772374f75480438b0d635aa10 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/PropertyPath.d.mts @@ -0,0 +1,6 @@ +import { Many } from "./Many.mjs"; + +//#region src/compat/_internal/PropertyPath.d.ts +type PropertyPath = Many; +//#endregion +export { PropertyPath }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/PropertyPath.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/PropertyPath.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..adfcc9f069dcc3878623d178ae7d3890323c75df --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/PropertyPath.d.ts @@ -0,0 +1,6 @@ +import { Many } from "./Many.js"; + +//#region src/compat/_internal/PropertyPath.d.ts +type PropertyPath = Many; +//#endregion +export { PropertyPath }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/RecursiveArray.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/RecursiveArray.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..740bf4d43c0d7c14338a6b307c2f2c617887f200 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/RecursiveArray.d.mts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/RecursiveArray.d.ts +interface RecursiveArray extends Array> {} +//#endregion +export { RecursiveArray }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/RecursiveArray.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/RecursiveArray.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..740bf4d43c0d7c14338a6b307c2f2c617887f200 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/RecursiveArray.d.ts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/RecursiveArray.d.ts +interface RecursiveArray extends Array> {} +//#endregion +export { RecursiveArray }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/RejectReadonly.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/RejectReadonly.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..068f5348e6ce4b1ddbeeb9cb6c4cf91976608147 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/RejectReadonly.d.mts @@ -0,0 +1,7 @@ +import { MutableList } from "./MutableList.mjs"; +import { IsWritable } from "./IsWritable.mjs"; + +//#region src/compat/_internal/RejectReadonly.d.ts +type RejectReadonly> = IsWritable extends true ? T : never; +//#endregion +export { RejectReadonly }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/RejectReadonly.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/RejectReadonly.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ed451304446fbe5d323dd3922178ba0581ed049a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/RejectReadonly.d.ts @@ -0,0 +1,7 @@ +import { MutableList } from "./MutableList.js"; +import { IsWritable } from "./IsWritable.js"; + +//#region src/compat/_internal/RejectReadonly.d.ts +type RejectReadonly> = IsWritable extends true ? T : never; +//#endregion +export { RejectReadonly }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/StringIterator.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/StringIterator.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..70025dabab903eba2d8448e293e09ec4beda5b42 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/StringIterator.d.mts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/StringIterator.d.ts +type StringIterator = (char: string, index: number, string: string) => R; +//#endregion +export { StringIterator }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/StringIterator.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/StringIterator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..70025dabab903eba2d8448e293e09ec4beda5b42 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/StringIterator.d.ts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/StringIterator.d.ts +type StringIterator = (char: string, index: number, string: string) => R; +//#endregion +export { StringIterator }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/TupleIterator.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/TupleIterator.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..bace2c22bb5d335c006f83dac8e2ba37c9737a04 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/TupleIterator.d.mts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/TupleIterator.d.ts +type TupleIterator = (value: T[number], index: T extends `${infer N extends number}` ? N : never, collection: T) => TResult; +//#endregion +export { TupleIterator }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/TupleIterator.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/TupleIterator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bace2c22bb5d335c006f83dac8e2ba37c9737a04 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/TupleIterator.d.ts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/TupleIterator.d.ts +type TupleIterator = (value: T[number], index: T extends `${infer N extends number}` ? N : never, collection: T) => TResult; +//#endregion +export { TupleIterator }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueIteratee.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueIteratee.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..0978a63d0b34c295a79863bd64e8939a845298f2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueIteratee.d.mts @@ -0,0 +1,6 @@ +import { PartialShallow } from "./PartialShallow.mjs"; + +//#region src/compat/_internal/ValueIteratee.d.ts +type ValueIteratee = ((value: T) => unknown) | (PropertyKey | [PropertyKey, any] | PartialShallow); +//#endregion +export { ValueIteratee }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueIteratee.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueIteratee.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..beafc5fd55ae1a9a61f1dbaf16ec5314d0317cf6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueIteratee.d.ts @@ -0,0 +1,6 @@ +import { PartialShallow } from "./PartialShallow.js"; + +//#region src/compat/_internal/ValueIteratee.d.ts +type ValueIteratee = ((value: T) => unknown) | (PropertyKey | [PropertyKey, any] | PartialShallow); +//#endregion +export { ValueIteratee }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueIterateeCustom.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueIterateeCustom.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..cefd08e6b7a2ca9132c1431884cffc0567149197 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueIterateeCustom.d.mts @@ -0,0 +1,6 @@ +import { IterateeShorthand } from "./IterateeShorthand.mjs"; + +//#region src/compat/_internal/ValueIterateeCustom.d.ts +type ValueIterateeCustom = ((value: T) => TResult) | IterateeShorthand; +//#endregion +export { ValueIterateeCustom }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueIterateeCustom.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueIterateeCustom.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ebfa2e5e9d015f997f1e6ec89d191a7581187c6b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueIterateeCustom.d.ts @@ -0,0 +1,6 @@ +import { IterateeShorthand } from "./IterateeShorthand.js"; + +//#region src/compat/_internal/ValueIterateeCustom.d.ts +type ValueIterateeCustom = ((value: T) => TResult) | IterateeShorthand; +//#endregion +export { ValueIterateeCustom }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueIteratorTypeGuard.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueIteratorTypeGuard.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..52a4fc7f604e2c6956e966103c55f7d7a4c459a2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueIteratorTypeGuard.d.mts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/ValueIteratorTypeGuard.d.ts +type ValueIteratorTypeGuard = (value: T) => value is S; +//#endregion +export { ValueIteratorTypeGuard }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueIteratorTypeGuard.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueIteratorTypeGuard.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..52a4fc7f604e2c6956e966103c55f7d7a4c459a2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueIteratorTypeGuard.d.ts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/ValueIteratorTypeGuard.d.ts +type ValueIteratorTypeGuard = (value: T) => value is S; +//#endregion +export { ValueIteratorTypeGuard }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueKeyIteratee.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueKeyIteratee.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..e78834b34f477a6ffeff8cca215c356bbcedbddf --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueKeyIteratee.d.mts @@ -0,0 +1,6 @@ +import { IterateeShorthand } from "./IterateeShorthand.mjs"; + +//#region src/compat/_internal/ValueKeyIteratee.d.ts +type ValueKeyIteratee = ((value: T, key: string) => unknown) | IterateeShorthand; +//#endregion +export { ValueKeyIteratee }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueKeyIteratee.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueKeyIteratee.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2f700734f98c87a7fb9d40b7a63103e84a111a05 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueKeyIteratee.d.ts @@ -0,0 +1,6 @@ +import { IterateeShorthand } from "./IterateeShorthand.js"; + +//#region src/compat/_internal/ValueKeyIteratee.d.ts +type ValueKeyIteratee = ((value: T, key: string) => unknown) | IterateeShorthand; +//#endregion +export { ValueKeyIteratee }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueKeyIterateeTypeGuard.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueKeyIterateeTypeGuard.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..9f45ea7ba16b74e680fc85f1b7802fecafe0f213 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueKeyIterateeTypeGuard.d.mts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/ValueKeyIterateeTypeGuard.d.ts +type ValueKeyIterateeTypeGuard = (value: T, key: string) => value is S; +//#endregion +export { ValueKeyIterateeTypeGuard }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueKeyIterateeTypeGuard.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueKeyIterateeTypeGuard.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9f45ea7ba16b74e680fc85f1b7802fecafe0f213 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/ValueKeyIterateeTypeGuard.d.ts @@ -0,0 +1,4 @@ +//#region src/compat/_internal/ValueKeyIterateeTypeGuard.d.ts +type ValueKeyIterateeTypeGuard = (value: T, key: string) => value is S; +//#endregion +export { ValueKeyIterateeTypeGuard }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/assignValue.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/assignValue.js new file mode 100644 index 0000000000000000000000000000000000000000..9ee279e561bd702e94846d8cbd579446f6069f7d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/assignValue.js @@ -0,0 +1,9 @@ +const require_isEqualsSameValueZero = require("../../_internal/isEqualsSameValueZero.js"); +require("../util/eq.js"); +//#region src/compat/_internal/assignValue.ts +const assignValue = (object, key, value) => { + const objValue = object[key]; + if (!(Object.hasOwn(object, key) && require_isEqualsSameValueZero.isEqualsSameValueZero(objValue, value)) || value === void 0 && !(key in object)) object[key] = value; +}; +//#endregion +exports.assignValue = assignValue; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/assignValue.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/assignValue.mjs new file mode 100644 index 0000000000000000000000000000000000000000..6b248b57154118b00a5553a0d994f0b4e539c418 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/assignValue.mjs @@ -0,0 +1,9 @@ +import { isEqualsSameValueZero } from "../../_internal/isEqualsSameValueZero.mjs"; +import "../util/eq.mjs"; +//#region src/compat/_internal/assignValue.ts +const assignValue = (object, key, value) => { + const objValue = object[key]; + if (!(Object.hasOwn(object, key) && isEqualsSameValueZero(objValue, value)) || value === void 0 && !(key in object)) object[key] = value; +}; +//#endregion +export { assignValue }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/compareValues.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/compareValues.js new file mode 100644 index 0000000000000000000000000000000000000000..57d62ca72c12ff6c4fdab35beb07a616ec657280 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/compareValues.js @@ -0,0 +1,22 @@ +//#region src/compat/_internal/compareValues.ts +function getPriority(a) { + if (typeof a === "symbol") return 1; + if (a === null) return 2; + if (a === void 0) return 3; + if (a !== a) return 4; + return 0; +} +const compareValues = (a, b, order) => { + if (a !== b) { + const aPriority = getPriority(a); + const bPriority = getPriority(b); + if (aPriority === bPriority && aPriority === 0) { + if (a < b) return order === "desc" ? 1 : -1; + if (a > b) return order === "desc" ? -1 : 1; + } + return order === "desc" ? bPriority - aPriority : aPriority - bPriority; + } + return 0; +}; +//#endregion +exports.compareValues = compareValues; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/compareValues.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/compareValues.mjs new file mode 100644 index 0000000000000000000000000000000000000000..0888373165fa2f78f35863c677381cd409ecde36 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/compareValues.mjs @@ -0,0 +1,22 @@ +//#region src/compat/_internal/compareValues.ts +function getPriority(a) { + if (typeof a === "symbol") return 1; + if (a === null) return 2; + if (a === void 0) return 3; + if (a !== a) return 4; + return 0; +} +const compareValues = (a, b, order) => { + if (a !== b) { + const aPriority = getPriority(a); + const bPriority = getPriority(b); + if (aPriority === bPriority && aPriority === 0) { + if (a < b) return order === "desc" ? 1 : -1; + if (a > b) return order === "desc" ? -1 : 1; + } + return order === "desc" ? bPriority - aPriority : aPriority - bPriority; + } + return 0; +}; +//#endregion +export { compareValues }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/copyArray.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/copyArray.js new file mode 100644 index 0000000000000000000000000000000000000000..9f9975e4081191aaacf35557a84a1f327a0cbeae --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/copyArray.js @@ -0,0 +1,17 @@ +//#region src/compat/_internal/copyArray.ts +/** +* Copies the values of `source` to `array`. +* +* @template T +* @param {ArrayLike} source The array to copy values from. +* @param {T[]} [array=[]] The array to copy values to. +* @returns {T[]} Returns `array`. +*/ +function copyArray(source, array) { + const length = source.length; + if (array == null) array = Array(length); + for (let i = 0; i < length; i++) array[i] = source[i]; + return array; +} +//#endregion +exports.default = copyArray; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/copyArray.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/copyArray.mjs new file mode 100644 index 0000000000000000000000000000000000000000..938b5aacaa5c794e4d00ef0ab4ea7e93ad495218 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/copyArray.mjs @@ -0,0 +1,17 @@ +//#region src/compat/_internal/copyArray.ts +/** +* Copies the values of `source` to `array`. +* +* @template T +* @param {ArrayLike} source The array to copy values from. +* @param {T[]} [array=[]] The array to copy values to. +* @returns {T[]} Returns `array`. +*/ +function copyArray(source, array) { + const length = source.length; + if (array == null) array = Array(length); + for (let i = 0; i < length; i++) array[i] = source[i]; + return array; +} +//#endregion +export { copyArray as default }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/decimalAdjust.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/decimalAdjust.js new file mode 100644 index 0000000000000000000000000000000000000000..d4f55de349218737675e84ba11a438155e146882 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/decimalAdjust.js @@ -0,0 +1,16 @@ +//#region src/compat/_internal/decimalAdjust.ts +function decimalAdjust(type, number, precision = 0) { + number = Number(number); + if (Object.is(number, -0)) number = "-0"; + precision = Math.min(Number.parseInt(precision, 10), 292); + if (precision) { + const [magnitude, exponent = 0] = number.toString().split("e"); + let adjustedValue = Math[type](Number(`${magnitude}e${Number(exponent) + precision}`)); + if (Object.is(adjustedValue, -0)) adjustedValue = "-0"; + const [newMagnitude, newExponent = 0] = adjustedValue.toString().split("e"); + return Number(`${newMagnitude}e${Number(newExponent) - precision}`); + } + return Math[type](Number(number)); +} +//#endregion +exports.decimalAdjust = decimalAdjust; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/decimalAdjust.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/decimalAdjust.mjs new file mode 100644 index 0000000000000000000000000000000000000000..dc7b562715cf1b8fc614b7b5a3cb9ef04ccbd110 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/decimalAdjust.mjs @@ -0,0 +1,16 @@ +//#region src/compat/_internal/decimalAdjust.ts +function decimalAdjust(type, number, precision = 0) { + number = Number(number); + if (Object.is(number, -0)) number = "-0"; + precision = Math.min(Number.parseInt(precision, 10), 292); + if (precision) { + const [magnitude, exponent = 0] = number.toString().split("e"); + let adjustedValue = Math[type](Number(`${magnitude}e${Number(exponent) + precision}`)); + if (Object.is(adjustedValue, -0)) adjustedValue = "-0"; + const [newMagnitude, newExponent = 0] = adjustedValue.toString().split("e"); + return Number(`${newMagnitude}e${Number(newExponent) - precision}`); + } + return Math[type](Number(number)); +} +//#endregion +export { decimalAdjust }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/flattenArrayLike.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/flattenArrayLike.js new file mode 100644 index 0000000000000000000000000000000000000000..70890353956fba0997da5daf984c41eadadf03ce --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/flattenArrayLike.js @@ -0,0 +1,13 @@ +const require_isArrayLikeObject = require("../predicate/isArrayLikeObject.js"); +//#region src/compat/_internal/flattenArrayLike.ts +function flattenArrayLike(values) { + const result = []; + for (let i = 0; i < values.length; i++) { + const arrayLike = values[i]; + if (!require_isArrayLikeObject.isArrayLikeObject(arrayLike)) continue; + for (let j = 0; j < arrayLike.length; j++) result.push(arrayLike[j]); + } + return result; +} +//#endregion +exports.flattenArrayLike = flattenArrayLike; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/flattenArrayLike.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/flattenArrayLike.mjs new file mode 100644 index 0000000000000000000000000000000000000000..0c6c5e835bbea1c0edf7aff000a0856411bb5ef4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/flattenArrayLike.mjs @@ -0,0 +1,13 @@ +import { isArrayLikeObject } from "../predicate/isArrayLikeObject.mjs"; +//#region src/compat/_internal/flattenArrayLike.ts +function flattenArrayLike(values) { + const result = []; + for (let i = 0; i < values.length; i++) { + const arrayLike = values[i]; + if (!isArrayLikeObject(arrayLike)) continue; + for (let j = 0; j < arrayLike.length; j++) result.push(arrayLike[j]); + } + return result; +} +//#endregion +export { flattenArrayLike }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/getSymbols.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/getSymbols.js new file mode 100644 index 0000000000000000000000000000000000000000..7b312359d5b3946463b3d3a3d3a7528c9bea6848 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/getSymbols.js @@ -0,0 +1,6 @@ +//#region src/compat/_internal/getSymbols.ts +function getSymbols(object) { + return Object.getOwnPropertySymbols(object).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object, symbol)); +} +//#endregion +exports.getSymbols = getSymbols; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs new file mode 100644 index 0000000000000000000000000000000000000000..8b0ae8ef935d276b9b4d7bd6695ee54151f68317 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs @@ -0,0 +1,6 @@ +//#region src/compat/_internal/getSymbols.ts +function getSymbols(object) { + return Object.getOwnPropertySymbols(object).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object, symbol)); +} +//#endregion +export { getSymbols }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/getSymbolsIn.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/getSymbolsIn.js new file mode 100644 index 0000000000000000000000000000000000000000..2109bd29d93df7c678d25462f194a5d4f26d54c2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/getSymbolsIn.js @@ -0,0 +1,12 @@ +const require_getSymbols = require("./getSymbols.js"); +//#region src/compat/_internal/getSymbolsIn.ts +function getSymbolsIn(object) { + const result = []; + while (object) { + result.push(...require_getSymbols.getSymbols(object)); + object = Object.getPrototypeOf(object); + } + return result; +} +//#endregion +exports.getSymbolsIn = getSymbolsIn; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/getSymbolsIn.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/getSymbolsIn.mjs new file mode 100644 index 0000000000000000000000000000000000000000..83e35c71b0c1d4f432d67245a8beab302aa568f2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/getSymbolsIn.mjs @@ -0,0 +1,12 @@ +import { getSymbols } from "./getSymbols.mjs"; +//#region src/compat/_internal/getSymbolsIn.ts +function getSymbolsIn(object) { + const result = []; + while (object) { + result.push(...getSymbols(object)); + object = Object.getPrototypeOf(object); + } + return result; +} +//#endregion +export { getSymbolsIn }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/getTag.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/getTag.js new file mode 100644 index 0000000000000000000000000000000000000000..3abdb40cec8c49f26516abd8586321e54aec9e23 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/getTag.js @@ -0,0 +1,14 @@ +//#region src/compat/_internal/getTag.ts +/** +* Gets the `toStringTag` of `value`. +* +* @private +* @param {T} value The value to query. +* @returns {string} Returns the `Object.prototype.toString.call` result. +*/ +function getTag(value) { + if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]"; + return Object.prototype.toString.call(value); +} +//#endregion +exports.getTag = getTag; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/getTag.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/getTag.mjs new file mode 100644 index 0000000000000000000000000000000000000000..77ddb9267598ad850c0214b796d256c9ec9c6418 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/getTag.mjs @@ -0,0 +1,14 @@ +//#region src/compat/_internal/getTag.ts +/** +* Gets the `toStringTag` of `value`. +* +* @private +* @param {T} value The value to query. +* @returns {string} Returns the `Object.prototype.toString.call` result. +*/ +function getTag(value) { + if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]"; + return Object.prototype.toString.call(value); +} +//#endregion +export { getTag }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.js new file mode 100644 index 0000000000000000000000000000000000000000..390c37ffff7ae8fb0149caabedba178c45e5fd16 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.js @@ -0,0 +1,27 @@ +//#region src/compat/_internal/isDeepKey.ts +/** +* Checks if a given key is a deep key. +* +* A deep key is a string that contains a dot (.) or square brackets with a property accessor. +* +* @param {PropertyKey} key - The key to check. +* @returns {boolean} - Returns true if the key is a deep key, otherwise false. +* +* Examples: +* +* isDeepKey('a.b') // true +* isDeepKey('a[b]') // true +* isDeepKey('a') // false +* isDeepKey(123) // false +* isDeepKey('a.b.c') // true +* isDeepKey('a[b][c]') // true +*/ +function isDeepKey(key) { + switch (typeof key) { + case "number": + case "symbol": return false; + case "string": return key.includes(".") || key.includes("[") || key.includes("]"); + } +} +//#endregion +exports.isDeepKey = isDeepKey; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.mjs new file mode 100644 index 0000000000000000000000000000000000000000..a103fc6d14bae732a7ebbcb6a34db1bfec942eb0 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.mjs @@ -0,0 +1,27 @@ +//#region src/compat/_internal/isDeepKey.ts +/** +* Checks if a given key is a deep key. +* +* A deep key is a string that contains a dot (.) or square brackets with a property accessor. +* +* @param {PropertyKey} key - The key to check. +* @returns {boolean} - Returns true if the key is a deep key, otherwise false. +* +* Examples: +* +* isDeepKey('a.b') // true +* isDeepKey('a[b]') // true +* isDeepKey('a') // false +* isDeepKey(123) // false +* isDeepKey('a.b.c') // true +* isDeepKey('a[b][c]') // true +*/ +function isDeepKey(key) { + switch (typeof key) { + case "number": + case "symbol": return false; + case "string": return key.includes(".") || key.includes("[") || key.includes("]"); + } +} +//#endregion +export { isDeepKey }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isIndex.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isIndex.js new file mode 100644 index 0000000000000000000000000000000000000000..4d596dc6487ef0b1f1583fb8c948a656d7625116 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isIndex.js @@ -0,0 +1,11 @@ +//#region src/compat/_internal/isIndex.ts +const IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\d*)$/; +function isIndex(value, length = Number.MAX_SAFE_INTEGER) { + switch (typeof value) { + case "number": return Number.isInteger(value) && value >= 0 && value < length; + case "symbol": return false; + case "string": return IS_UNSIGNED_INTEGER.test(value); + } +} +//#endregion +exports.isIndex = isIndex; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isIndex.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isIndex.mjs new file mode 100644 index 0000000000000000000000000000000000000000..6be28ab371d0209b6f57563e7f34b93a9490021d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isIndex.mjs @@ -0,0 +1,11 @@ +//#region src/compat/_internal/isIndex.ts +const IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\d*)$/; +function isIndex(value, length = Number.MAX_SAFE_INTEGER) { + switch (typeof value) { + case "number": return Number.isInteger(value) && value >= 0 && value < length; + case "symbol": return false; + case "string": return IS_UNSIGNED_INTEGER.test(value); + } +} +//#endregion +export { isIndex }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.js new file mode 100644 index 0000000000000000000000000000000000000000..d71d28db600958061d7ed79a332e691090bfac57 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.js @@ -0,0 +1,13 @@ +const require_isEqualsSameValueZero = require("../../_internal/isEqualsSameValueZero.js"); +require("../util/eq.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +const require_isObject = require("../predicate/isObject.js"); +const require_isIndex = require("./isIndex.js"); +//#region src/compat/_internal/isIterateeCall.ts +function isIterateeCall(value, index, object) { + if (!require_isObject.isObject(object)) return false; + if (typeof index === "number" && require_isArrayLike.isArrayLike(object) && require_isIndex.isIndex(index) && index < object.length || typeof index === "string" && index in object) return require_isEqualsSameValueZero.isEqualsSameValueZero(object[index], value); + return false; +} +//#endregion +exports.isIterateeCall = isIterateeCall; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d0a6caacf17c4d98b022d637e565fcb133953721 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.mjs @@ -0,0 +1,13 @@ +import { isEqualsSameValueZero } from "../../_internal/isEqualsSameValueZero.mjs"; +import "../util/eq.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +import { isObject } from "../predicate/isObject.mjs"; +import { isIndex } from "./isIndex.mjs"; +//#region src/compat/_internal/isIterateeCall.ts +function isIterateeCall(value, index, object) { + if (!isObject(object)) return false; + if (typeof index === "number" && isArrayLike(object) && isIndex(index) && index < object.length || typeof index === "string" && index in object) return isEqualsSameValueZero(object[index], value); + return false; +} +//#endregion +export { isIterateeCall }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isKey.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isKey.js new file mode 100644 index 0000000000000000000000000000000000000000..9283ddde76c12ea956f513c2a4673cd4a1eae9cf --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isKey.js @@ -0,0 +1,26 @@ +const require_isSymbol = require("../predicate/isSymbol.js"); +//#region src/compat/_internal/isKey.ts +/** Matches any deep property path. (e.g. `a.b[0].c`)*/ +const regexIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; +/** Matches any word character (alphanumeric & underscore).*/ +const regexIsPlainProp = /^\w*$/; +/** +* Checks if `value` is a property name and not a property path. (It's ok that the `value` is not in the keys of the `object`) +* @param {unknown} value The value to check. +* @param {unknown} object The object to query. +* @returns {boolean} Returns `true` if `value` is a property name, else `false`. +* +* @example +* isKey('a', { a: 1 }); +* // => true +* +* isKey('a.b', { a: { b: 2 } }); +* // => false +*/ +function isKey(value, object) { + if (Array.isArray(value)) return false; + if (typeof value === "number" || typeof value === "boolean" || value == null || require_isSymbol.isSymbol(value)) return true; + return typeof value === "string" && (regexIsPlainProp.test(value) || !regexIsDeepProp.test(value)) || object != null && Object.hasOwn(object, value); +} +//#endregion +exports.isKey = isKey; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isKey.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isKey.mjs new file mode 100644 index 0000000000000000000000000000000000000000..c39feaed104e6236c8836e30bb15c415494c4938 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isKey.mjs @@ -0,0 +1,26 @@ +import { isSymbol } from "../predicate/isSymbol.mjs"; +//#region src/compat/_internal/isKey.ts +/** Matches any deep property path. (e.g. `a.b[0].c`)*/ +const regexIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; +/** Matches any word character (alphanumeric & underscore).*/ +const regexIsPlainProp = /^\w*$/; +/** +* Checks if `value` is a property name and not a property path. (It's ok that the `value` is not in the keys of the `object`) +* @param {unknown} value The value to check. +* @param {unknown} object The object to query. +* @returns {boolean} Returns `true` if `value` is a property name, else `false`. +* +* @example +* isKey('a', { a: 1 }); +* // => true +* +* isKey('a.b', { a: { b: 2 } }); +* // => false +*/ +function isKey(value, object) { + if (Array.isArray(value)) return false; + if (typeof value === "number" || typeof value === "boolean" || value == null || isSymbol(value)) return true; + return typeof value === "string" && (regexIsPlainProp.test(value) || !regexIsDeepProp.test(value)) || object != null && Object.hasOwn(object, value); +} +//#endregion +export { isKey }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isPrototype.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isPrototype.js new file mode 100644 index 0000000000000000000000000000000000000000..f5756f938d1beaef8736108805da930f082c6b6f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isPrototype.js @@ -0,0 +1,7 @@ +//#region src/compat/_internal/isPrototype.ts +function isPrototype(value) { + const constructor = value?.constructor; + return value === (typeof constructor === "function" ? constructor.prototype : Object.prototype); +} +//#endregion +exports.isPrototype = isPrototype; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isPrototype.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isPrototype.mjs new file mode 100644 index 0000000000000000000000000000000000000000..dc21b4a976f298b53c65cbb759556e25f39b7a38 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/isPrototype.mjs @@ -0,0 +1,7 @@ +//#region src/compat/_internal/isPrototype.ts +function isPrototype(value) { + const constructor = value?.constructor; + return value === (typeof constructor === "function" ? constructor.prototype : Object.prototype); +} +//#endregion +export { isPrototype }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/mapToEntries.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/mapToEntries.js new file mode 100644 index 0000000000000000000000000000000000000000..2fe244c22892fecff42b54a4c88110e73fd6896b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/mapToEntries.js @@ -0,0 +1,10 @@ +//#region src/compat/_internal/mapToEntries.ts +function mapToEntries(map) { + const arr = new Array(map.size); + const keys = map.keys(); + const values = map.values(); + for (let i = 0; i < arr.length; i++) arr[i] = [keys.next().value, values.next().value]; + return arr; +} +//#endregion +exports.mapToEntries = mapToEntries; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/mapToEntries.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/mapToEntries.mjs new file mode 100644 index 0000000000000000000000000000000000000000..11229c2dc4b2540da200a24b68a546f4d5dfa30f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/mapToEntries.mjs @@ -0,0 +1,10 @@ +//#region src/compat/_internal/mapToEntries.ts +function mapToEntries(map) { + const arr = new Array(map.size); + const keys = map.keys(); + const values = map.values(); + for (let i = 0; i < arr.length; i++) arr[i] = [keys.next().value, values.next().value]; + return arr; +} +//#endregion +export { mapToEntries }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/normalizeForCase.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/normalizeForCase.js new file mode 100644 index 0000000000000000000000000000000000000000..28b00a9834d301302d378a936c7209e32bbb2b0d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/normalizeForCase.js @@ -0,0 +1,8 @@ +const require_toString = require("../util/toString.js"); +//#region src/compat/_internal/normalizeForCase.ts +function normalizeForCase(str) { + if (typeof str !== "string") str = require_toString.toString(str); + return str.replace(/['\u2019]/g, ""); +} +//#endregion +exports.normalizeForCase = normalizeForCase; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/normalizeForCase.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/normalizeForCase.mjs new file mode 100644 index 0000000000000000000000000000000000000000..ad4e6ae80bd41e127826d5c435f7e7e69c444399 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/normalizeForCase.mjs @@ -0,0 +1,8 @@ +import { toString } from "../util/toString.mjs"; +//#region src/compat/_internal/normalizeForCase.ts +function normalizeForCase(str) { + if (typeof str !== "string") str = toString(str); + return str.replace(/['\u2019]/g, ""); +} +//#endregion +export { normalizeForCase }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/setToEntries.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/setToEntries.js new file mode 100644 index 0000000000000000000000000000000000000000..339d2cc4c639e8b44117e4c7e3d82d685670b386 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/setToEntries.js @@ -0,0 +1,12 @@ +//#region src/compat/_internal/setToEntries.ts +function setToEntries(set) { + const arr = new Array(set.size); + const values = set.values(); + for (let i = 0; i < arr.length; i++) { + const value = values.next().value; + arr[i] = [value, value]; + } + return arr; +} +//#endregion +exports.setToEntries = setToEntries; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/setToEntries.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/setToEntries.mjs new file mode 100644 index 0000000000000000000000000000000000000000..4a6f48d09dca1e571df965a248857f087b7c663e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/setToEntries.mjs @@ -0,0 +1,12 @@ +//#region src/compat/_internal/setToEntries.ts +function setToEntries(set) { + const arr = new Array(set.size); + const values = set.values(); + for (let i = 0; i < arr.length; i++) { + const value = values.next().value; + arr[i] = [value, value]; + } + return arr; +} +//#endregion +export { setToEntries }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/tags.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/tags.js new file mode 100644 index 0000000000000000000000000000000000000000..0b20906694423408bda895ac14a8c3432c100d1b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/tags.js @@ -0,0 +1,54 @@ +//#region src/compat/_internal/tags.ts +const regexpTag = "[object RegExp]"; +const stringTag = "[object String]"; +const numberTag = "[object Number]"; +const booleanTag = "[object Boolean]"; +const argumentsTag = "[object Arguments]"; +const symbolTag = "[object Symbol]"; +const dateTag = "[object Date]"; +const mapTag = "[object Map]"; +const setTag = "[object Set]"; +const arrayTag = "[object Array]"; +const functionTag = "[object Function]"; +const arrayBufferTag = "[object ArrayBuffer]"; +const objectTag = "[object Object]"; +const errorTag = "[object Error]"; +const dataViewTag = "[object DataView]"; +const uint8ArrayTag = "[object Uint8Array]"; +const uint8ClampedArrayTag = "[object Uint8ClampedArray]"; +const uint16ArrayTag = "[object Uint16Array]"; +const uint32ArrayTag = "[object Uint32Array]"; +const bigUint64ArrayTag = "[object BigUint64Array]"; +const int8ArrayTag = "[object Int8Array]"; +const int16ArrayTag = "[object Int16Array]"; +const int32ArrayTag = "[object Int32Array]"; +const bigInt64ArrayTag = "[object BigInt64Array]"; +const float32ArrayTag = "[object Float32Array]"; +const float64ArrayTag = "[object Float64Array]"; +//#endregion +exports.argumentsTag = argumentsTag; +exports.arrayBufferTag = arrayBufferTag; +exports.arrayTag = arrayTag; +exports.bigInt64ArrayTag = bigInt64ArrayTag; +exports.bigUint64ArrayTag = bigUint64ArrayTag; +exports.booleanTag = booleanTag; +exports.dataViewTag = dataViewTag; +exports.dateTag = dateTag; +exports.errorTag = errorTag; +exports.float32ArrayTag = float32ArrayTag; +exports.float64ArrayTag = float64ArrayTag; +exports.functionTag = functionTag; +exports.int16ArrayTag = int16ArrayTag; +exports.int32ArrayTag = int32ArrayTag; +exports.int8ArrayTag = int8ArrayTag; +exports.mapTag = mapTag; +exports.numberTag = numberTag; +exports.objectTag = objectTag; +exports.regexpTag = regexpTag; +exports.setTag = setTag; +exports.stringTag = stringTag; +exports.symbolTag = symbolTag; +exports.uint16ArrayTag = uint16ArrayTag; +exports.uint32ArrayTag = uint32ArrayTag; +exports.uint8ArrayTag = uint8ArrayTag; +exports.uint8ClampedArrayTag = uint8ClampedArrayTag; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/tags.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/tags.mjs new file mode 100644 index 0000000000000000000000000000000000000000..b278d7333382679d3444c4cc3de75a1dd42b00d4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/tags.mjs @@ -0,0 +1,29 @@ +//#region src/compat/_internal/tags.ts +const regexpTag = "[object RegExp]"; +const stringTag = "[object String]"; +const numberTag = "[object Number]"; +const booleanTag = "[object Boolean]"; +const argumentsTag = "[object Arguments]"; +const symbolTag = "[object Symbol]"; +const dateTag = "[object Date]"; +const mapTag = "[object Map]"; +const setTag = "[object Set]"; +const arrayTag = "[object Array]"; +const functionTag = "[object Function]"; +const arrayBufferTag = "[object ArrayBuffer]"; +const objectTag = "[object Object]"; +const errorTag = "[object Error]"; +const dataViewTag = "[object DataView]"; +const uint8ArrayTag = "[object Uint8Array]"; +const uint8ClampedArrayTag = "[object Uint8ClampedArray]"; +const uint16ArrayTag = "[object Uint16Array]"; +const uint32ArrayTag = "[object Uint32Array]"; +const bigUint64ArrayTag = "[object BigUint64Array]"; +const int8ArrayTag = "[object Int8Array]"; +const int16ArrayTag = "[object Int16Array]"; +const int32ArrayTag = "[object Int32Array]"; +const bigInt64ArrayTag = "[object BigInt64Array]"; +const float32ArrayTag = "[object Float32Array]"; +const float64ArrayTag = "[object Float64Array]"; +//#endregion +export { argumentsTag, arrayBufferTag, arrayTag, bigInt64ArrayTag, bigUint64ArrayTag, booleanTag, dataViewTag, dateTag, errorTag, float32ArrayTag, float64ArrayTag, functionTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/toArray.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/toArray.js new file mode 100644 index 0000000000000000000000000000000000000000..ed5f11baa49d7e5e9009f9fcec88d9fe4de17a7d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/toArray.js @@ -0,0 +1,6 @@ +//#region src/compat/_internal/toArray.ts +function toArray(value) { + return Array.isArray(value) ? value : Array.from(value); +} +//#endregion +exports.toArray = toArray; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/toArray.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/toArray.mjs new file mode 100644 index 0000000000000000000000000000000000000000..801f3add186e6d813a9d5f8be457c94f0f027615 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/toArray.mjs @@ -0,0 +1,6 @@ +//#region src/compat/_internal/toArray.ts +function toArray(value) { + return Array.isArray(value) ? value : Array.from(value); +} +//#endregion +export { toArray }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/toKey.js b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/toKey.js new file mode 100644 index 0000000000000000000000000000000000000000..dbb09a629c2aadb3e98dd7d5175256068f04e468 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/toKey.js @@ -0,0 +1,15 @@ +//#region src/compat/_internal/toKey.ts +/** +* Converts `value` to a string key if it's not a string or symbol. +* +* @private +* @param {*} value The value to inspect. +* @returns {string|symbol} Returns the key. +*/ +function toKey(value) { + if (typeof value === "string" || typeof value === "symbol") return value; + if (Object.is(value?.valueOf?.(), -0)) return "-0"; + return String(value); +} +//#endregion +exports.toKey = toKey; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/_internal/toKey.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/toKey.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d5a8c9a220d12c558b95ca8ad662321051949625 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/_internal/toKey.mjs @@ -0,0 +1,15 @@ +//#region src/compat/_internal/toKey.ts +/** +* Converts `value` to a string key if it's not a string or symbol. +* +* @private +* @param {*} value The value to inspect. +* @returns {string|symbol} Returns the key. +*/ +function toKey(value) { + if (typeof value === "string" || typeof value === "symbol") return value; + if (Object.is(value?.valueOf?.(), -0)) return "-0"; + return String(value); +} +//#endregion +export { toKey }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/castArray.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/castArray.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..24c03245e2a068d7f585c8d22f01cc787295686e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/castArray.d.mts @@ -0,0 +1,30 @@ +//#region src/compat/array/castArray.d.ts +/** + * Casts value as an array if it's not one. + * + * @template T The type of elements in the array. + * @param {T | T[]} value The value to be cast to an array. + * @returns {T[]} An array containing the input value if it wasn't an array, or the original array if it was. + * + * @example + * const arr1 = castArray(1); + * // Returns: [1] + * + * const arr2 = castArray([1]); + * // Returns: [1] + * + * const arr3 = castArray({'a': 1}); + * // Returns: [{'a': 1}] + * + * const arr4 = castArray(null); + * // Returns: [null] + * + * const arr5 = castArray(undefined); + * // Returns: [undefined] + * + * const arr6 = castArray(); + * // Returns: [] + */ +declare function castArray(value?: T | readonly T[]): T[]; +//#endregion +export { castArray }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/castArray.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/castArray.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..24c03245e2a068d7f585c8d22f01cc787295686e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/castArray.d.ts @@ -0,0 +1,30 @@ +//#region src/compat/array/castArray.d.ts +/** + * Casts value as an array if it's not one. + * + * @template T The type of elements in the array. + * @param {T | T[]} value The value to be cast to an array. + * @returns {T[]} An array containing the input value if it wasn't an array, or the original array if it was. + * + * @example + * const arr1 = castArray(1); + * // Returns: [1] + * + * const arr2 = castArray([1]); + * // Returns: [1] + * + * const arr3 = castArray({'a': 1}); + * // Returns: [{'a': 1}] + * + * const arr4 = castArray(null); + * // Returns: [null] + * + * const arr5 = castArray(undefined); + * // Returns: [undefined] + * + * const arr6 = castArray(); + * // Returns: [] + */ +declare function castArray(value?: T | readonly T[]): T[]; +//#endregion +export { castArray }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/castArray.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/castArray.js new file mode 100644 index 0000000000000000000000000000000000000000..829433bb05aecd26f2bc4f6f7876751d09804a1e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/castArray.js @@ -0,0 +1,33 @@ +//#region src/compat/array/castArray.ts +/** +* Casts value as an array if it's not one. +* +* @template T The type of elements in the array. +* @param {T | T[]} value The value to be cast to an array. +* @returns {T[]} An array containing the input value if it wasn't an array, or the original array if it was. +* +* @example +* const arr1 = castArray(1); +* // Returns: [1] +* +* const arr2 = castArray([1]); +* // Returns: [1] +* +* const arr3 = castArray({'a': 1}); +* // Returns: [{'a': 1}] +* +* const arr4 = castArray(null); +* // Returns: [null] +* +* const arr5 = castArray(undefined); +* // Returns: [undefined] +* +* const arr6 = castArray(); +* // Returns: [] +*/ +function castArray(value) { + if (arguments.length === 0) return []; + return Array.isArray(value) ? value : [value]; +} +//#endregion +exports.castArray = castArray; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/castArray.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/castArray.mjs new file mode 100644 index 0000000000000000000000000000000000000000..2ed5a01a96baa9ae135793b370dfcf67fc3d727e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/castArray.mjs @@ -0,0 +1,33 @@ +//#region src/compat/array/castArray.ts +/** +* Casts value as an array if it's not one. +* +* @template T The type of elements in the array. +* @param {T | T[]} value The value to be cast to an array. +* @returns {T[]} An array containing the input value if it wasn't an array, or the original array if it was. +* +* @example +* const arr1 = castArray(1); +* // Returns: [1] +* +* const arr2 = castArray([1]); +* // Returns: [1] +* +* const arr3 = castArray({'a': 1}); +* // Returns: [{'a': 1}] +* +* const arr4 = castArray(null); +* // Returns: [null] +* +* const arr5 = castArray(undefined); +* // Returns: [undefined] +* +* const arr6 = castArray(); +* // Returns: [] +*/ +function castArray(value) { + if (arguments.length === 0) return []; + return Array.isArray(value) ? value : [value]; +} +//#endregion +export { castArray }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/chunk.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/chunk.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..4e9e9a52e764a45f82f48139b5ae335197e4e937 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/chunk.d.mts @@ -0,0 +1,26 @@ +//#region src/compat/array/chunk.d.ts +/** + * Splits an array into smaller arrays of a specified length. + * + * This function takes an input array and divides it into multiple smaller arrays, + * each of a specified length. If the input array cannot be evenly divided, + * the final sub-array will contain the remaining elements. + * + * @template T The type of elements in the array. + * @param {ArrayLike | null | undefined} arr - The array to be chunked into smaller arrays. + * @param {number} size - The size of each smaller array. Must be a positive integer. + * @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`. + * + * @example + * // Splits an array of numbers into sub-arrays of length 2 + * chunk([1, 2, 3, 4, 5], 2); + * // Returns: [[1, 2], [3, 4], [5]] + * + * @example + * // Splits an array of strings into sub-arrays of length 3 + * chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3); + * // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']] + */ +declare function chunk(arr: ArrayLike | null | undefined, size?: number): T[][]; +//#endregion +export { chunk }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/chunk.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/chunk.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e9e9a52e764a45f82f48139b5ae335197e4e937 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/chunk.d.ts @@ -0,0 +1,26 @@ +//#region src/compat/array/chunk.d.ts +/** + * Splits an array into smaller arrays of a specified length. + * + * This function takes an input array and divides it into multiple smaller arrays, + * each of a specified length. If the input array cannot be evenly divided, + * the final sub-array will contain the remaining elements. + * + * @template T The type of elements in the array. + * @param {ArrayLike | null | undefined} arr - The array to be chunked into smaller arrays. + * @param {number} size - The size of each smaller array. Must be a positive integer. + * @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`. + * + * @example + * // Splits an array of numbers into sub-arrays of length 2 + * chunk([1, 2, 3, 4, 5], 2); + * // Returns: [[1, 2], [3, 4], [5]] + * + * @example + * // Splits an array of strings into sub-arrays of length 3 + * chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3); + * // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']] + */ +declare function chunk(arr: ArrayLike | null | undefined, size?: number): T[][]; +//#endregion +export { chunk }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/chunk.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/chunk.js new file mode 100644 index 0000000000000000000000000000000000000000..61eb38420565f0336f5ecf36e5fe99bf93273a9d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/chunk.js @@ -0,0 +1,33 @@ +const require_chunk = require("../../array/chunk.js"); +const require_toArray = require("../_internal/toArray.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +//#region src/compat/array/chunk.ts +/** +* Splits an array into smaller arrays of a specified length. +* +* This function takes an input array and divides it into multiple smaller arrays, +* each of a specified length. If the input array cannot be evenly divided, +* the final sub-array will contain the remaining elements. +* +* @template T The type of elements in the array. +* @param {ArrayLike | null | undefined} arr - The array to be chunked into smaller arrays. +* @param {number} size - The size of each smaller array. Must be a positive integer. +* @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`. +* +* @example +* // Splits an array of numbers into sub-arrays of length 2 +* chunk([1, 2, 3, 4, 5], 2); +* // Returns: [[1, 2], [3, 4], [5]] +* +* @example +* // Splits an array of strings into sub-arrays of length 3 +* chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3); +* // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']] +*/ +function chunk(arr, size = 1) { + size = Math.max(Math.floor(size), 0); + if (size === 0 || !require_isArrayLike.isArrayLike(arr)) return []; + return require_chunk.chunk(require_toArray.toArray(arr), size); +} +//#endregion +exports.chunk = chunk; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/chunk.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/chunk.mjs new file mode 100644 index 0000000000000000000000000000000000000000..705ef45bdb431fdf50b6f6912617b02e3549bc17 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/chunk.mjs @@ -0,0 +1,33 @@ +import { chunk as chunk$1 } from "../../array/chunk.mjs"; +import { toArray } from "../_internal/toArray.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +//#region src/compat/array/chunk.ts +/** +* Splits an array into smaller arrays of a specified length. +* +* This function takes an input array and divides it into multiple smaller arrays, +* each of a specified length. If the input array cannot be evenly divided, +* the final sub-array will contain the remaining elements. +* +* @template T The type of elements in the array. +* @param {ArrayLike | null | undefined} arr - The array to be chunked into smaller arrays. +* @param {number} size - The size of each smaller array. Must be a positive integer. +* @returns {T[][]} A two-dimensional array where each sub-array has a maximum length of `size`. +* +* @example +* // Splits an array of numbers into sub-arrays of length 2 +* chunk([1, 2, 3, 4, 5], 2); +* // Returns: [[1, 2], [3, 4], [5]] +* +* @example +* // Splits an array of strings into sub-arrays of length 3 +* chunk(['a', 'b', 'c', 'd', 'e', 'f', 'g'], 3); +* // Returns: [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']] +*/ +function chunk(arr, size = 1) { + size = Math.max(Math.floor(size), 0); + if (size === 0 || !isArrayLike(arr)) return []; + return chunk$1(toArray(arr), size); +} +//#endregion +export { chunk }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/compact.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/compact.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..0f1b6ab43ce116d8aa0179d6bc5c15597ddcf18b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/compact.d.mts @@ -0,0 +1,16 @@ +//#region src/compat/array/compact.d.ts +type Falsey = false | null | 0 | 0n | '' | undefined; +/** + * Removes falsey values (false, null, 0, 0n, '', undefined, NaN) from an array. + * + * @template T - The type of elements in the array. + * @param {ArrayLike | null | undefined} arr - The input array to remove falsey values. + * @returns {Array>} - A new array with all falsey values removed. + * + * @example + * compact([0, 0n, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]); + * Returns: [1, 2, 3, 4, 5] + */ +declare function compact(arr: ArrayLike | null | undefined): T[]; +//#endregion +export { compact }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/compact.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/compact.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0f1b6ab43ce116d8aa0179d6bc5c15597ddcf18b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/compact.d.ts @@ -0,0 +1,16 @@ +//#region src/compat/array/compact.d.ts +type Falsey = false | null | 0 | 0n | '' | undefined; +/** + * Removes falsey values (false, null, 0, 0n, '', undefined, NaN) from an array. + * + * @template T - The type of elements in the array. + * @param {ArrayLike | null | undefined} arr - The input array to remove falsey values. + * @returns {Array>} - A new array with all falsey values removed. + * + * @example + * compact([0, 0n, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]); + * Returns: [1, 2, 3, 4, 5] + */ +declare function compact(arr: ArrayLike | null | undefined): T[]; +//#endregion +export { compact }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/compact.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/compact.js new file mode 100644 index 0000000000000000000000000000000000000000..dd546c9844b4d0099258abf60dedb8d4c5b5641f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/compact.js @@ -0,0 +1,20 @@ +const require_compact = require("../../array/compact.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +//#region src/compat/array/compact.ts +/** +* Removes falsey values (false, null, 0, 0n, '', undefined, NaN) from an array. +* +* @template T - The type of elements in the array. +* @param {ArrayLike | null | undefined} arr - The input array to remove falsey values. +* @returns {Array>} - A new array with all falsey values removed. +* +* @example +* compact([0, 0n, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]); +* Returns: [1, 2, 3, 4, 5] +*/ +function compact(arr) { + if (!require_isArrayLike.isArrayLike(arr)) return []; + return require_compact.compact(Array.from(arr)); +} +//#endregion +exports.compact = compact; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/compact.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/compact.mjs new file mode 100644 index 0000000000000000000000000000000000000000..5c6b82b9c44bebe7b3ff952a798dc9641694bddc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/compact.mjs @@ -0,0 +1,20 @@ +import { compact as compact$1 } from "../../array/compact.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +//#region src/compat/array/compact.ts +/** +* Removes falsey values (false, null, 0, 0n, '', undefined, NaN) from an array. +* +* @template T - The type of elements in the array. +* @param {ArrayLike | null | undefined} arr - The input array to remove falsey values. +* @returns {Array>} - A new array with all falsey values removed. +* +* @example +* compact([0, 0n, 1, false, 2, '', 3, null, undefined, 4, NaN, 5]); +* Returns: [1, 2, 3, 4, 5] +*/ +function compact(arr) { + if (!isArrayLike(arr)) return []; + return compact$1(Array.from(arr)); +} +//#endregion +export { compact }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/concat.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/concat.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..c6f13a2f256c0674a5823d97c2f1a05522ac510f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/concat.d.mts @@ -0,0 +1,31 @@ +//#region src/compat/array/concat.d.ts +/** + * Concatenates multiple arrays and values into a single array. + * + * @template T The type of elements in the array. + * @param {...(T | T[])} values - The values and/or arrays to concatenate. + * @returns {T[]} A new array containing all the input values. + * + * @example + * // Concatenate individual values + * concat(1, 2, 3); + * // returns [1, 2, 3] + * + * @example + * // Concatenate arrays of values + * concat([1, 2], [3, 4]); + * // returns [1, 2, 3, 4] + * + * @example + * // Concatenate a mix of individual values and arrays + * concat(1, [2, 3], 4); + * // returns [1, 2, 3, 4] + * + * @example + * // Concatenate nested arrays + * concat([1, [2, 3]], 4); + * // returns [1, [2, 3], 4] + */ +declare function concat(...values: Array): T[]; +//#endregion +export { concat }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/concat.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/concat.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6f13a2f256c0674a5823d97c2f1a05522ac510f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/concat.d.ts @@ -0,0 +1,31 @@ +//#region src/compat/array/concat.d.ts +/** + * Concatenates multiple arrays and values into a single array. + * + * @template T The type of elements in the array. + * @param {...(T | T[])} values - The values and/or arrays to concatenate. + * @returns {T[]} A new array containing all the input values. + * + * @example + * // Concatenate individual values + * concat(1, 2, 3); + * // returns [1, 2, 3] + * + * @example + * // Concatenate arrays of values + * concat([1, 2], [3, 4]); + * // returns [1, 2, 3, 4] + * + * @example + * // Concatenate a mix of individual values and arrays + * concat(1, [2, 3], 4); + * // returns [1, 2, 3, 4] + * + * @example + * // Concatenate nested arrays + * concat([1, [2, 3]], 4); + * // returns [1, [2, 3], 4] + */ +declare function concat(...values: Array): T[]; +//#endregion +export { concat }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/concat.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/concat.js new file mode 100644 index 0000000000000000000000000000000000000000..7a33c9b78e33a2d8e24c726ff417b544d9157e91 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/concat.js @@ -0,0 +1,34 @@ +const require_flatten = require("../../array/flatten.js"); +//#region src/compat/array/concat.ts +/** +* Concatenates multiple arrays and values into a single array. +* +* @template T The type of elements in the array. +* @param {...(T | T[])} values - The values and/or arrays to concatenate. +* @returns {T[]} A new array containing all the input values. +* +* @example +* // Concatenate individual values +* concat(1, 2, 3); +* // returns [1, 2, 3] +* +* @example +* // Concatenate arrays of values +* concat([1, 2], [3, 4]); +* // returns [1, 2, 3, 4] +* +* @example +* // Concatenate a mix of individual values and arrays +* concat(1, [2, 3], 4); +* // returns [1, 2, 3, 4] +* +* @example +* // Concatenate nested arrays +* concat([1, [2, 3]], 4); +* // returns [1, [2, 3], 4] +*/ +function concat(...values) { + return require_flatten.flatten(values); +} +//#endregion +exports.concat = concat; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/concat.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/concat.mjs new file mode 100644 index 0000000000000000000000000000000000000000..38181944ebbd033d37ac0cfc4c64272227c51fd4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/concat.mjs @@ -0,0 +1,34 @@ +import { flatten } from "../../array/flatten.mjs"; +//#region src/compat/array/concat.ts +/** +* Concatenates multiple arrays and values into a single array. +* +* @template T The type of elements in the array. +* @param {...(T | T[])} values - The values and/or arrays to concatenate. +* @returns {T[]} A new array containing all the input values. +* +* @example +* // Concatenate individual values +* concat(1, 2, 3); +* // returns [1, 2, 3] +* +* @example +* // Concatenate arrays of values +* concat([1, 2], [3, 4]); +* // returns [1, 2, 3, 4] +* +* @example +* // Concatenate a mix of individual values and arrays +* concat(1, [2, 3], 4); +* // returns [1, 2, 3, 4] +* +* @example +* // Concatenate nested arrays +* concat([1, [2, 3]], 4); +* // returns [1, [2, 3], 4] +*/ +function concat(...values) { + return flatten(values); +} +//#endregion +export { concat }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/countBy.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/countBy.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..dc72d6edcf4a4623863853e8a078ee7a294cb11a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/countBy.d.mts @@ -0,0 +1,20 @@ +import { ValueIteratee } from "../_internal/ValueIteratee.mjs"; + +//#region src/compat/array/countBy.d.ts +/** + * Creates an object composed of keys generated from the results of running each element of collection through + * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The + * iteratee is invoked with one argument: (value). + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @return Returns the composed aggregate object. + * + * @example + * countBy([6.1, 4.2, 6.3], Math.floor); // => { '4': 1, '6': 2 } + * countBy(['one', 'two', 'three'], 'length'); // => { '3': 2, '5': 1 } + */ +declare function countBy(collection: ArrayLike | null | undefined, iteratee?: ValueIteratee): Record; +declare function countBy(collection: T | null | undefined, iteratee?: ValueIteratee): Record; +//#endregion +export { countBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/countBy.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/countBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..57a26e1160e006ce44b876290b8dc3cde06cb732 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/countBy.d.ts @@ -0,0 +1,20 @@ +import { ValueIteratee } from "../_internal/ValueIteratee.js"; + +//#region src/compat/array/countBy.d.ts +/** + * Creates an object composed of keys generated from the results of running each element of collection through + * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The + * iteratee is invoked with one argument: (value). + * + * @param collection The collection to iterate over. + * @param iteratee The function invoked per iteration. + * @return Returns the composed aggregate object. + * + * @example + * countBy([6.1, 4.2, 6.3], Math.floor); // => { '4': 1, '6': 2 } + * countBy(['one', 'two', 'three'], 'length'); // => { '3': 2, '5': 1 } + */ +declare function countBy(collection: ArrayLike | null | undefined, iteratee?: ValueIteratee): Record; +declare function countBy(collection: T | null | undefined, iteratee?: ValueIteratee): Record; +//#endregion +export { countBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/countBy.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/countBy.js new file mode 100644 index 0000000000000000000000000000000000000000..e7482d868934b8cf44cc96ed8702fd00096498f8 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/countBy.js @@ -0,0 +1,17 @@ +const require_isArrayLike = require("../predicate/isArrayLike.js"); +const require_iteratee = require("../util/iteratee.js"); +//#region src/compat/array/countBy.ts +function countBy(collection, iteratee$1) { + if (collection == null) return {}; + const array = require_isArrayLike.isArrayLike(collection) ? Array.from(collection) : Object.values(collection); + const mapper = require_iteratee.iteratee(iteratee$1 ?? void 0); + const result = Object.create(null); + for (let i = 0; i < array.length; i++) { + const item = array[i]; + const key = mapper(item); + result[key] = (result[key] ?? 0) + 1; + } + return result; +} +//#endregion +exports.countBy = countBy; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/countBy.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/countBy.mjs new file mode 100644 index 0000000000000000000000000000000000000000..20ac3cf85fbdbad699b39d05c07df5d0531a1999 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/countBy.mjs @@ -0,0 +1,17 @@ +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +import { iteratee } from "../util/iteratee.mjs"; +//#region src/compat/array/countBy.ts +function countBy(collection, iteratee$1) { + if (collection == null) return {}; + const array = isArrayLike(collection) ? Array.from(collection) : Object.values(collection); + const mapper = iteratee(iteratee$1 ?? void 0); + const result = Object.create(null); + for (let i = 0; i < array.length; i++) { + const item = array[i]; + const key = mapper(item); + result[key] = (result[key] ?? 0) + 1; + } + return result; +} +//#endregion +export { countBy }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/difference.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/difference.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..8d585b59d3ccd07ef34a60c013d41934ad86faa9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/difference.d.mts @@ -0,0 +1,29 @@ +//#region src/compat/array/difference.d.ts +/** + * Computes the difference between an array and multiple arrays. + * + * @template T + * @param {ArrayLike | undefined | null} arr - The primary array from which to derive the difference. This is the main array + * from which elements will be compared and filtered. + * @param {Array>} values - Multiple arrays containing elements to be excluded from the primary array. + * These arrays will be flattened into a single array, and each element in this array will be checked against the primary array. + * If a match is found, that element will be excluded from the result. + * @returns {T[]} A new array containing the elements that are present in the primary array but not + * in the flattened array. + * + * @example + * const array1 = [1, 2, 3, 4, 5]; + * const array2 = [2, 4]; + * const array3 = [5, 6]; + * const result = difference(array1, array2, array3); + * // result will be [1, 3] since 2, 4, and 5 are in the other arrays and are excluded from the result. + * + * @example + * const arrayLike1 = { 0: 1, 1: 2, 2: 3, length: 3 }; + * const arrayLike2 = { 0: 2, 1: 4, length: 2 }; + * const result = difference(arrayLike1, arrayLike2); + * // result will be [1, 3] since 2 is in both array-like objects and is excluded from the result. + */ +declare function difference(arr: ArrayLike | undefined | null, ...values: Array>): T[]; +//#endregion +export { difference }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/difference.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/difference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8d585b59d3ccd07ef34a60c013d41934ad86faa9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/difference.d.ts @@ -0,0 +1,29 @@ +//#region src/compat/array/difference.d.ts +/** + * Computes the difference between an array and multiple arrays. + * + * @template T + * @param {ArrayLike | undefined | null} arr - The primary array from which to derive the difference. This is the main array + * from which elements will be compared and filtered. + * @param {Array>} values - Multiple arrays containing elements to be excluded from the primary array. + * These arrays will be flattened into a single array, and each element in this array will be checked against the primary array. + * If a match is found, that element will be excluded from the result. + * @returns {T[]} A new array containing the elements that are present in the primary array but not + * in the flattened array. + * + * @example + * const array1 = [1, 2, 3, 4, 5]; + * const array2 = [2, 4]; + * const array3 = [5, 6]; + * const result = difference(array1, array2, array3); + * // result will be [1, 3] since 2, 4, and 5 are in the other arrays and are excluded from the result. + * + * @example + * const arrayLike1 = { 0: 1, 1: 2, 2: 3, length: 3 }; + * const arrayLike2 = { 0: 2, 1: 4, length: 2 }; + * const result = difference(arrayLike1, arrayLike2); + * // result will be [1, 3] since 2 is in both array-like objects and is excluded from the result. + */ +declare function difference(arr: ArrayLike | undefined | null, ...values: Array>): T[]; +//#endregion +export { difference }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/difference.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/difference.js new file mode 100644 index 0000000000000000000000000000000000000000..61c767f5758d014ed99120e4961e5fb1ed24f2b9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/difference.js @@ -0,0 +1,41 @@ +const require_difference = require("../../array/difference.js"); +const require_toArray = require("../_internal/toArray.js"); +const require_isArrayLikeObject = require("../predicate/isArrayLikeObject.js"); +//#region src/compat/array/difference.ts +/** +* Computes the difference between an array and multiple arrays. +* +* @template T +* @param {ArrayLike | undefined | null} arr - The primary array from which to derive the difference. This is the main array +* from which elements will be compared and filtered. +* @param {Array>} values - Multiple arrays containing elements to be excluded from the primary array. +* These arrays will be flattened into a single array, and each element in this array will be checked against the primary array. +* If a match is found, that element will be excluded from the result. +* @returns {T[]} A new array containing the elements that are present in the primary array but not +* in the flattened array. +* +* @example +* const array1 = [1, 2, 3, 4, 5]; +* const array2 = [2, 4]; +* const array3 = [5, 6]; +* const result = difference(array1, array2, array3); +* // result will be [1, 3] since 2, 4, and 5 are in the other arrays and are excluded from the result. +* +* @example +* const arrayLike1 = { 0: 1, 1: 2, 2: 3, length: 3 }; +* const arrayLike2 = { 0: 2, 1: 4, length: 2 }; +* const result = difference(arrayLike1, arrayLike2); +* // result will be [1, 3] since 2 is in both array-like objects and is excluded from the result. +*/ +function difference(arr, ...values) { + if (!require_isArrayLikeObject.isArrayLikeObject(arr)) return []; + const arr1 = require_toArray.toArray(arr); + const arr2 = []; + for (let i = 0; i < values.length; i++) { + const value = values[i]; + if (require_isArrayLikeObject.isArrayLikeObject(value)) arr2.push(...Array.from(value)); + } + return require_difference.difference(arr1, arr2); +} +//#endregion +exports.difference = difference; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/difference.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/difference.mjs new file mode 100644 index 0000000000000000000000000000000000000000..bb1120bf4ec1b37e1ebe83c3f2ae97254cf14814 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/difference.mjs @@ -0,0 +1,41 @@ +import { difference as difference$1 } from "../../array/difference.mjs"; +import { toArray } from "../_internal/toArray.mjs"; +import { isArrayLikeObject } from "../predicate/isArrayLikeObject.mjs"; +//#region src/compat/array/difference.ts +/** +* Computes the difference between an array and multiple arrays. +* +* @template T +* @param {ArrayLike | undefined | null} arr - The primary array from which to derive the difference. This is the main array +* from which elements will be compared and filtered. +* @param {Array>} values - Multiple arrays containing elements to be excluded from the primary array. +* These arrays will be flattened into a single array, and each element in this array will be checked against the primary array. +* If a match is found, that element will be excluded from the result. +* @returns {T[]} A new array containing the elements that are present in the primary array but not +* in the flattened array. +* +* @example +* const array1 = [1, 2, 3, 4, 5]; +* const array2 = [2, 4]; +* const array3 = [5, 6]; +* const result = difference(array1, array2, array3); +* // result will be [1, 3] since 2, 4, and 5 are in the other arrays and are excluded from the result. +* +* @example +* const arrayLike1 = { 0: 1, 1: 2, 2: 3, length: 3 }; +* const arrayLike2 = { 0: 2, 1: 4, length: 2 }; +* const result = difference(arrayLike1, arrayLike2); +* // result will be [1, 3] since 2 is in both array-like objects and is excluded from the result. +*/ +function difference(arr, ...values) { + if (!isArrayLikeObject(arr)) return []; + const arr1 = toArray(arr); + const arr2 = []; + for (let i = 0; i < values.length; i++) { + const value = values[i]; + if (isArrayLikeObject(value)) arr2.push(...Array.from(value)); + } + return difference$1(arr1, arr2); +} +//#endregion +export { difference }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceBy.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceBy.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..9e9d67bd4c5183d18b0e4f32cb2e41f25d79ab86 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceBy.d.mts @@ -0,0 +1,109 @@ +import { ValueIteratee } from "../_internal/ValueIteratee.mjs"; + +//#region src/compat/array/differenceBy.d.ts +/** + * Creates an array of array values not included in the other given arrays using an iteratee function. + * + * @template T1, T2 + * @param {ArrayLike | null | undefined} array The array to inspect + * @param {ArrayLike} values The values to exclude + * @param {ValueIteratee} iteratee The iteratee invoked per element + * @returns {T1[]} Returns the new array of filtered values + * @example + * differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor) + * // => [1.2] + */ +declare function differenceBy(array: ArrayLike | null | undefined, values: ArrayLike, iteratee: ValueIteratee): T1[]; +/** + * Creates an array of array values not included in the other given arrays using an iteratee function. + * + * @template T1, T2, T3 + * @param {ArrayLike | null | undefined} array The array to inspect + * @param {ArrayLike} values1 The first array of values to exclude + * @param {ArrayLike} values2 The second array of values to exclude + * @param {ValueIteratee} iteratee The iteratee invoked per element + * @returns {T1[]} Returns the new array of filtered values + * @example + * differenceBy([2.1, 1.2], [2.3], [1.4], Math.floor) + * // => [] + */ +declare function differenceBy(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, iteratee: ValueIteratee): T1[]; +/** + * Creates an array of array values not included in the other given arrays using an iteratee function. + * + * @template T1, T2, T3, T4 + * @param {ArrayLike | null | undefined} array The array to inspect + * @param {ArrayLike} values1 The first array of values to exclude + * @param {ArrayLike} values2 The second array of values to exclude + * @param {ArrayLike} values3 The third array of values to exclude + * @param {ValueIteratee} iteratee The iteratee invoked per element + * @returns {T1[]} Returns the new array of filtered values + * @example + * differenceBy([2.1, 1.2, 3.5], [2.3], [1.4], [3.2], Math.floor) + * // => [] + */ +declare function differenceBy(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, values3: ArrayLike, iteratee: ValueIteratee): T1[]; +/** + * Creates an array of array values not included in the other given arrays using an iteratee function. + * + * @template T1, T2, T3, T4, T5 + * @param {ArrayLike | null | undefined} array The array to inspect + * @param {ArrayLike} values1 The first array of values to exclude + * @param {ArrayLike} values2 The second array of values to exclude + * @param {ArrayLike} values3 The third array of values to exclude + * @param {ArrayLike} values4 The fourth array of values to exclude + * @param {ValueIteratee} iteratee The iteratee invoked per element + * @returns {T1[]} Returns the new array of filtered values + * @example + * differenceBy([2.1, 1.2, 3.5, 4.8], [2.3], [1.4], [3.2], [4.1], Math.floor) + * // => [] + */ +declare function differenceBy(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, values3: ArrayLike, values4: ArrayLike, iteratee: ValueIteratee): T1[]; +/** + * Creates an array of array values not included in the other given arrays using an iteratee function. + * + * @template T1, T2, T3, T4, T5, T6 + * @param {ArrayLike | null | undefined} array The array to inspect + * @param {ArrayLike} values1 The first array of values to exclude + * @param {ArrayLike} values2 The second array of values to exclude + * @param {ArrayLike} values3 The third array of values to exclude + * @param {ArrayLike} values4 The fourth array of values to exclude + * @param {ArrayLike} values5 The fifth array of values to exclude + * @param {ValueIteratee} iteratee The iteratee invoked per element + * @returns {T1[]} Returns the new array of filtered values + * @example + * differenceBy([2.1, 1.2, 3.5, 4.8, 5.3], [2.3], [1.4], [3.2], [4.1], [5.8], Math.floor) + * // => [] + */ +declare function differenceBy(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, values3: ArrayLike, values4: ArrayLike, values5: ArrayLike, iteratee: ValueIteratee): T1[]; +/** + * Creates an array of array values not included in the other given arrays using an iteratee function. + * + * @template T1, T2, T3, T4, T5, T6, T7 + * @param {ArrayLike | null | undefined} array The array to inspect + * @param {ArrayLike} values1 The first array of values to exclude + * @param {ArrayLike} values2 The second array of values to exclude + * @param {ArrayLike} values3 The third array of values to exclude + * @param {ArrayLike} values4 The fourth array of values to exclude + * @param {ArrayLike} values5 The fifth array of values to exclude + * @param {...(ArrayLike | ValueIteratee)[]} values Additional arrays of values to exclude and iteratee + * @returns {T1[]} Returns the new array of filtered values + * @example + * differenceBy([2.1, 1.2, 3.5, 4.8, 5.3, 6.7], [2.3], [1.4], [3.2], [4.1], [5.8], [6.2], Math.floor) + * // => [] + */ +declare function differenceBy(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, values3: ArrayLike, values4: ArrayLike, values5: ArrayLike, ...values: Array | ValueIteratee>): T1[]; +/** + * Creates an array of array values not included in the other given arrays. + * + * @template T + * @param {ArrayLike | null | undefined} array The array to inspect + * @param {...Array>} values The arrays of values to exclude + * @returns {T[]} Returns the new array of filtered values + * @example + * differenceBy([2, 1], [2, 3]) + * // => [1] + */ +declare function differenceBy(array: ArrayLike | null | undefined, ...values: Array>): T[]; +//#endregion +export { differenceBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceBy.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8ebee517815f20f023289b671a7ffd35f115beb1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceBy.d.ts @@ -0,0 +1,109 @@ +import { ValueIteratee } from "../_internal/ValueIteratee.js"; + +//#region src/compat/array/differenceBy.d.ts +/** + * Creates an array of array values not included in the other given arrays using an iteratee function. + * + * @template T1, T2 + * @param {ArrayLike | null | undefined} array The array to inspect + * @param {ArrayLike} values The values to exclude + * @param {ValueIteratee} iteratee The iteratee invoked per element + * @returns {T1[]} Returns the new array of filtered values + * @example + * differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor) + * // => [1.2] + */ +declare function differenceBy(array: ArrayLike | null | undefined, values: ArrayLike, iteratee: ValueIteratee): T1[]; +/** + * Creates an array of array values not included in the other given arrays using an iteratee function. + * + * @template T1, T2, T3 + * @param {ArrayLike | null | undefined} array The array to inspect + * @param {ArrayLike} values1 The first array of values to exclude + * @param {ArrayLike} values2 The second array of values to exclude + * @param {ValueIteratee} iteratee The iteratee invoked per element + * @returns {T1[]} Returns the new array of filtered values + * @example + * differenceBy([2.1, 1.2], [2.3], [1.4], Math.floor) + * // => [] + */ +declare function differenceBy(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, iteratee: ValueIteratee): T1[]; +/** + * Creates an array of array values not included in the other given arrays using an iteratee function. + * + * @template T1, T2, T3, T4 + * @param {ArrayLike | null | undefined} array The array to inspect + * @param {ArrayLike} values1 The first array of values to exclude + * @param {ArrayLike} values2 The second array of values to exclude + * @param {ArrayLike} values3 The third array of values to exclude + * @param {ValueIteratee} iteratee The iteratee invoked per element + * @returns {T1[]} Returns the new array of filtered values + * @example + * differenceBy([2.1, 1.2, 3.5], [2.3], [1.4], [3.2], Math.floor) + * // => [] + */ +declare function differenceBy(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, values3: ArrayLike, iteratee: ValueIteratee): T1[]; +/** + * Creates an array of array values not included in the other given arrays using an iteratee function. + * + * @template T1, T2, T3, T4, T5 + * @param {ArrayLike | null | undefined} array The array to inspect + * @param {ArrayLike} values1 The first array of values to exclude + * @param {ArrayLike} values2 The second array of values to exclude + * @param {ArrayLike} values3 The third array of values to exclude + * @param {ArrayLike} values4 The fourth array of values to exclude + * @param {ValueIteratee} iteratee The iteratee invoked per element + * @returns {T1[]} Returns the new array of filtered values + * @example + * differenceBy([2.1, 1.2, 3.5, 4.8], [2.3], [1.4], [3.2], [4.1], Math.floor) + * // => [] + */ +declare function differenceBy(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, values3: ArrayLike, values4: ArrayLike, iteratee: ValueIteratee): T1[]; +/** + * Creates an array of array values not included in the other given arrays using an iteratee function. + * + * @template T1, T2, T3, T4, T5, T6 + * @param {ArrayLike | null | undefined} array The array to inspect + * @param {ArrayLike} values1 The first array of values to exclude + * @param {ArrayLike} values2 The second array of values to exclude + * @param {ArrayLike} values3 The third array of values to exclude + * @param {ArrayLike} values4 The fourth array of values to exclude + * @param {ArrayLike} values5 The fifth array of values to exclude + * @param {ValueIteratee} iteratee The iteratee invoked per element + * @returns {T1[]} Returns the new array of filtered values + * @example + * differenceBy([2.1, 1.2, 3.5, 4.8, 5.3], [2.3], [1.4], [3.2], [4.1], [5.8], Math.floor) + * // => [] + */ +declare function differenceBy(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, values3: ArrayLike, values4: ArrayLike, values5: ArrayLike, iteratee: ValueIteratee): T1[]; +/** + * Creates an array of array values not included in the other given arrays using an iteratee function. + * + * @template T1, T2, T3, T4, T5, T6, T7 + * @param {ArrayLike | null | undefined} array The array to inspect + * @param {ArrayLike} values1 The first array of values to exclude + * @param {ArrayLike} values2 The second array of values to exclude + * @param {ArrayLike} values3 The third array of values to exclude + * @param {ArrayLike} values4 The fourth array of values to exclude + * @param {ArrayLike} values5 The fifth array of values to exclude + * @param {...(ArrayLike | ValueIteratee)[]} values Additional arrays of values to exclude and iteratee + * @returns {T1[]} Returns the new array of filtered values + * @example + * differenceBy([2.1, 1.2, 3.5, 4.8, 5.3, 6.7], [2.3], [1.4], [3.2], [4.1], [5.8], [6.2], Math.floor) + * // => [] + */ +declare function differenceBy(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, values3: ArrayLike, values4: ArrayLike, values5: ArrayLike, ...values: Array | ValueIteratee>): T1[]; +/** + * Creates an array of array values not included in the other given arrays. + * + * @template T + * @param {ArrayLike | null | undefined} array The array to inspect + * @param {...Array>} values The arrays of values to exclude + * @returns {T[]} Returns the new array of filtered values + * @example + * differenceBy([2, 1], [2, 3]) + * // => [1] + */ +declare function differenceBy(array: ArrayLike | null | undefined, ...values: Array>): T[]; +//#endregion +export { differenceBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceBy.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceBy.js new file mode 100644 index 0000000000000000000000000000000000000000..7ee4baf5fc1f592ef8767003aca5df4a4c77032c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceBy.js @@ -0,0 +1,24 @@ +const require_difference = require("../../array/difference.js"); +const require_differenceBy = require("../../array/differenceBy.js"); +const require_iteratee = require("../util/iteratee.js"); +const require_isArrayLikeObject = require("../predicate/isArrayLikeObject.js"); +const require_last = require("./last.js"); +const require_flattenArrayLike = require("../_internal/flattenArrayLike.js"); +//#region src/compat/array/differenceBy.ts +/** +* Computes the difference between an array and multiple arrays using an iteratee function. +* +* @template T +* @param {ArrayLike | null | undefined} arr - The primary array from which to derive the difference. +* @param {...any[]} values - Multiple arrays containing elements to be excluded from the primary array. +* @returns {T[]} A new array containing the elements that are present in the primary array but not in the values arrays. +*/ +function differenceBy(arr, ..._values) { + if (!require_isArrayLikeObject.isArrayLikeObject(arr)) return []; + const iteratee$1 = require_last.last(_values); + const values = require_flattenArrayLike.flattenArrayLike(_values); + if (require_isArrayLikeObject.isArrayLikeObject(iteratee$1)) return require_difference.difference(Array.from(arr), values); + return require_differenceBy.differenceBy(Array.from(arr), values, require_iteratee.iteratee(iteratee$1)); +} +//#endregion +exports.differenceBy = differenceBy; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceBy.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceBy.mjs new file mode 100644 index 0000000000000000000000000000000000000000..4cbb69df9016051c0fa91846b08e4e9710793f34 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceBy.mjs @@ -0,0 +1,24 @@ +import { difference } from "../../array/difference.mjs"; +import { differenceBy as differenceBy$1 } from "../../array/differenceBy.mjs"; +import { iteratee } from "../util/iteratee.mjs"; +import { isArrayLikeObject } from "../predicate/isArrayLikeObject.mjs"; +import { last } from "./last.mjs"; +import { flattenArrayLike } from "../_internal/flattenArrayLike.mjs"; +//#region src/compat/array/differenceBy.ts +/** +* Computes the difference between an array and multiple arrays using an iteratee function. +* +* @template T +* @param {ArrayLike | null | undefined} arr - The primary array from which to derive the difference. +* @param {...any[]} values - Multiple arrays containing elements to be excluded from the primary array. +* @returns {T[]} A new array containing the elements that are present in the primary array but not in the values arrays. +*/ +function differenceBy(arr, ..._values) { + if (!isArrayLikeObject(arr)) return []; + const iteratee$1 = last(_values); + const values = flattenArrayLike(_values); + if (isArrayLikeObject(iteratee$1)) return difference(Array.from(arr), values); + return differenceBy$1(Array.from(arr), values, iteratee(iteratee$1)); +} +//#endregion +export { differenceBy }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceWith.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceWith.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..b2c085bdcaab4f81982ca507af01b2db4feb15f9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceWith.d.mts @@ -0,0 +1,92 @@ +//#region src/compat/array/differenceWith.d.ts +/** + * Computes the difference between the primary array and another array using a comparator function. + * + * @template T1, T2 + * @param {ArrayLike | null | undefined} array - The primary array to compare elements against. + * @param {ArrayLike} values - The array containing elements to compare with the primary array. + * @param {(a: T1, b: T2) => boolean} comparator - A function to determine if two elements are considered equal. + * @returns {T1[]} A new array containing the elements from the primary array that do not match any elements in `values` based on the comparator. + * + * @example + * const array = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const values = [{ id: 2 }]; + * const comparator = (a, b) => a.id === b.id; + * + * const result = differenceWith(array, values, comparator); + * // result will be [{ id: 1 }, { id: 3 }] + */ +declare function differenceWith(array: ArrayLike | null | undefined, values: ArrayLike, comparator: (a: T1, b: T2) => boolean): T1[]; +/** + * Computes the difference between the primary array and two arrays using a comparator function. + * + * @template T1, T2, T3 + * @param {ArrayLike | null | undefined} array - The primary array to compare elements against. + * @param {ArrayLike} values1 - The first array containing elements to compare with the primary array. + * @param {ArrayLike} values2 - The second array containing elements to compare with the primary array. + * @param {(a: T1, b: T2 | T3) => boolean} comparator - A function to determine if two elements are considered equal. + * @returns {T1[]} A new array containing the elements from the primary array that do not match any elements in `values1` or `values2` based on the comparator. + * + * @example + * const array = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const values1 = [{ id: 2 }]; + * const values2 = [{ id: 3 }]; + * const comparator = (a, b) => a.id === b.id; + * + * const result = differenceWith(array, values1, values2, comparator); + * // result will be [{ id: 1 }] + */ +declare function differenceWith(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, comparator: (a: T1, b: T2 | T3) => boolean): T1[]; +/** + * Computes the difference between the primary array and multiple arrays using a comparator function. + * + * @template T1, T2, T3, T4 + * @param {ArrayLike | null | undefined} array - The primary array to compare elements against. + * @param {ArrayLike} values1 - The first array containing elements to compare with the primary array. + * @param {ArrayLike} values2 - The second array containing elements to compare with the primary array. + * @param {...Array | ((a: T1, b: T2 | T3 | T4) => boolean)>} values - Additional arrays and an optional comparator function to determine if two elements are considered equal. + * @returns {T1[]} A new array containing the elements from the primary array that do not match any elements + * in `values1`, `values2`, or subsequent arrays. If a comparator function is provided, it will be used to compare elements; + * otherwise, [SameValueZero](https://tc39.es/ecma262/multipage/abstract-operations.html#sec-samevaluezero) algorithm will be used. + * + * @example + * // Example with comparator function + * const array = [{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }]; + * const values1 = [{ id: 2 }]; + * const values2 = [{ id: 3 }]; + * const values3 = [{ id: 4 }]; + * const comparator = (a, b) => a.id === b.id; + * + * const result = differenceWith(array, values1, values2, values3, comparator); + * // result will be [{ id: 1 }] + * + * @example + * // Example without comparator function (behaves like `difference`) + * const array = [1, 2, 3, 4]; + * const values1 = [2]; + * const values2 = [3]; + * const values3 = [4]; + * + * const result = differenceWith(array, values1, values2, values3); + * // result will be [1] + */ +declare function differenceWith(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, ...values: Array | ((a: T1, b: T2 | T3 | T4) => boolean)>): T1[]; +/** + * Computes the difference between the primary array and one or more arrays without using a comparator function. + * + * @template T + * @param {ArrayLike | null | undefined} array - The primary array to compare elements against. + * @param {...Array>} values - One or more arrays containing elements to compare with the primary array. + * @returns {T[]} A new array containing the elements from the primary array that do not match any elements in the provided arrays. + * + * @example + * const array = [1, 2, 3]; + * const values1 = [2]; + * const values2 = [3]; + * + * const result = differenceWith(array, values1, values2); + * // result will be [1] + */ +declare function differenceWith(array: ArrayLike | null | undefined, ...values: Array>): T[]; +//#endregion +export { differenceWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceWith.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b2c085bdcaab4f81982ca507af01b2db4feb15f9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceWith.d.ts @@ -0,0 +1,92 @@ +//#region src/compat/array/differenceWith.d.ts +/** + * Computes the difference between the primary array and another array using a comparator function. + * + * @template T1, T2 + * @param {ArrayLike | null | undefined} array - The primary array to compare elements against. + * @param {ArrayLike} values - The array containing elements to compare with the primary array. + * @param {(a: T1, b: T2) => boolean} comparator - A function to determine if two elements are considered equal. + * @returns {T1[]} A new array containing the elements from the primary array that do not match any elements in `values` based on the comparator. + * + * @example + * const array = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const values = [{ id: 2 }]; + * const comparator = (a, b) => a.id === b.id; + * + * const result = differenceWith(array, values, comparator); + * // result will be [{ id: 1 }, { id: 3 }] + */ +declare function differenceWith(array: ArrayLike | null | undefined, values: ArrayLike, comparator: (a: T1, b: T2) => boolean): T1[]; +/** + * Computes the difference between the primary array and two arrays using a comparator function. + * + * @template T1, T2, T3 + * @param {ArrayLike | null | undefined} array - The primary array to compare elements against. + * @param {ArrayLike} values1 - The first array containing elements to compare with the primary array. + * @param {ArrayLike} values2 - The second array containing elements to compare with the primary array. + * @param {(a: T1, b: T2 | T3) => boolean} comparator - A function to determine if two elements are considered equal. + * @returns {T1[]} A new array containing the elements from the primary array that do not match any elements in `values1` or `values2` based on the comparator. + * + * @example + * const array = [{ id: 1 }, { id: 2 }, { id: 3 }]; + * const values1 = [{ id: 2 }]; + * const values2 = [{ id: 3 }]; + * const comparator = (a, b) => a.id === b.id; + * + * const result = differenceWith(array, values1, values2, comparator); + * // result will be [{ id: 1 }] + */ +declare function differenceWith(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, comparator: (a: T1, b: T2 | T3) => boolean): T1[]; +/** + * Computes the difference between the primary array and multiple arrays using a comparator function. + * + * @template T1, T2, T3, T4 + * @param {ArrayLike | null | undefined} array - The primary array to compare elements against. + * @param {ArrayLike} values1 - The first array containing elements to compare with the primary array. + * @param {ArrayLike} values2 - The second array containing elements to compare with the primary array. + * @param {...Array | ((a: T1, b: T2 | T3 | T4) => boolean)>} values - Additional arrays and an optional comparator function to determine if two elements are considered equal. + * @returns {T1[]} A new array containing the elements from the primary array that do not match any elements + * in `values1`, `values2`, or subsequent arrays. If a comparator function is provided, it will be used to compare elements; + * otherwise, [SameValueZero](https://tc39.es/ecma262/multipage/abstract-operations.html#sec-samevaluezero) algorithm will be used. + * + * @example + * // Example with comparator function + * const array = [{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }]; + * const values1 = [{ id: 2 }]; + * const values2 = [{ id: 3 }]; + * const values3 = [{ id: 4 }]; + * const comparator = (a, b) => a.id === b.id; + * + * const result = differenceWith(array, values1, values2, values3, comparator); + * // result will be [{ id: 1 }] + * + * @example + * // Example without comparator function (behaves like `difference`) + * const array = [1, 2, 3, 4]; + * const values1 = [2]; + * const values2 = [3]; + * const values3 = [4]; + * + * const result = differenceWith(array, values1, values2, values3); + * // result will be [1] + */ +declare function differenceWith(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, ...values: Array | ((a: T1, b: T2 | T3 | T4) => boolean)>): T1[]; +/** + * Computes the difference between the primary array and one or more arrays without using a comparator function. + * + * @template T + * @param {ArrayLike | null | undefined} array - The primary array to compare elements against. + * @param {...Array>} values - One or more arrays containing elements to compare with the primary array. + * @returns {T[]} A new array containing the elements from the primary array that do not match any elements in the provided arrays. + * + * @example + * const array = [1, 2, 3]; + * const values1 = [2]; + * const values2 = [3]; + * + * const result = differenceWith(array, values1, values2); + * // result will be [1] + */ +declare function differenceWith(array: ArrayLike | null | undefined, ...values: Array>): T[]; +//#endregion +export { differenceWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceWith.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceWith.js new file mode 100644 index 0000000000000000000000000000000000000000..8a557587e4b1d74ee1a7dd45f84360bb8e810cd5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceWith.js @@ -0,0 +1,42 @@ +const require_difference = require("../../array/difference.js"); +const require_differenceWith = require("../../array/differenceWith.js"); +const require_isArrayLikeObject = require("../predicate/isArrayLikeObject.js"); +const require_last = require("./last.js"); +const require_flattenArrayLike = require("../_internal/flattenArrayLike.js"); +//#region src/compat/array/differenceWith.ts +/** +* Computes the difference between the primary array and one or more arrays using an optional comparator function. +* +* @template T +* @param {ArrayLike | null | undefined} array - The primary array to compare elements against. +* @param {...Array | ((a: unknown, b: unknown) => boolean)>} values - One or more arrays to compare with the primary array, and an optional comparator function to determine if two elements are considered equal. +* @returns {T[]} A new array containing the elements from the primary array that do not match any elements in the provided arrays or those compared using the comparator function. +* +* @example +* // Example with a comparator function +* const array = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const values1 = [{ id: 2 }]; +* const values2 = [{ id: 3 }]; +* const comparator = (a, b) => a.id === b.id; +* +* const result = differenceWith(array, values1, values2, comparator); +* // result will be [{ id: 1 }] +* +* @example +* // Example without a comparator function +* const array = [1, 2, 3]; +* const values1 = [2]; +* const values2 = [3]; +* +* const result = differenceWith(array, values1, values2); +* // result will be [1] +*/ +function differenceWith(array, ...values) { + if (!require_isArrayLikeObject.isArrayLikeObject(array)) return []; + const comparator = require_last.last(values); + const flattenedValues = require_flattenArrayLike.flattenArrayLike(values); + if (typeof comparator === "function") return require_differenceWith.differenceWith(Array.from(array), flattenedValues, comparator); + return require_difference.difference(Array.from(array), flattenedValues); +} +//#endregion +exports.differenceWith = differenceWith; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceWith.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceWith.mjs new file mode 100644 index 0000000000000000000000000000000000000000..fe27f309662f57a75e88f733bc879b31db517c7b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/differenceWith.mjs @@ -0,0 +1,42 @@ +import { difference } from "../../array/difference.mjs"; +import { differenceWith as differenceWith$1 } from "../../array/differenceWith.mjs"; +import { isArrayLikeObject } from "../predicate/isArrayLikeObject.mjs"; +import { last } from "./last.mjs"; +import { flattenArrayLike } from "../_internal/flattenArrayLike.mjs"; +//#region src/compat/array/differenceWith.ts +/** +* Computes the difference between the primary array and one or more arrays using an optional comparator function. +* +* @template T +* @param {ArrayLike | null | undefined} array - The primary array to compare elements against. +* @param {...Array | ((a: unknown, b: unknown) => boolean)>} values - One or more arrays to compare with the primary array, and an optional comparator function to determine if two elements are considered equal. +* @returns {T[]} A new array containing the elements from the primary array that do not match any elements in the provided arrays or those compared using the comparator function. +* +* @example +* // Example with a comparator function +* const array = [{ id: 1 }, { id: 2 }, { id: 3 }]; +* const values1 = [{ id: 2 }]; +* const values2 = [{ id: 3 }]; +* const comparator = (a, b) => a.id === b.id; +* +* const result = differenceWith(array, values1, values2, comparator); +* // result will be [{ id: 1 }] +* +* @example +* // Example without a comparator function +* const array = [1, 2, 3]; +* const values1 = [2]; +* const values2 = [3]; +* +* const result = differenceWith(array, values1, values2); +* // result will be [1] +*/ +function differenceWith(array, ...values) { + if (!isArrayLikeObject(array)) return []; + const comparator = last(values); + const flattenedValues = flattenArrayLike(values); + if (typeof comparator === "function") return differenceWith$1(Array.from(array), flattenedValues, comparator); + return difference(Array.from(array), flattenedValues); +} +//#endregion +export { differenceWith }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/drop.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/drop.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..0f7d9f8077e9a9b40ce44a3a15d70c14a19ec290 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/drop.d.mts @@ -0,0 +1,21 @@ +//#region src/compat/array/drop.d.ts +/** + * Removes a specified number of elements from the beginning of an array and returns the rest. + * + * This function takes an array and a number, and returns a new array with the specified number + * of elements removed from the start. + * + * @template T - The type of elements in the array. + * @param {ArrayLike | null | undefined} collection - The array from which to drop elements. + * @param {number} itemsCount - The number of elements to drop from the beginning of the array. + * @param {unknown} [guard] - Enables use as an iteratee for methods like `_.map`. + * @returns {T[]} A new array with the specified number of elements removed from the start. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const result = drop(array, 2); + * result will be [3, 4, 5] since the first two elements are dropped. + */ +declare function drop(array: ArrayLike | null | undefined, n?: number): T[]; +//#endregion +export { drop }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/drop.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/drop.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0f7d9f8077e9a9b40ce44a3a15d70c14a19ec290 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/drop.d.ts @@ -0,0 +1,21 @@ +//#region src/compat/array/drop.d.ts +/** + * Removes a specified number of elements from the beginning of an array and returns the rest. + * + * This function takes an array and a number, and returns a new array with the specified number + * of elements removed from the start. + * + * @template T - The type of elements in the array. + * @param {ArrayLike | null | undefined} collection - The array from which to drop elements. + * @param {number} itemsCount - The number of elements to drop from the beginning of the array. + * @param {unknown} [guard] - Enables use as an iteratee for methods like `_.map`. + * @returns {T[]} A new array with the specified number of elements removed from the start. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const result = drop(array, 2); + * result will be [3, 4, 5] since the first two elements are dropped. + */ +declare function drop(array: ArrayLike | null | undefined, n?: number): T[]; +//#endregion +export { drop }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/drop.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/drop.js new file mode 100644 index 0000000000000000000000000000000000000000..07b85b499a2964749db508b78d79ae04f05adb66 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/drop.js @@ -0,0 +1,12 @@ +const require_drop = require("../../array/drop.js"); +const require_toInteger = require("../util/toInteger.js"); +const require_toArray = require("../_internal/toArray.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +//#region src/compat/array/drop.ts +function drop(collection, itemsCount = 1, guard) { + if (!require_isArrayLike.isArrayLike(collection)) return []; + itemsCount = guard ? 1 : require_toInteger.toInteger(itemsCount); + return require_drop.drop(require_toArray.toArray(collection), itemsCount); +} +//#endregion +exports.drop = drop; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/drop.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/drop.mjs new file mode 100644 index 0000000000000000000000000000000000000000..6c1c31c833a785fc15181c53b3080cf8248f4dd5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/drop.mjs @@ -0,0 +1,12 @@ +import { drop as drop$1 } from "../../array/drop.mjs"; +import { toInteger } from "../util/toInteger.mjs"; +import { toArray } from "../_internal/toArray.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +//#region src/compat/array/drop.ts +function drop(collection, itemsCount = 1, guard) { + if (!isArrayLike(collection)) return []; + itemsCount = guard ? 1 : toInteger(itemsCount); + return drop$1(toArray(collection), itemsCount); +} +//#endregion +export { drop }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRight.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRight.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..1419a5511ffedf66694bb99c9b017e61bb48f778 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRight.d.mts @@ -0,0 +1,21 @@ +//#region src/compat/array/dropRight.d.ts +/** + * Removes a specified number of elements from the end of an array and returns the rest. + * + * This function takes an array and a number, and returns a new array with the specified number + * of elements removed from the end. + * + * @template T - The type of elements in the array. + * @param {ArrayLike | null | undefined} collection - The array from which to drop elements. + * @param {number} itemsCount - The number of elements to drop from the end of the array. + * @param {unknown} [guard] - Enables use as an iteratee for methods like `_.map`. + * @returns {T[]} A new array with the specified number of elements removed from the end. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const result = dropRight(array, 2); + * // result will be [1, 2, 3] since the last two elements are dropped. + */ +declare function dropRight(array: ArrayLike | null | undefined, n?: number): T[]; +//#endregion +export { dropRight }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRight.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRight.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1419a5511ffedf66694bb99c9b017e61bb48f778 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRight.d.ts @@ -0,0 +1,21 @@ +//#region src/compat/array/dropRight.d.ts +/** + * Removes a specified number of elements from the end of an array and returns the rest. + * + * This function takes an array and a number, and returns a new array with the specified number + * of elements removed from the end. + * + * @template T - The type of elements in the array. + * @param {ArrayLike | null | undefined} collection - The array from which to drop elements. + * @param {number} itemsCount - The number of elements to drop from the end of the array. + * @param {unknown} [guard] - Enables use as an iteratee for methods like `_.map`. + * @returns {T[]} A new array with the specified number of elements removed from the end. + * + * @example + * const array = [1, 2, 3, 4, 5]; + * const result = dropRight(array, 2); + * // result will be [1, 2, 3] since the last two elements are dropped. + */ +declare function dropRight(array: ArrayLike | null | undefined, n?: number): T[]; +//#endregion +export { dropRight }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRight.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRight.js new file mode 100644 index 0000000000000000000000000000000000000000..6e1a87957d8fddec8ec78fc629738533f761940d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRight.js @@ -0,0 +1,29 @@ +const require_dropRight = require("../../array/dropRight.js"); +const require_toInteger = require("../util/toInteger.js"); +const require_toArray = require("../_internal/toArray.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +//#region src/compat/array/dropRight.ts +/** +* Removes a specified number of elements from the end of an array and returns the rest. +* +* This function takes an array and a number, and returns a new array with the specified number +* of elements removed from the end. +* +* @template T - The type of elements in the array. +* @param {ArrayLike | null | undefined} collection - The array from which to drop elements. +* @param {number} itemsCount - The number of elements to drop from the end of the array. +* @param {unknown} [guard] - Enables use as an iteratee for methods like `_.map`. +* @returns {T[]} A new array with the specified number of elements removed from the end. +* +* @example +* const array = [1, 2, 3, 4, 5]; +* const result = dropRight(array, 2); +* // result will be [1, 2, 3] since the last two elements are dropped. +*/ +function dropRight(collection, itemsCount = 1, guard) { + if (!require_isArrayLike.isArrayLike(collection)) return []; + itemsCount = guard ? 1 : require_toInteger.toInteger(itemsCount); + return require_dropRight.dropRight(require_toArray.toArray(collection), itemsCount); +} +//#endregion +exports.dropRight = dropRight; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRight.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRight.mjs new file mode 100644 index 0000000000000000000000000000000000000000..0838038c9eaa5a5ea7af80ff1bed4db2b94aa81a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRight.mjs @@ -0,0 +1,29 @@ +import { dropRight as dropRight$1 } from "../../array/dropRight.mjs"; +import { toInteger } from "../util/toInteger.mjs"; +import { toArray } from "../_internal/toArray.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +//#region src/compat/array/dropRight.ts +/** +* Removes a specified number of elements from the end of an array and returns the rest. +* +* This function takes an array and a number, and returns a new array with the specified number +* of elements removed from the end. +* +* @template T - The type of elements in the array. +* @param {ArrayLike | null | undefined} collection - The array from which to drop elements. +* @param {number} itemsCount - The number of elements to drop from the end of the array. +* @param {unknown} [guard] - Enables use as an iteratee for methods like `_.map`. +* @returns {T[]} A new array with the specified number of elements removed from the end. +* +* @example +* const array = [1, 2, 3, 4, 5]; +* const result = dropRight(array, 2); +* // result will be [1, 2, 3] since the last two elements are dropped. +*/ +function dropRight(collection, itemsCount = 1, guard) { + if (!isArrayLike(collection)) return []; + itemsCount = guard ? 1 : toInteger(itemsCount); + return dropRight$1(toArray(collection), itemsCount); +} +//#endregion +export { dropRight }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRightWhile.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRightWhile.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..d9b6d41709cf99d5db252ab198433ae16f5b44c7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRightWhile.d.mts @@ -0,0 +1,38 @@ +import { ListIteratee } from "../_internal/ListIteratee.mjs"; + +//#region src/compat/array/dropRightWhile.d.ts +/** + * Creates a slice of array excluding elements dropped from the end until predicate returns falsey. + * The predicate is invoked with three arguments: (value, index, array). + * + * @template T - The type of elements in the array. + * @param {ArrayLike | null | undefined} array - The array to query. + * @param {ListIteratee} [predicate] - The function invoked per iteration. + * @returns {T[]} Returns the slice of array. + * @example + * + * const users = [ + * { user: 'barney', active: true }, + * { user: 'fred', active: false }, + * { user: 'pebbles', active: false } + * ]; + * + * // Using function predicate + * dropRightWhile(users, user => !user.active); + * // => [{ user: 'barney', active: true }] + * + * // Using matches shorthand + * dropRightWhile(users, { user: 'pebbles', active: false }); + * // => [{ user: 'barney', active: true }, { user: 'fred', active: false }] + * + * // Using matchesProperty shorthand + * dropRightWhile(users, ['active', false]); + * // => [{ user: 'barney', active: true }] + * + * // Using property shorthand + * dropRightWhile(users, 'active'); + * // => [{ user: 'barney', active: true }] + */ +declare function dropRightWhile(array: ArrayLike | null | undefined, predicate?: ListIteratee): T[]; +//#endregion +export { dropRightWhile }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRightWhile.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRightWhile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..62d77c4909c73303ff1a4fae282691cd075a2b40 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRightWhile.d.ts @@ -0,0 +1,38 @@ +import { ListIteratee } from "../_internal/ListIteratee.js"; + +//#region src/compat/array/dropRightWhile.d.ts +/** + * Creates a slice of array excluding elements dropped from the end until predicate returns falsey. + * The predicate is invoked with three arguments: (value, index, array). + * + * @template T - The type of elements in the array. + * @param {ArrayLike | null | undefined} array - The array to query. + * @param {ListIteratee} [predicate] - The function invoked per iteration. + * @returns {T[]} Returns the slice of array. + * @example + * + * const users = [ + * { user: 'barney', active: true }, + * { user: 'fred', active: false }, + * { user: 'pebbles', active: false } + * ]; + * + * // Using function predicate + * dropRightWhile(users, user => !user.active); + * // => [{ user: 'barney', active: true }] + * + * // Using matches shorthand + * dropRightWhile(users, { user: 'pebbles', active: false }); + * // => [{ user: 'barney', active: true }, { user: 'fred', active: false }] + * + * // Using matchesProperty shorthand + * dropRightWhile(users, ['active', false]); + * // => [{ user: 'barney', active: true }] + * + * // Using property shorthand + * dropRightWhile(users, 'active'); + * // => [{ user: 'barney', active: true }] + */ +declare function dropRightWhile(array: ArrayLike | null | undefined, predicate?: ListIteratee): T[]; +//#endregion +export { dropRightWhile }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRightWhile.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRightWhile.js new file mode 100644 index 0000000000000000000000000000000000000000..8fc7f9cc497cff8966edda83cacee5b92fa6a364 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRightWhile.js @@ -0,0 +1,44 @@ +const require_dropRightWhile = require("../../array/dropRightWhile.js"); +const require_identity = require("../../function/identity.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +const require_property = require("../object/property.js"); +const require_matches = require("../predicate/matches.js"); +const require_matchesProperty = require("../predicate/matchesProperty.js"); +//#region src/compat/array/dropRightWhile.ts +/** +* Removes elements from the end of an array until the predicate returns false. +* +* This function iterates over an array and drops elements from the end until the provided +* predicate function returns false. It then returns a new array with the remaining elements. +* +* @template T - The type of elements in the array. +* @param {ArrayLike | null | undefined} arr - The array from which to drop elements. +* @param {(item: T, index: number, arr: T[]) => unknown} predicate - A predicate function that determines +* whether to continue dropping elements. The function is called with each element, index, and array, and dropping +* continues as long as it returns true. +* @returns {T[]} A new array with the elements remaining after the predicate returns false. +* +* @example +* const array = [3, 2, 1]; +* const result = dropRightWhile(array, (item, index, arr) => index >= 1); +* // Returns: [3] +*/ +function dropRightWhile(arr, predicate = require_identity.identity) { + if (!require_isArrayLike.isArrayLike(arr)) return []; + return dropRightWhileImpl(Array.from(arr), predicate); +} +function dropRightWhileImpl(arr, predicate) { + switch (typeof predicate) { + case "function": return require_dropRightWhile.dropRightWhile(arr, (item, index, arr) => Boolean(predicate(item, index, arr))); + case "object": if (Array.isArray(predicate) && predicate.length === 2) { + const key = predicate[0]; + const value = predicate[1]; + return require_dropRightWhile.dropRightWhile(arr, require_matchesProperty.matchesProperty(key, value)); + } else return require_dropRightWhile.dropRightWhile(arr, require_matches.matches(predicate)); + case "symbol": + case "number": + case "string": return require_dropRightWhile.dropRightWhile(arr, require_property.property(predicate)); + } +} +//#endregion +exports.dropRightWhile = dropRightWhile; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRightWhile.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRightWhile.mjs new file mode 100644 index 0000000000000000000000000000000000000000..8653e9451ab7948708c7f0fae78544314e9e9da5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropRightWhile.mjs @@ -0,0 +1,44 @@ +import { dropRightWhile as dropRightWhile$1 } from "../../array/dropRightWhile.mjs"; +import { identity } from "../../function/identity.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +import { property } from "../object/property.mjs"; +import { matches } from "../predicate/matches.mjs"; +import { matchesProperty } from "../predicate/matchesProperty.mjs"; +//#region src/compat/array/dropRightWhile.ts +/** +* Removes elements from the end of an array until the predicate returns false. +* +* This function iterates over an array and drops elements from the end until the provided +* predicate function returns false. It then returns a new array with the remaining elements. +* +* @template T - The type of elements in the array. +* @param {ArrayLike | null | undefined} arr - The array from which to drop elements. +* @param {(item: T, index: number, arr: T[]) => unknown} predicate - A predicate function that determines +* whether to continue dropping elements. The function is called with each element, index, and array, and dropping +* continues as long as it returns true. +* @returns {T[]} A new array with the elements remaining after the predicate returns false. +* +* @example +* const array = [3, 2, 1]; +* const result = dropRightWhile(array, (item, index, arr) => index >= 1); +* // Returns: [3] +*/ +function dropRightWhile(arr, predicate = identity) { + if (!isArrayLike(arr)) return []; + return dropRightWhileImpl(Array.from(arr), predicate); +} +function dropRightWhileImpl(arr, predicate) { + switch (typeof predicate) { + case "function": return dropRightWhile$1(arr, (item, index, arr) => Boolean(predicate(item, index, arr))); + case "object": if (Array.isArray(predicate) && predicate.length === 2) { + const key = predicate[0]; + const value = predicate[1]; + return dropRightWhile$1(arr, matchesProperty(key, value)); + } else return dropRightWhile$1(arr, matches(predicate)); + case "symbol": + case "number": + case "string": return dropRightWhile$1(arr, property(predicate)); + } +} +//#endregion +export { dropRightWhile }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/dropWhile.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropWhile.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..01baddc12aaee99c88d9f3a631df589265901a43 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropWhile.d.mts @@ -0,0 +1,29 @@ +import { ListIteratee } from "../_internal/ListIteratee.mjs"; + +//#region src/compat/array/dropWhile.d.ts +/** + * Creates a slice of array excluding elements dropped from the beginning. + * Elements are dropped until predicate returns falsey. + * The predicate is invoked with three arguments: (value, index, array). + * + * @template T - The type of elements in the array + * @param {ArrayLike | null | undefined} arr - The array to query + * @param {ListIteratee} [predicate=identity] - The function invoked per iteration + * @returns {T[]} Returns the slice of array + * + * @example + * dropWhile([1, 2, 3], n => n < 3) + * // => [3] + * + * dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], { a: 1 }) + * // => [] + * + * dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], ['a', 1]) + * // => [] + * + * dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], 'a') + * // => [] + */ +declare function dropWhile(arr: ArrayLike | null | undefined, predicate?: ListIteratee): T[]; +//#endregion +export { dropWhile }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/dropWhile.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropWhile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3062bab0b949a55573559704c96182e95b33a8d1 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropWhile.d.ts @@ -0,0 +1,29 @@ +import { ListIteratee } from "../_internal/ListIteratee.js"; + +//#region src/compat/array/dropWhile.d.ts +/** + * Creates a slice of array excluding elements dropped from the beginning. + * Elements are dropped until predicate returns falsey. + * The predicate is invoked with three arguments: (value, index, array). + * + * @template T - The type of elements in the array + * @param {ArrayLike | null | undefined} arr - The array to query + * @param {ListIteratee} [predicate=identity] - The function invoked per iteration + * @returns {T[]} Returns the slice of array + * + * @example + * dropWhile([1, 2, 3], n => n < 3) + * // => [3] + * + * dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], { a: 1 }) + * // => [] + * + * dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], ['a', 1]) + * // => [] + * + * dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], 'a') + * // => [] + */ +declare function dropWhile(arr: ArrayLike | null | undefined, predicate?: ListIteratee): T[]; +//#endregion +export { dropWhile }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/dropWhile.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropWhile.js new file mode 100644 index 0000000000000000000000000000000000000000..01ca24c592f93664ba0868611945a445cb8ff81f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropWhile.js @@ -0,0 +1,50 @@ +const require_dropWhile = require("../../array/dropWhile.js"); +const require_identity = require("../../function/identity.js"); +const require_toArray = require("../_internal/toArray.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +const require_property = require("../object/property.js"); +const require_matches = require("../predicate/matches.js"); +const require_matchesProperty = require("../predicate/matchesProperty.js"); +//#region src/compat/array/dropWhile.ts +/** +* Creates a slice of array excluding elements dropped from the beginning. +* Elements are dropped until predicate returns falsey. +* The predicate is invoked with three arguments: (value, index, array). +* +* @template T - The type of elements in the array +* @param {ArrayLike | null | undefined} arr - The array to query +* @param {ListIteratee} [predicate=identity] - The function invoked per iteration +* @returns {T[]} Returns the slice of array +* +* @example +* dropWhile([1, 2, 3], n => n < 3) +* // => [3] +* +* dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], { a: 1 }) +* // => [] +* +* dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], ['a', 1]) +* // => [] +* +* dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], 'a') +* // => [] +*/ +function dropWhile(arr, predicate = require_identity.identity) { + if (!require_isArrayLike.isArrayLike(arr)) return []; + return dropWhileImpl(require_toArray.toArray(arr), predicate); +} +function dropWhileImpl(arr, predicate) { + switch (typeof predicate) { + case "function": return require_dropWhile.dropWhile(arr, (item, index, arr) => Boolean(predicate(item, index, arr))); + case "object": if (Array.isArray(predicate) && predicate.length === 2) { + const key = predicate[0]; + const value = predicate[1]; + return require_dropWhile.dropWhile(arr, require_matchesProperty.matchesProperty(key, value)); + } else return require_dropWhile.dropWhile(arr, require_matches.matches(predicate)); + case "number": + case "symbol": + case "string": return require_dropWhile.dropWhile(arr, require_property.property(predicate)); + } +} +//#endregion +exports.dropWhile = dropWhile; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/dropWhile.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropWhile.mjs new file mode 100644 index 0000000000000000000000000000000000000000..097646094964f20dc50656165b50000879609f64 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/dropWhile.mjs @@ -0,0 +1,50 @@ +import { dropWhile as dropWhile$1 } from "../../array/dropWhile.mjs"; +import { identity } from "../../function/identity.mjs"; +import { toArray } from "../_internal/toArray.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +import { property } from "../object/property.mjs"; +import { matches } from "../predicate/matches.mjs"; +import { matchesProperty } from "../predicate/matchesProperty.mjs"; +//#region src/compat/array/dropWhile.ts +/** +* Creates a slice of array excluding elements dropped from the beginning. +* Elements are dropped until predicate returns falsey. +* The predicate is invoked with three arguments: (value, index, array). +* +* @template T - The type of elements in the array +* @param {ArrayLike | null | undefined} arr - The array to query +* @param {ListIteratee} [predicate=identity] - The function invoked per iteration +* @returns {T[]} Returns the slice of array +* +* @example +* dropWhile([1, 2, 3], n => n < 3) +* // => [3] +* +* dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], { a: 1 }) +* // => [] +* +* dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], ['a', 1]) +* // => [] +* +* dropWhile([{ a: 1, b: 2 }, { a: 1, b: 3 }], 'a') +* // => [] +*/ +function dropWhile(arr, predicate = identity) { + if (!isArrayLike(arr)) return []; + return dropWhileImpl(toArray(arr), predicate); +} +function dropWhileImpl(arr, predicate) { + switch (typeof predicate) { + case "function": return dropWhile$1(arr, (item, index, arr) => Boolean(predicate(item, index, arr))); + case "object": if (Array.isArray(predicate) && predicate.length === 2) { + const key = predicate[0]; + const value = predicate[1]; + return dropWhile$1(arr, matchesProperty(key, value)); + } else return dropWhile$1(arr, matches(predicate)); + case "number": + case "symbol": + case "string": return dropWhile$1(arr, property(predicate)); + } +} +//#endregion +export { dropWhile }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/each.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/each.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..f1ba24cf7f4e431105f05aa11f7f755c8857bf68 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/each.d.mts @@ -0,0 +1 @@ +import { forEach } from "./forEach.mjs"; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/each.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/each.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..65b02279aa832076199d8aaf0716578d0e38a347 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/each.d.ts @@ -0,0 +1 @@ +import { forEach } from "./forEach.js"; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/each.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/each.js new file mode 100644 index 0000000000000000000000000000000000000000..ba30e2aa75a8d5455a19038e15545df9b12e2c5a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/each.js @@ -0,0 +1 @@ +require("./forEach.js"); diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/each.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/each.mjs new file mode 100644 index 0000000000000000000000000000000000000000..092e3d6dc378cd4febccc47ae513fdad27537694 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/each.mjs @@ -0,0 +1 @@ +import "./forEach.mjs"; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/eachRight.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/eachRight.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..0d29b8d6ed342bdeeb7968bd0c48fdd6e7f8506a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/eachRight.d.mts @@ -0,0 +1 @@ +import { forEachRight } from "./forEachRight.mjs"; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/eachRight.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/eachRight.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e279fadb1e55cfd44f0505a4fd31fb94312155de --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/eachRight.d.ts @@ -0,0 +1 @@ +import { forEachRight } from "./forEachRight.js"; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/eachRight.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/eachRight.js new file mode 100644 index 0000000000000000000000000000000000000000..49cb59940c174bf45b5072dcffe8660fa06fbc96 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/eachRight.js @@ -0,0 +1 @@ +require("./forEachRight.js"); diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/eachRight.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/eachRight.mjs new file mode 100644 index 0000000000000000000000000000000000000000..6854cd9a5dbb652b25414102e58fba9a8aa9ecc2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/eachRight.mjs @@ -0,0 +1 @@ +import "./forEachRight.mjs"; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/every.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/every.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..02636489e9e7e479d5634b67b822cb6d1cf8382d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/every.d.mts @@ -0,0 +1,65 @@ +import { ListIterateeCustom } from "../_internal/ListIterateeCustom.mjs"; +import { ObjectIterateeCustom } from "../_internal/ObjectIteratee.mjs"; + +//#region src/compat/array/every.d.ts +/** + * Checks if all elements in a collection pass the predicate check. + * The predicate is invoked with three arguments: (value, index|key, collection). + * + * @template T - The type of elements in the collection + * @param {ArrayLike | null | undefined} collection - The collection to iterate over + * @param {ListIterateeCustom} [predicate=identity] - The function invoked per iteration + * @returns {boolean} Returns true if all elements pass the predicate check, else false + * + * @example + * // Using a function predicate + * every([true, 1, null, 'yes'], Boolean) + * // => false + * + * // Using property shorthand + * const users = [{ user: 'barney', age: 36 }, { user: 'fred', age: 40 }] + * every(users, 'age') + * // => true + * + * // Using matches shorthand + * every(users, { age: 36 }) + * // => false + * + * // Using matchesProperty shorthand + * every(users, ['age', 36]) + * // => false + */ +declare function every(collection: ArrayLike | null | undefined, predicate?: ListIterateeCustom): boolean; +/** + * Checks if all elements in an object pass the predicate check. + * The predicate is invoked with three arguments: (value, key, object). + * + * @template T - The type of the object + * @param {T | null | undefined} collection - The object to iterate over + * @param {ObjectIterateeCustom} [predicate=identity] - The function invoked per iteration + * @returns {boolean} Returns true if all elements pass the predicate check, else false + * + * @example + * // Using a function predicate + * every({ a: true, b: 1, c: null }, Boolean) + * // => false + * + * // Using property shorthand + * const users = { + * barney: { active: true, age: 36 }, + * fred: { active: true, age: 40 } + * } + * every(users, 'active') + * // => true + * + * // Using matches shorthand + * every(users, { active: true }) + * // => true + * + * // Using matchesProperty shorthand + * every(users, ['age', 36]) + * // => false + */ +declare function every(collection: T | null | undefined, predicate?: ObjectIterateeCustom): boolean; +//#endregion +export { every }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/every.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/every.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ae60b3eea136e71827a9856b80fdb9cbca03263f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/every.d.ts @@ -0,0 +1,65 @@ +import { ListIterateeCustom } from "../_internal/ListIterateeCustom.js"; +import { ObjectIterateeCustom } from "../_internal/ObjectIteratee.js"; + +//#region src/compat/array/every.d.ts +/** + * Checks if all elements in a collection pass the predicate check. + * The predicate is invoked with three arguments: (value, index|key, collection). + * + * @template T - The type of elements in the collection + * @param {ArrayLike | null | undefined} collection - The collection to iterate over + * @param {ListIterateeCustom} [predicate=identity] - The function invoked per iteration + * @returns {boolean} Returns true if all elements pass the predicate check, else false + * + * @example + * // Using a function predicate + * every([true, 1, null, 'yes'], Boolean) + * // => false + * + * // Using property shorthand + * const users = [{ user: 'barney', age: 36 }, { user: 'fred', age: 40 }] + * every(users, 'age') + * // => true + * + * // Using matches shorthand + * every(users, { age: 36 }) + * // => false + * + * // Using matchesProperty shorthand + * every(users, ['age', 36]) + * // => false + */ +declare function every(collection: ArrayLike | null | undefined, predicate?: ListIterateeCustom): boolean; +/** + * Checks if all elements in an object pass the predicate check. + * The predicate is invoked with three arguments: (value, key, object). + * + * @template T - The type of the object + * @param {T | null | undefined} collection - The object to iterate over + * @param {ObjectIterateeCustom} [predicate=identity] - The function invoked per iteration + * @returns {boolean} Returns true if all elements pass the predicate check, else false + * + * @example + * // Using a function predicate + * every({ a: true, b: 1, c: null }, Boolean) + * // => false + * + * // Using property shorthand + * const users = { + * barney: { active: true, age: 36 }, + * fred: { active: true, age: 40 } + * } + * every(users, 'active') + * // => true + * + * // Using matches shorthand + * every(users, { active: true }) + * // => true + * + * // Using matchesProperty shorthand + * every(users, ['age', 36]) + * // => false + */ +declare function every(collection: T | null | undefined, predicate?: ObjectIterateeCustom): boolean; +//#endregion +export { every }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/every.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/every.js new file mode 100644 index 0000000000000000000000000000000000000000..1d6236103026c1f19fbae4a02d2849aabef4adee --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/every.js @@ -0,0 +1,58 @@ +const require_identity = require("../../function/identity.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +const require_property = require("../object/property.js"); +const require_matches = require("../predicate/matches.js"); +const require_matchesProperty = require("../predicate/matchesProperty.js"); +const require_isIterateeCall = require("../_internal/isIterateeCall.js"); +//#region src/compat/array/every.ts +/** +* Checks if every item in an object has a specific property, where the property name is provided as a PropertyKey. +* +* @template T +* @param {T extends Record ? T : never} object - The object to check through. +* @param {ArrayLike | Record | null | undefined} source - The source array or object to check through. +* @param {((item: T, index: number, arr: any) => unknown) | Partial | [keyof T, unknown] | PropertyKey} doesMatch - The criteria to match. It can be a function, a partial object, a key-value pair, or a property name. +* @param {PropertyKey} propertyToCheck - The property name to check. +* @param {unknown} guard - Enables use as an iteratee for methods like `_.map`. +* @returns {boolean} - `true` if every property value has the specified property, or `false` if at least one does not match. +* +* @example +* // Using a property name +* const obj = { a: { id: 1, name: 'Alice' }, b: { id: 2, name: 'Bob' } }; +* const result = every(obj, 'name'); +* console.log(result); // true +*/ +function every(source, doesMatch, guard) { + if (!source) return true; + if (guard && require_isIterateeCall.isIterateeCall(source, doesMatch, guard)) doesMatch = void 0; + if (!doesMatch) doesMatch = require_identity.identity; + let predicate; + switch (typeof doesMatch) { + case "function": + predicate = doesMatch; + break; + case "object": + if (Array.isArray(doesMatch) && doesMatch.length === 2) { + const key = doesMatch[0]; + const value = doesMatch[1]; + predicate = require_matchesProperty.matchesProperty(key, value); + } else predicate = require_matches.matches(doesMatch); + break; + case "symbol": + case "number": + case "string": predicate = require_property.property(doesMatch); + } + if (!require_isArrayLike.isArrayLike(source)) { + const keys = Object.keys(source); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const value = source[key]; + if (!predicate(value, key, source)) return false; + } + return true; + } + for (let i = 0; i < source.length; i++) if (!predicate(source[i], i, source)) return false; + return true; +} +//#endregion +exports.every = every; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/every.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/every.mjs new file mode 100644 index 0000000000000000000000000000000000000000..e01f04f28894c081c32c1675b3fe9c00a8676f38 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/every.mjs @@ -0,0 +1,58 @@ +import { identity } from "../../function/identity.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +import { property } from "../object/property.mjs"; +import { matches } from "../predicate/matches.mjs"; +import { matchesProperty } from "../predicate/matchesProperty.mjs"; +import { isIterateeCall } from "../_internal/isIterateeCall.mjs"; +//#region src/compat/array/every.ts +/** +* Checks if every item in an object has a specific property, where the property name is provided as a PropertyKey. +* +* @template T +* @param {T extends Record ? T : never} object - The object to check through. +* @param {ArrayLike | Record | null | undefined} source - The source array or object to check through. +* @param {((item: T, index: number, arr: any) => unknown) | Partial | [keyof T, unknown] | PropertyKey} doesMatch - The criteria to match. It can be a function, a partial object, a key-value pair, or a property name. +* @param {PropertyKey} propertyToCheck - The property name to check. +* @param {unknown} guard - Enables use as an iteratee for methods like `_.map`. +* @returns {boolean} - `true` if every property value has the specified property, or `false` if at least one does not match. +* +* @example +* // Using a property name +* const obj = { a: { id: 1, name: 'Alice' }, b: { id: 2, name: 'Bob' } }; +* const result = every(obj, 'name'); +* console.log(result); // true +*/ +function every(source, doesMatch, guard) { + if (!source) return true; + if (guard && isIterateeCall(source, doesMatch, guard)) doesMatch = void 0; + if (!doesMatch) doesMatch = identity; + let predicate; + switch (typeof doesMatch) { + case "function": + predicate = doesMatch; + break; + case "object": + if (Array.isArray(doesMatch) && doesMatch.length === 2) { + const key = doesMatch[0]; + const value = doesMatch[1]; + predicate = matchesProperty(key, value); + } else predicate = matches(doesMatch); + break; + case "symbol": + case "number": + case "string": predicate = property(doesMatch); + } + if (!isArrayLike(source)) { + const keys = Object.keys(source); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const value = source[key]; + if (!predicate(value, key, source)) return false; + } + return true; + } + for (let i = 0; i < source.length; i++) if (!predicate(source[i], i, source)) return false; + return true; +} +//#endregion +export { every }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/fill.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/fill.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..c988ccb803f7555a19674c06702ce29dfab4f0ee --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/fill.d.mts @@ -0,0 +1,54 @@ +import { MutableList } from "../_internal/MutableList.mjs"; +import { RejectReadonly } from "../_internal/RejectReadonly.mjs"; + +//#region src/compat/array/fill.d.ts +/** + * Fills an array with a value. + * @template T + * @param {any[] | null | undefined} array - The array to fill + * @param {T} value - The value to fill array with + * @returns {T[]} Returns the filled array + * @example + * fill([1, 2, 3], 'a') + * // => ['a', 'a', 'a'] + */ +declare function fill(array: any[] | null | undefined, value: T): T[]; +/** + * Fills an array-like object with a value. + * @template T, AL + * @param {RejectReadonly | null | undefined} array - The array-like object to fill + * @param {T} value - The value to fill array with + * @returns {ArrayLike} Returns the filled array-like object + * @example + * fill({ length: 3 }, 2) + * // => { 0: 2, 1: 2, 2: 2, length: 3 } + */ +declare function fill>(array: RejectReadonly | null | undefined, value: T): ArrayLike; +/** + * Fills an array with a value from start up to end. + * @template T, U + * @param {U[] | null | undefined} array - The array to fill + * @param {T} value - The value to fill array with + * @param {number} [start=0] - The start position + * @param {number} [end=array.length] - The end position + * @returns {Array} Returns the filled array + * @example + * fill([1, 2, 3], 'a', 1, 2) + * // => [1, 'a', 3] + */ +declare function fill(array: U[] | null | undefined, value: T, start?: number, end?: number): Array; +/** + * Fills an array-like object with a value from start up to end. + * @template T, U + * @param {U extends readonly any[] ? never : U | null | undefined} array - The array-like object to fill + * @param {T} value - The value to fill array with + * @param {number} [start=0] - The start position + * @param {number} [end=array.length] - The end position + * @returns {ArrayLike} Returns the filled array-like object + * @example + * fill({ 0: 1, 1: 2, 2: 3, length: 3 }, 'a', 1, 2) + * // => { 0: 1, 1: 'a', 2: 3, length: 3 } + */ +declare function fill>(array: RejectReadonly | null | undefined, value: T, start?: number, end?: number): ArrayLike; +//#endregion +export { fill }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/fill.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/fill.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6d12d8a4ae662e1ee1924323cee475bd13e78a96 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/fill.d.ts @@ -0,0 +1,54 @@ +import { MutableList } from "../_internal/MutableList.js"; +import { RejectReadonly } from "../_internal/RejectReadonly.js"; + +//#region src/compat/array/fill.d.ts +/** + * Fills an array with a value. + * @template T + * @param {any[] | null | undefined} array - The array to fill + * @param {T} value - The value to fill array with + * @returns {T[]} Returns the filled array + * @example + * fill([1, 2, 3], 'a') + * // => ['a', 'a', 'a'] + */ +declare function fill(array: any[] | null | undefined, value: T): T[]; +/** + * Fills an array-like object with a value. + * @template T, AL + * @param {RejectReadonly | null | undefined} array - The array-like object to fill + * @param {T} value - The value to fill array with + * @returns {ArrayLike} Returns the filled array-like object + * @example + * fill({ length: 3 }, 2) + * // => { 0: 2, 1: 2, 2: 2, length: 3 } + */ +declare function fill>(array: RejectReadonly | null | undefined, value: T): ArrayLike; +/** + * Fills an array with a value from start up to end. + * @template T, U + * @param {U[] | null | undefined} array - The array to fill + * @param {T} value - The value to fill array with + * @param {number} [start=0] - The start position + * @param {number} [end=array.length] - The end position + * @returns {Array} Returns the filled array + * @example + * fill([1, 2, 3], 'a', 1, 2) + * // => [1, 'a', 3] + */ +declare function fill(array: U[] | null | undefined, value: T, start?: number, end?: number): Array; +/** + * Fills an array-like object with a value from start up to end. + * @template T, U + * @param {U extends readonly any[] ? never : U | null | undefined} array - The array-like object to fill + * @param {T} value - The value to fill array with + * @param {number} [start=0] - The start position + * @param {number} [end=array.length] - The end position + * @returns {ArrayLike} Returns the filled array-like object + * @example + * fill({ 0: 1, 1: 2, 2: 3, length: 3 }, 'a', 1, 2) + * // => { 0: 1, 1: 'a', 2: 3, length: 3 } + */ +declare function fill>(array: RejectReadonly | null | undefined, value: T, start?: number, end?: number): ArrayLike; +//#endregion +export { fill }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/fill.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/fill.js new file mode 100644 index 0000000000000000000000000000000000000000..18c1094d177b4e3d504e9688732799556d4be64b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/fill.js @@ -0,0 +1,42 @@ +const require_fill = require("../../array/fill.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +const require_isString = require("../predicate/isString.js"); +//#region src/compat/array/fill.ts +/** +* Fills elements of an array with a specified value from the start position up to, but not including, the end position. +* +* This function mutates the original array and replaces its elements with the provided value, starting from the specified +* start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the +* entire array. +* +* @template T, U +* @param {ArrayLike | null | undefined} array - The array to fill. +* @param {U} value - The value to fill the array with. +* @param {number} [start=0] - The start position. Defaults to 0. +* @param {number} [end=arr.length] - The end position. Defaults to the array's length. +* @returns {ArrayLike} The array with the filled values. +* +* @example +* fill([1, 2, 3], 'a'); +* // => ['a', 'a', 'a'] +* +* fill(Array(3), 2); +* // => [2, 2, 2] +* +* fill([4, 6, 8, 10], '*', 1, 3); +* // => [4, '*', '*', 10] +* +* fill([1, 2, 3], '*', -2, -1); +* // => [1, '*', 3] +*/ +function fill(array, value, start = 0, end = array ? array.length : 0) { + if (!require_isArrayLike.isArrayLike(array)) return []; + if (require_isString.isString(array)) return array; + start = Math.floor(start); + end = Math.floor(end); + if (!start) start = 0; + if (!end) end = 0; + return require_fill.fill(array, value, start, end); +} +//#endregion +exports.fill = fill; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/fill.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/fill.mjs new file mode 100644 index 0000000000000000000000000000000000000000..36497e851d664597769a5b8726de8c54bb75e275 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/fill.mjs @@ -0,0 +1,42 @@ +import { fill as fill$1 } from "../../array/fill.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +import { isString } from "../predicate/isString.mjs"; +//#region src/compat/array/fill.ts +/** +* Fills elements of an array with a specified value from the start position up to, but not including, the end position. +* +* This function mutates the original array and replaces its elements with the provided value, starting from the specified +* start index up to the end index (non-inclusive). If the start or end indices are not provided, it defaults to filling the +* entire array. +* +* @template T, U +* @param {ArrayLike | null | undefined} array - The array to fill. +* @param {U} value - The value to fill the array with. +* @param {number} [start=0] - The start position. Defaults to 0. +* @param {number} [end=arr.length] - The end position. Defaults to the array's length. +* @returns {ArrayLike} The array with the filled values. +* +* @example +* fill([1, 2, 3], 'a'); +* // => ['a', 'a', 'a'] +* +* fill(Array(3), 2); +* // => [2, 2, 2] +* +* fill([4, 6, 8, 10], '*', 1, 3); +* // => [4, '*', '*', 10] +* +* fill([1, 2, 3], '*', -2, -1); +* // => [1, '*', 3] +*/ +function fill(array, value, start = 0, end = array ? array.length : 0) { + if (!isArrayLike(array)) return []; + if (isString(array)) return array; + start = Math.floor(start); + end = Math.floor(end); + if (!start) start = 0; + if (!end) end = 0; + return fill$1(array, value, start, end); +} +//#endregion +export { fill }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/filter.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/filter.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..2e4199f4286fcb940785f7b7d35b5d0dfaccc154 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/filter.d.mts @@ -0,0 +1,75 @@ +import { ObjectIteratorTypeGuard } from "../_internal/ObjectIterator.mjs"; +import { StringIterator } from "../_internal/StringIterator.mjs"; +import { ListIterateeCustom } from "../_internal/ListIterateeCustom.mjs"; +import { ObjectIterateeCustom } from "../_internal/ObjectIteratee.mjs"; +import { ListIteratorTypeGuard } from "../_internal/ListIteratorTypeGuard.mjs"; + +//#region src/compat/array/filter.d.ts +/** + * Filters characters in a string based on the predicate function. + * + * @param collection - The string to filter + * @param predicate - The function to test each character + * @returns An array of characters that pass the predicate test + * + * @example + * filter('123', char => char === '2') + * // => ['2'] + */ +declare function filter(collection: string | null | undefined, predicate?: StringIterator): string[]; +/** + * Filters elements in an array-like object using a type guard predicate. + * + * @param collection - The array-like object to filter + * @param predicate - The type guard function to test each element + * @returns An array of elements that are of type U + * + * @example + * filter([1, '2', 3], (x): x is number => typeof x === 'number') + * // => [1, 3] + */ +declare function filter(collection: ArrayLike | null | undefined, predicate: ListIteratorTypeGuard): U[]; +/** + * Filters elements in an array-like object based on the predicate. + * + * @param collection - The array-like object to filter + * @param predicate - The function or shorthand to test each element + * @returns An array of elements that pass the predicate test + * + * @example + * filter([1, 2, 3], x => x > 1) + * // => [2, 3] + * + * filter([{ a: 1 }, { a: 2 }], { a: 1 }) + * // => [{ a: 1 }] + */ +declare function filter(collection: ArrayLike | null | undefined, predicate?: ListIterateeCustom): T[]; +/** + * Filters values in an object using a type guard predicate. + * + * @param collection - The object to filter + * @param predicate - The type guard function to test each value + * @returns An array of values that are of type U + * + * @example + * filter({ a: 1, b: '2', c: 3 }, (x): x is number => typeof x === 'number') + * // => [1, 3] + */ +declare function filter(collection: T | null | undefined, predicate: ObjectIteratorTypeGuard): U[]; +/** + * Filters values in an object based on the predicate. + * + * @param collection - The object to filter + * @param predicate - The function or shorthand to test each value + * @returns An array of values that pass the predicate test + * + * @example + * filter({ a: 1, b: 2 }, x => x > 1) + * // => [2] + * + * filter({ a: { x: 1 }, b: { x: 2 } }, { x: 1 }) + * // => [{ x: 1 }] + */ +declare function filter(collection: T | null | undefined, predicate?: ObjectIterateeCustom): Array; +//#endregion +export { filter }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/filter.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/filter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..70760adfc4c69c44d6192448f7ec51ba8ff74da2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/filter.d.ts @@ -0,0 +1,75 @@ +import { ObjectIteratorTypeGuard } from "../_internal/ObjectIterator.js"; +import { StringIterator } from "../_internal/StringIterator.js"; +import { ListIterateeCustom } from "../_internal/ListIterateeCustom.js"; +import { ObjectIterateeCustom } from "../_internal/ObjectIteratee.js"; +import { ListIteratorTypeGuard } from "../_internal/ListIteratorTypeGuard.js"; + +//#region src/compat/array/filter.d.ts +/** + * Filters characters in a string based on the predicate function. + * + * @param collection - The string to filter + * @param predicate - The function to test each character + * @returns An array of characters that pass the predicate test + * + * @example + * filter('123', char => char === '2') + * // => ['2'] + */ +declare function filter(collection: string | null | undefined, predicate?: StringIterator): string[]; +/** + * Filters elements in an array-like object using a type guard predicate. + * + * @param collection - The array-like object to filter + * @param predicate - The type guard function to test each element + * @returns An array of elements that are of type U + * + * @example + * filter([1, '2', 3], (x): x is number => typeof x === 'number') + * // => [1, 3] + */ +declare function filter(collection: ArrayLike | null | undefined, predicate: ListIteratorTypeGuard): U[]; +/** + * Filters elements in an array-like object based on the predicate. + * + * @param collection - The array-like object to filter + * @param predicate - The function or shorthand to test each element + * @returns An array of elements that pass the predicate test + * + * @example + * filter([1, 2, 3], x => x > 1) + * // => [2, 3] + * + * filter([{ a: 1 }, { a: 2 }], { a: 1 }) + * // => [{ a: 1 }] + */ +declare function filter(collection: ArrayLike | null | undefined, predicate?: ListIterateeCustom): T[]; +/** + * Filters values in an object using a type guard predicate. + * + * @param collection - The object to filter + * @param predicate - The type guard function to test each value + * @returns An array of values that are of type U + * + * @example + * filter({ a: 1, b: '2', c: 3 }, (x): x is number => typeof x === 'number') + * // => [1, 3] + */ +declare function filter(collection: T | null | undefined, predicate: ObjectIteratorTypeGuard): U[]; +/** + * Filters values in an object based on the predicate. + * + * @param collection - The object to filter + * @param predicate - The function or shorthand to test each value + * @returns An array of values that pass the predicate test + * + * @example + * filter({ a: 1, b: 2 }, x => x > 1) + * // => [2] + * + * filter({ a: { x: 1 }, b: { x: 2 } }, { x: 1 }) + * // => [{ x: 1 }] + */ +declare function filter(collection: T | null | undefined, predicate?: ObjectIterateeCustom): Array; +//#endregion +export { filter }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/filter.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/filter.js new file mode 100644 index 0000000000000000000000000000000000000000..dee427b1480d797ed7297289b49430f7b00d3ccb --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/filter.js @@ -0,0 +1,50 @@ +const require_identity = require("../../function/identity.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +const require_iteratee = require("../util/iteratee.js"); +//#region src/compat/array/filter.ts +/** +* Iterates over the collection and filters elements based on the given predicate. +* If a function is provided, it is invoked for each element in the collection. +* +* @template T +* @param {ArrayLike | Record | null | undefined} source - The array or object to iterate over. +* @param {((item: T, index: number, arr: any) => unknown) | Partial | [keyof T, unknown] | PropertyKey} [predicate=identity] - The function invoked per iteration. +* @returns {T[]} - Returns a new array of filtered elements that satisfy the predicate. +* +* @example +* filter([{ a: 1 }, { a: 2 }, { b: 1 }], 'a'); +* // => [{ a: 1 }, { a: 2 }] +* +* filter([{ a: 1 }, { a: 2 }, { b: 1 }], { b: 1 }); +* // => [{ b: 1 }] +* +* filter({ item1: { a: 0, b: true }, item2: { a: 1, b: true }, item3: { a: 2, b: false }}, { b: false }) +* // => [{ a: 2, b: false }] +* +* filter([{ a: 1 }, { a: 2 }, { a: 3 }], ['a', 2]); +* // => [{ a: 2 }] +*/ +function filter(source, predicate = require_identity.identity) { + if (!source) return []; + predicate = require_iteratee.iteratee(predicate); + if (!Array.isArray(source)) { + const result = []; + const keys = Object.keys(source); + const length = require_isArrayLike.isArrayLike(source) ? source.length : keys.length; + for (let i = 0; i < length; i++) { + const key = keys[i]; + const value = source[key]; + if (predicate(value, key, source)) result.push(value); + } + return result; + } + const result = []; + const length = source.length; + for (let i = 0; i < length; i++) { + const value = source[i]; + if (predicate(value, i, source)) result.push(value); + } + return result; +} +//#endregion +exports.filter = filter; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/filter.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/filter.mjs new file mode 100644 index 0000000000000000000000000000000000000000..c43c3dc9938b97e300df27a85739683241e25140 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/filter.mjs @@ -0,0 +1,50 @@ +import { identity } from "../../function/identity.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +import { iteratee } from "../util/iteratee.mjs"; +//#region src/compat/array/filter.ts +/** +* Iterates over the collection and filters elements based on the given predicate. +* If a function is provided, it is invoked for each element in the collection. +* +* @template T +* @param {ArrayLike | Record | null | undefined} source - The array or object to iterate over. +* @param {((item: T, index: number, arr: any) => unknown) | Partial | [keyof T, unknown] | PropertyKey} [predicate=identity] - The function invoked per iteration. +* @returns {T[]} - Returns a new array of filtered elements that satisfy the predicate. +* +* @example +* filter([{ a: 1 }, { a: 2 }, { b: 1 }], 'a'); +* // => [{ a: 1 }, { a: 2 }] +* +* filter([{ a: 1 }, { a: 2 }, { b: 1 }], { b: 1 }); +* // => [{ b: 1 }] +* +* filter({ item1: { a: 0, b: true }, item2: { a: 1, b: true }, item3: { a: 2, b: false }}, { b: false }) +* // => [{ a: 2, b: false }] +* +* filter([{ a: 1 }, { a: 2 }, { a: 3 }], ['a', 2]); +* // => [{ a: 2 }] +*/ +function filter(source, predicate = identity) { + if (!source) return []; + predicate = iteratee(predicate); + if (!Array.isArray(source)) { + const result = []; + const keys = Object.keys(source); + const length = isArrayLike(source) ? source.length : keys.length; + for (let i = 0; i < length; i++) { + const key = keys[i]; + const value = source[key]; + if (predicate(value, key, source)) result.push(value); + } + return result; + } + const result = []; + const length = source.length; + for (let i = 0; i < length; i++) { + const value = source[i]; + if (predicate(value, i, source)) result.push(value); + } + return result; +} +//#endregion +export { filter }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/find.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/find.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..13a510a63839625d7dd18728efa845d6c7577fc6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/find.d.mts @@ -0,0 +1,66 @@ +import { ObjectIteratorTypeGuard } from "../_internal/ObjectIterator.mjs"; +import { ListIterateeCustom } from "../_internal/ListIterateeCustom.mjs"; +import { ObjectIterateeCustom } from "../_internal/ObjectIteratee.mjs"; +import { ListIteratorTypeGuard } from "../_internal/ListIteratorTypeGuard.mjs"; + +//#region src/compat/array/find.d.ts +/** + * Finds the first element in an array-like object that matches a type guard predicate. + * + * @param collection - The array-like object to search + * @param predicate - The type guard function to test each element + * @param fromIndex - The index to start searching from + * @returns The first element that matches the type guard, or undefined if none found + * + * @example + * find([1, '2', 3], (x): x is number => typeof x === 'number') + * // => 1 + */ +declare function find(collection: ArrayLike | null | undefined, predicate: ListIteratorTypeGuard, fromIndex?: number): U | undefined; +/** + * Finds the first element in an array-like object that matches a predicate. + * + * @param collection - The array-like object to search + * @param predicate - The function or shorthand to test each element + * @param fromIndex - The index to start searching from + * @returns The first matching element, or undefined if none found + * + * @example + * find([1, 2, 3], x => x > 2) + * // => 3 + * + * find([{ a: 1 }, { a: 2 }], { a: 2 }) + * // => { a: 2 } + */ +declare function find(collection: ArrayLike | null | undefined, predicate?: ListIterateeCustom, fromIndex?: number): T | undefined; +/** + * Finds the first value in an object that matches a type guard predicate. + * + * @param collection - The object to search + * @param predicate - The type guard function to test each value + * @param fromIndex - The index to start searching from + * @returns The first value that matches the type guard, or undefined if none found + * + * @example + * find({ a: 1, b: '2', c: 3 }, (x): x is number => typeof x === 'number') + * // => 1 + */ +declare function find(collection: T | null | undefined, predicate: ObjectIteratorTypeGuard, fromIndex?: number): U | undefined; +/** + * Finds the first value in an object that matches a predicate. + * + * @param collection - The object to search + * @param predicate - The function or shorthand to test each value + * @param fromIndex - The index to start searching from + * @returns The first matching value, or undefined if none found + * + * @example + * find({ a: 1, b: 2 }, x => x > 1) + * // => 2 + * + * find({ a: { x: 1 }, b: { x: 2 } }, { x: 2 }) + * // => { x: 2 } + */ +declare function find(collection: T | null | undefined, predicate?: ObjectIterateeCustom, fromIndex?: number): T[keyof T] | undefined; +//#endregion +export { find }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/find.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/find.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4968d7baad8cefe4eff8eb006f5fcfc8ae7eb62a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/find.d.ts @@ -0,0 +1,66 @@ +import { ObjectIteratorTypeGuard } from "../_internal/ObjectIterator.js"; +import { ListIterateeCustom } from "../_internal/ListIterateeCustom.js"; +import { ObjectIterateeCustom } from "../_internal/ObjectIteratee.js"; +import { ListIteratorTypeGuard } from "../_internal/ListIteratorTypeGuard.js"; + +//#region src/compat/array/find.d.ts +/** + * Finds the first element in an array-like object that matches a type guard predicate. + * + * @param collection - The array-like object to search + * @param predicate - The type guard function to test each element + * @param fromIndex - The index to start searching from + * @returns The first element that matches the type guard, or undefined if none found + * + * @example + * find([1, '2', 3], (x): x is number => typeof x === 'number') + * // => 1 + */ +declare function find(collection: ArrayLike | null | undefined, predicate: ListIteratorTypeGuard, fromIndex?: number): U | undefined; +/** + * Finds the first element in an array-like object that matches a predicate. + * + * @param collection - The array-like object to search + * @param predicate - The function or shorthand to test each element + * @param fromIndex - The index to start searching from + * @returns The first matching element, or undefined if none found + * + * @example + * find([1, 2, 3], x => x > 2) + * // => 3 + * + * find([{ a: 1 }, { a: 2 }], { a: 2 }) + * // => { a: 2 } + */ +declare function find(collection: ArrayLike | null | undefined, predicate?: ListIterateeCustom, fromIndex?: number): T | undefined; +/** + * Finds the first value in an object that matches a type guard predicate. + * + * @param collection - The object to search + * @param predicate - The type guard function to test each value + * @param fromIndex - The index to start searching from + * @returns The first value that matches the type guard, or undefined if none found + * + * @example + * find({ a: 1, b: '2', c: 3 }, (x): x is number => typeof x === 'number') + * // => 1 + */ +declare function find(collection: T | null | undefined, predicate: ObjectIteratorTypeGuard, fromIndex?: number): U | undefined; +/** + * Finds the first value in an object that matches a predicate. + * + * @param collection - The object to search + * @param predicate - The function or shorthand to test each value + * @param fromIndex - The index to start searching from + * @returns The first matching value, or undefined if none found + * + * @example + * find({ a: 1, b: 2 }, x => x > 1) + * // => 2 + * + * find({ a: { x: 1 }, b: { x: 2 } }, { x: 2 }) + * // => { x: 2 } + */ +declare function find(collection: T | null | undefined, predicate?: ObjectIterateeCustom, fromIndex?: number): T[keyof T] | undefined; +//#endregion +export { find }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/find.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/find.js new file mode 100644 index 0000000000000000000000000000000000000000..98035c280226e2cd4ba09261d988d8c1403737df --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/find.js @@ -0,0 +1,35 @@ +const require_identity = require("../../function/identity.js"); +const require_iteratee = require("../util/iteratee.js"); +//#region src/compat/array/find.ts +/** +* Finds the first item in an object that has a specific property, where the property name is provided as a PropertyKey. +* +* @template T +* @param {ArrayLike | Record | null | undefined} source - The source array or object to search through. +* @param {((item: T, index: number, arr: any) => unknown) | Partial | [keyof T, unknown] | PropertyKey} doesMatch - The criteria to match. It can be a function, a partial object, a key-value pair, or a property name. +* @param {number} [fromIndex=0] - The index to start the search from, defaults to 0. +* @returns {T | undefined} - The first property value that has the specified property, or `undefined` if no match is found. +* +* @example +* // Using a property name +* const obj = { a: { id: 1, name: 'Alice' }, b: { id: 2, name: 'Bob' } }; +* const result = find(obj, 'name'); +* console.log(result); // { id: 1, name: 'Alice' } +*/ +function find(source, _doesMatch = require_identity.identity, fromIndex = 0) { + if (!source) return; + if (fromIndex < 0) fromIndex = Math.max(source.length + fromIndex, 0); + const doesMatch = require_iteratee.iteratee(_doesMatch); + if (!Array.isArray(source)) { + const keys = Object.keys(source); + for (let i = fromIndex; i < keys.length; i++) { + const key = keys[i]; + const value = source[key]; + if (doesMatch(value, key, source)) return value; + } + return; + } + return source.slice(fromIndex).find(doesMatch); +} +//#endregion +exports.find = find; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/find.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/find.mjs new file mode 100644 index 0000000000000000000000000000000000000000..03ef7b97259cc2e2de20b063d91516740a24880a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/find.mjs @@ -0,0 +1,35 @@ +import { identity } from "../../function/identity.mjs"; +import { iteratee } from "../util/iteratee.mjs"; +//#region src/compat/array/find.ts +/** +* Finds the first item in an object that has a specific property, where the property name is provided as a PropertyKey. +* +* @template T +* @param {ArrayLike | Record | null | undefined} source - The source array or object to search through. +* @param {((item: T, index: number, arr: any) => unknown) | Partial | [keyof T, unknown] | PropertyKey} doesMatch - The criteria to match. It can be a function, a partial object, a key-value pair, or a property name. +* @param {number} [fromIndex=0] - The index to start the search from, defaults to 0. +* @returns {T | undefined} - The first property value that has the specified property, or `undefined` if no match is found. +* +* @example +* // Using a property name +* const obj = { a: { id: 1, name: 'Alice' }, b: { id: 2, name: 'Bob' } }; +* const result = find(obj, 'name'); +* console.log(result); // { id: 1, name: 'Alice' } +*/ +function find(source, _doesMatch = identity, fromIndex = 0) { + if (!source) return; + if (fromIndex < 0) fromIndex = Math.max(source.length + fromIndex, 0); + const doesMatch = iteratee(_doesMatch); + if (!Array.isArray(source)) { + const keys = Object.keys(source); + for (let i = fromIndex; i < keys.length; i++) { + const key = keys[i]; + const value = source[key]; + if (doesMatch(value, key, source)) return value; + } + return; + } + return source.slice(fromIndex).find(doesMatch); +} +//#endregion +export { find }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/findIndex.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/findIndex.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..45257b18e5208af2e3404fe2fb8b371677d3800e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/findIndex.d.mts @@ -0,0 +1,22 @@ +import { ListIterateeCustom } from "../_internal/ListIterateeCustom.mjs"; + +//#region src/compat/array/findIndex.d.ts +/** + * Finds the index of the first item in an array that has a specific property, where the property name is provided as a PropertyKey. + * + * @template T + * @param {ArrayLike | null | undefined} arr - The array to search through. + * @param {((item: T, index: number, arr: any) => unknown) | Partial | [keyof T, unknown] | PropertyKey} doesMatch - The criteria to match against the items in the array. This can be a function, a partial object, a key-value pair, or a property name. + * @param {PropertyKey} propertyToCheck - The property name to check for in the items of the array. + * @param {number} [fromIndex=0] - The index to start the search from, defaults to 0. + * @returns {number} - The index of the first item that has the specified property, or `-1` if no match is found. + * + * @example + * // Using a property name + * const items = [{ id: 1, name: 'Alice' }, { id: 2, name: 'Bob' }]; + * const result = findIndex(items, 'name'); + * console.log(result); // 0 + */ +declare function findIndex(arr: ArrayLike | null | undefined, doesMatch?: ListIterateeCustom, fromIndex?: number): number; +//#endregion +export { findIndex }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/findIndex.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/findIndex.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a9f3e4e94183b2f85cc33fbe2ecde2ec52b56de8 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/findIndex.d.ts @@ -0,0 +1,22 @@ +import { ListIterateeCustom } from "../_internal/ListIterateeCustom.js"; + +//#region src/compat/array/findIndex.d.ts +/** + * Finds the index of the first item in an array that has a specific property, where the property name is provided as a PropertyKey. + * + * @template T + * @param {ArrayLike | null | undefined} arr - The array to search through. + * @param {((item: T, index: number, arr: any) => unknown) | Partial | [keyof T, unknown] | PropertyKey} doesMatch - The criteria to match against the items in the array. This can be a function, a partial object, a key-value pair, or a property name. + * @param {PropertyKey} propertyToCheck - The property name to check for in the items of the array. + * @param {number} [fromIndex=0] - The index to start the search from, defaults to 0. + * @returns {number} - The index of the first item that has the specified property, or `-1` if no match is found. + * + * @example + * // Using a property name + * const items = [{ id: 1, name: 'Alice' }, { id: 2, name: 'Bob' }]; + * const result = findIndex(items, 'name'); + * console.log(result); // 0 + */ +declare function findIndex(arr: ArrayLike | null | undefined, doesMatch?: ListIterateeCustom, fromIndex?: number): number; +//#endregion +export { findIndex }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/findIndex.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/findIndex.js new file mode 100644 index 0000000000000000000000000000000000000000..8c0f1bc7430481d379f6eb32afad85968f8c7a96 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/findIndex.js @@ -0,0 +1,45 @@ +const require_property = require("../object/property.js"); +const require_matches = require("../predicate/matches.js"); +const require_matchesProperty = require("../predicate/matchesProperty.js"); +const require_identity = require("../function/identity.js"); +//#region src/compat/array/findIndex.ts +/** +* Finds the index of the first item in an array that has a specific property, where the property name is provided as a PropertyKey. +* +* @template T +* @param {ArrayLike | null | undefined} arr - The array to search through. +* @param {((item: T, index: number, arr: any) => unknown) | Partial | [keyof T, unknown] | PropertyKey} doesMatch - The criteria to match against the items in the array. This can be a function, a partial object, a key-value pair, or a property name. +* @param {PropertyKey} propertyToCheck - The property name to check for in the items of the array. +* @param {number} [fromIndex=0] - The index to start the search from, defaults to 0. +* @returns {number} - The index of the first item that has the specified property, or `-1` if no match is found. +* +* @example +* // Using a property name +* const items = [{ id: 1, name: 'Alice' }, { id: 2, name: 'Bob' }]; +* const result = findIndex(items, 'name'); +* console.log(result); // 0 +*/ +function findIndex(arr, doesMatch = require_identity.identity, fromIndex = 0) { + if (!arr) return -1; + if (fromIndex < 0) fromIndex = Math.max(arr.length + fromIndex, 0); + const subArray = Array.from(arr).slice(fromIndex); + let index = -1; + switch (typeof doesMatch) { + case "function": + index = subArray.findIndex(doesMatch); + break; + case "object": + if (Array.isArray(doesMatch) && doesMatch.length === 2) { + const key = doesMatch[0]; + const value = doesMatch[1]; + index = subArray.findIndex(require_matchesProperty.matchesProperty(key, value)); + } else index = subArray.findIndex(require_matches.matches(doesMatch)); + break; + case "number": + case "symbol": + case "string": index = subArray.findIndex(require_property.property(doesMatch)); + } + return index === -1 ? -1 : index + fromIndex; +} +//#endregion +exports.findIndex = findIndex; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/findIndex.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/findIndex.mjs new file mode 100644 index 0000000000000000000000000000000000000000..1433a095e66e03cc8cad93d988e13c6b1c94257e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/findIndex.mjs @@ -0,0 +1,45 @@ +import { property } from "../object/property.mjs"; +import { matches } from "../predicate/matches.mjs"; +import { matchesProperty } from "../predicate/matchesProperty.mjs"; +import { identity } from "../function/identity.mjs"; +//#region src/compat/array/findIndex.ts +/** +* Finds the index of the first item in an array that has a specific property, where the property name is provided as a PropertyKey. +* +* @template T +* @param {ArrayLike | null | undefined} arr - The array to search through. +* @param {((item: T, index: number, arr: any) => unknown) | Partial | [keyof T, unknown] | PropertyKey} doesMatch - The criteria to match against the items in the array. This can be a function, a partial object, a key-value pair, or a property name. +* @param {PropertyKey} propertyToCheck - The property name to check for in the items of the array. +* @param {number} [fromIndex=0] - The index to start the search from, defaults to 0. +* @returns {number} - The index of the first item that has the specified property, or `-1` if no match is found. +* +* @example +* // Using a property name +* const items = [{ id: 1, name: 'Alice' }, { id: 2, name: 'Bob' }]; +* const result = findIndex(items, 'name'); +* console.log(result); // 0 +*/ +function findIndex(arr, doesMatch = identity, fromIndex = 0) { + if (!arr) return -1; + if (fromIndex < 0) fromIndex = Math.max(arr.length + fromIndex, 0); + const subArray = Array.from(arr).slice(fromIndex); + let index = -1; + switch (typeof doesMatch) { + case "function": + index = subArray.findIndex(doesMatch); + break; + case "object": + if (Array.isArray(doesMatch) && doesMatch.length === 2) { + const key = doesMatch[0]; + const value = doesMatch[1]; + index = subArray.findIndex(matchesProperty(key, value)); + } else index = subArray.findIndex(matches(doesMatch)); + break; + case "number": + case "symbol": + case "string": index = subArray.findIndex(property(doesMatch)); + } + return index === -1 ? -1 : index + fromIndex; +} +//#endregion +export { findIndex }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/findLast.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/findLast.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..54a81cd5a82e9af2dd9ae12e42b0e5f45c99e673 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/findLast.d.mts @@ -0,0 +1,83 @@ +import { ObjectIteratorTypeGuard } from "../_internal/ObjectIterator.mjs"; +import { ListIterateeCustom } from "../_internal/ListIterateeCustom.mjs"; +import { ObjectIterateeCustom } from "../_internal/ObjectIteratee.mjs"; +import { ListIteratorTypeGuard } from "../_internal/ListIteratorTypeGuard.mjs"; + +//#region src/compat/array/findLast.d.ts +/** + * Finds the last element in a collection that satisfies the predicate. + * + * @template T, S + * @param {ArrayLike | null | undefined} collection - The collection to search. + * @param {ListIteratorTypeGuard} predicate - The predicate function with type guard. + * @param {number} [fromIndex] - The index to start searching from. + * @returns {S | undefined} The last element that satisfies the predicate. + * + * @example + * const users = [{ user: 'barney', age: 36 }, { user: 'fred', age: 40 }, { user: 'pebbles', age: 18 }]; + * findLast(users, (o): o is { user: string; age: number } => o.age < 40); + * // => { user: 'pebbles', age: 18 } + */ +declare function findLast(collection: ArrayLike | null | undefined, predicate: ListIteratorTypeGuard, fromIndex?: number): S | undefined; +/** + * Finds the last element in a collection that satisfies the predicate. + * + * @template T + * @param {ArrayLike | null | undefined} collection - The collection to search. + * @param {ListIterateeCustom} [predicate] - The predicate function, partial object, property-value pair, or property name. + * @param {number} [fromIndex] - The index to start searching from. + * @returns {T | undefined} The last element that satisfies the predicate. + * + * @example + * const users = [{ user: 'barney', age: 36 }, { user: 'fred', age: 40 }, { user: 'pebbles', age: 18 }]; + * findLast(users, o => o.age < 40); + * // => { user: 'pebbles', age: 18 } + * + * findLast(users, { age: 36 }); + * // => { user: 'barney', age: 36 } + * + * findLast(users, ['age', 18]); + * // => { user: 'pebbles', age: 18 } + * + * findLast(users, 'age'); + * // => { user: 'fred', age: 40 } + */ +declare function findLast(collection: ArrayLike | null | undefined, predicate?: ListIterateeCustom, fromIndex?: number): T | undefined; +/** + * Finds the last element in an object that satisfies the predicate with type guard. + * + * @template T, S + * @param {T | null | undefined} collection - The object to search. + * @param {ObjectIteratorTypeGuard} predicate - The predicate function with type guard. + * @param {number} [fromIndex] - The index to start searching from. + * @returns {S | undefined} The last element that satisfies the predicate. + * + * @example + * const obj = { a: 1, b: 'hello', c: 3 }; + * findLast(obj, (value): value is string => typeof value === 'string'); + * // => 'hello' + */ +declare function findLast(collection: T | null | undefined, predicate: ObjectIteratorTypeGuard, fromIndex?: number): S | undefined; +/** + * Finds the last element in an object that satisfies the predicate. + * + * @template T + * @param {T | null | undefined} collection - The object to search. + * @param {ObjectIterateeCustom} [predicate] - The predicate function, partial object, property-value pair, or property name. + * @param {number} [fromIndex] - The index to start searching from. + * @returns {T[keyof T] | undefined} The last element that satisfies the predicate. + * + * @example + * const obj = { a: { id: 1, name: 'Alice' }, b: { id: 2 }, c: { id: 3, name: 'Bob' } }; + * findLast(obj, o => o.id > 1); + * // => { id: 3, name: 'Bob' } + * + * findLast(obj, { name: 'Bob' }); + * // => { id: 3, name: 'Bob' } + * + * findLast(obj, 'name'); + * // => { id: 3, name: 'Bob' } + */ +declare function findLast(collection: T | null | undefined, predicate?: ObjectIterateeCustom, fromIndex?: number): T[keyof T] | undefined; +//#endregion +export { findLast }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/findLast.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/findLast.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b608a6c8abeed198ce3d53170e1505cae2492d7b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/findLast.d.ts @@ -0,0 +1,83 @@ +import { ObjectIteratorTypeGuard } from "../_internal/ObjectIterator.js"; +import { ListIterateeCustom } from "../_internal/ListIterateeCustom.js"; +import { ObjectIterateeCustom } from "../_internal/ObjectIteratee.js"; +import { ListIteratorTypeGuard } from "../_internal/ListIteratorTypeGuard.js"; + +//#region src/compat/array/findLast.d.ts +/** + * Finds the last element in a collection that satisfies the predicate. + * + * @template T, S + * @param {ArrayLike | null | undefined} collection - The collection to search. + * @param {ListIteratorTypeGuard} predicate - The predicate function with type guard. + * @param {number} [fromIndex] - The index to start searching from. + * @returns {S | undefined} The last element that satisfies the predicate. + * + * @example + * const users = [{ user: 'barney', age: 36 }, { user: 'fred', age: 40 }, { user: 'pebbles', age: 18 }]; + * findLast(users, (o): o is { user: string; age: number } => o.age < 40); + * // => { user: 'pebbles', age: 18 } + */ +declare function findLast(collection: ArrayLike | null | undefined, predicate: ListIteratorTypeGuard, fromIndex?: number): S | undefined; +/** + * Finds the last element in a collection that satisfies the predicate. + * + * @template T + * @param {ArrayLike | null | undefined} collection - The collection to search. + * @param {ListIterateeCustom} [predicate] - The predicate function, partial object, property-value pair, or property name. + * @param {number} [fromIndex] - The index to start searching from. + * @returns {T | undefined} The last element that satisfies the predicate. + * + * @example + * const users = [{ user: 'barney', age: 36 }, { user: 'fred', age: 40 }, { user: 'pebbles', age: 18 }]; + * findLast(users, o => o.age < 40); + * // => { user: 'pebbles', age: 18 } + * + * findLast(users, { age: 36 }); + * // => { user: 'barney', age: 36 } + * + * findLast(users, ['age', 18]); + * // => { user: 'pebbles', age: 18 } + * + * findLast(users, 'age'); + * // => { user: 'fred', age: 40 } + */ +declare function findLast(collection: ArrayLike | null | undefined, predicate?: ListIterateeCustom, fromIndex?: number): T | undefined; +/** + * Finds the last element in an object that satisfies the predicate with type guard. + * + * @template T, S + * @param {T | null | undefined} collection - The object to search. + * @param {ObjectIteratorTypeGuard} predicate - The predicate function with type guard. + * @param {number} [fromIndex] - The index to start searching from. + * @returns {S | undefined} The last element that satisfies the predicate. + * + * @example + * const obj = { a: 1, b: 'hello', c: 3 }; + * findLast(obj, (value): value is string => typeof value === 'string'); + * // => 'hello' + */ +declare function findLast(collection: T | null | undefined, predicate: ObjectIteratorTypeGuard, fromIndex?: number): S | undefined; +/** + * Finds the last element in an object that satisfies the predicate. + * + * @template T + * @param {T | null | undefined} collection - The object to search. + * @param {ObjectIterateeCustom} [predicate] - The predicate function, partial object, property-value pair, or property name. + * @param {number} [fromIndex] - The index to start searching from. + * @returns {T[keyof T] | undefined} The last element that satisfies the predicate. + * + * @example + * const obj = { a: { id: 1, name: 'Alice' }, b: { id: 2 }, c: { id: 3, name: 'Bob' } }; + * findLast(obj, o => o.id > 1); + * // => { id: 3, name: 'Bob' } + * + * findLast(obj, { name: 'Bob' }); + * // => { id: 3, name: 'Bob' } + * + * findLast(obj, 'name'); + * // => { id: 3, name: 'Bob' } + */ +declare function findLast(collection: T | null | undefined, predicate?: ObjectIterateeCustom, fromIndex?: number): T[keyof T] | undefined; +//#endregion +export { findLast }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/findLast.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/findLast.js new file mode 100644 index 0000000000000000000000000000000000000000..5cf1e7a941e65508cf14517f028e5211f36c2438 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/findLast.js @@ -0,0 +1,39 @@ +const require_toInteger = require("../util/toInteger.js"); +const require_identity = require("../../function/identity.js"); +const require_iteratee = require("../util/iteratee.js"); +//#region src/compat/array/findLast.ts +/** +* Finds the last item in an object that has a specific property, where the property name is provided as a PropertyKey. +* +* @template T +* @param {ArrayLike | Record | null | undefined} source - The source array or object to search through. +* @param {((item: T, index: number, arr: any) => unknown) | Partial | [keyof T, unknown] | PropertyKey} doesMatch - The criteria to match. It can be a function, a partial object, a key-value pair, or a property name. +* @param {number} [fromIndex] - The index to start the search from, defaults to source.length-1 for arrays or Object.keys(source).length-1 for objects. +* @returns {T | undefined} - The last property value that has the specified property, or `undefined` if no match is found. +* +* @example +* // Using a property name +* const obj = { a: { id: 1, name: 'Alice' }, b: { id: 2 }, c: { id: 3, name: 'Bob' } }; +* const result = findLast(obj, 'name'); +* console.log(result); // { id: 3, name: 'Bob' } +*/ +function findLast(source, _doesMatch = require_identity.identity, fromIndex) { + if (!source) return; + const length = Array.isArray(source) ? source.length : Object.keys(source).length; + fromIndex = require_toInteger.toInteger(fromIndex ?? length - 1); + if (fromIndex < 0) fromIndex = Math.max(length + fromIndex, 0); + else fromIndex = Math.min(fromIndex, length - 1); + const doesMatch = require_iteratee.iteratee(_doesMatch); + if (!Array.isArray(source)) { + const keys = Object.keys(source); + for (let i = fromIndex; i >= 0; i--) { + const key = keys[i]; + const value = source[key]; + if (doesMatch(value, key, source)) return value; + } + return; + } + return source.slice(0, fromIndex + 1).findLast(doesMatch); +} +//#endregion +exports.findLast = findLast; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/findLast.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/findLast.mjs new file mode 100644 index 0000000000000000000000000000000000000000..536ed12d80600c91d7202721cf78be7ea83b91c4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/findLast.mjs @@ -0,0 +1,39 @@ +import { toInteger } from "../util/toInteger.mjs"; +import { identity } from "../../function/identity.mjs"; +import { iteratee } from "../util/iteratee.mjs"; +//#region src/compat/array/findLast.ts +/** +* Finds the last item in an object that has a specific property, where the property name is provided as a PropertyKey. +* +* @template T +* @param {ArrayLike | Record | null | undefined} source - The source array or object to search through. +* @param {((item: T, index: number, arr: any) => unknown) | Partial | [keyof T, unknown] | PropertyKey} doesMatch - The criteria to match. It can be a function, a partial object, a key-value pair, or a property name. +* @param {number} [fromIndex] - The index to start the search from, defaults to source.length-1 for arrays or Object.keys(source).length-1 for objects. +* @returns {T | undefined} - The last property value that has the specified property, or `undefined` if no match is found. +* +* @example +* // Using a property name +* const obj = { a: { id: 1, name: 'Alice' }, b: { id: 2 }, c: { id: 3, name: 'Bob' } }; +* const result = findLast(obj, 'name'); +* console.log(result); // { id: 3, name: 'Bob' } +*/ +function findLast(source, _doesMatch = identity, fromIndex) { + if (!source) return; + const length = Array.isArray(source) ? source.length : Object.keys(source).length; + fromIndex = toInteger(fromIndex ?? length - 1); + if (fromIndex < 0) fromIndex = Math.max(length + fromIndex, 0); + else fromIndex = Math.min(fromIndex, length - 1); + const doesMatch = iteratee(_doesMatch); + if (!Array.isArray(source)) { + const keys = Object.keys(source); + for (let i = fromIndex; i >= 0; i--) { + const key = keys[i]; + const value = source[key]; + if (doesMatch(value, key, source)) return value; + } + return; + } + return source.slice(0, fromIndex + 1).findLast(doesMatch); +} +//#endregion +export { findLast }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/findLastIndex.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/findLastIndex.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..4701674759a1712cf00cb0182230fb2503bc7545 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/findLastIndex.d.mts @@ -0,0 +1,34 @@ +import { ListIterateeCustom } from "../_internal/ListIterateeCustom.mjs"; + +//#region src/compat/array/findLastIndex.d.ts +/** + * Finds the index of the last element in the array that satisfies the predicate. + * + * @template T + * @param {ArrayLike | null | undefined} array - The array to search through. + * @param {ListIterateeCustom} [predicate] - The predicate function, partial object, property-value pair, or property name. + * @param {number} [fromIndex] - The index to start searching from. + * @returns {number} The index of the last matching element, or -1 if not found. + * + * @example + * const users = [ + * { user: 'barney', active: true }, + * { user: 'fred', active: false }, + * { user: 'pebbles', active: false } + * ]; + * + * findLastIndex(users, o => o.user === 'pebbles'); + * // => 2 + * + * findLastIndex(users, { user: 'barney', active: true }); + * // => 0 + * + * findLastIndex(users, ['active', false]); + * // => 2 + * + * findLastIndex(users, 'active'); + * // => 0 + */ +declare function findLastIndex(array: ArrayLike | null | undefined, predicate?: ListIterateeCustom, fromIndex?: number): number; +//#endregion +export { findLastIndex }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/findLastIndex.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/findLastIndex.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bcc9a8f3c43b2a555518f28b2cf3894b643adc20 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/findLastIndex.d.ts @@ -0,0 +1,34 @@ +import { ListIterateeCustom } from "../_internal/ListIterateeCustom.js"; + +//#region src/compat/array/findLastIndex.d.ts +/** + * Finds the index of the last element in the array that satisfies the predicate. + * + * @template T + * @param {ArrayLike | null | undefined} array - The array to search through. + * @param {ListIterateeCustom} [predicate] - The predicate function, partial object, property-value pair, or property name. + * @param {number} [fromIndex] - The index to start searching from. + * @returns {number} The index of the last matching element, or -1 if not found. + * + * @example + * const users = [ + * { user: 'barney', active: true }, + * { user: 'fred', active: false }, + * { user: 'pebbles', active: false } + * ]; + * + * findLastIndex(users, o => o.user === 'pebbles'); + * // => 2 + * + * findLastIndex(users, { user: 'barney', active: true }); + * // => 0 + * + * findLastIndex(users, ['active', false]); + * // => 2 + * + * findLastIndex(users, 'active'); + * // => 0 + */ +declare function findLastIndex(array: ArrayLike | null | undefined, predicate?: ListIterateeCustom, fromIndex?: number): number; +//#endregion +export { findLastIndex }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/findLastIndex.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/findLastIndex.js new file mode 100644 index 0000000000000000000000000000000000000000..0e500aad3b0fbf6b738f7f76e9bab6211eac5c4f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/findLastIndex.js @@ -0,0 +1,39 @@ +const require_identity = require("../../function/identity.js"); +const require_toArray = require("../_internal/toArray.js"); +const require_property = require("../object/property.js"); +const require_matches = require("../predicate/matches.js"); +const require_matchesProperty = require("../predicate/matchesProperty.js"); +//#region src/compat/array/findLastIndex.ts +/** +* Finds the index of the last element in the array that satisfies the predicate. +* +* @template T +* @param {ArrayLike | null | undefined} arr - The array to search through. +* @param {((item: T, index: number, arr: any) => unknown) | Partial | [keyof T, unknown] | PropertyKey} doesMatch - The predicate function, partial object, property-value pair, or property name. +* @param {number} [fromIndex=arr.length - 1] - The index to start the search from, defaults to the last index of the array. +* @returns {number} The index of the last matching element, or -1 if not found. +* +* @example +* const items = [{ id: 1, name: 'Alice' }, { id: 2, name: 'Bob' }]; +* findLastIndex(items, 'name'); +* // => 1 +*/ +function findLastIndex(arr, doesMatch = require_identity.identity, fromIndex = arr ? arr.length - 1 : 0) { + if (!arr) return -1; + if (fromIndex < 0) fromIndex = Math.max(arr.length + fromIndex, 0); + else fromIndex = Math.min(fromIndex, arr.length - 1); + const subArray = require_toArray.toArray(arr).slice(0, fromIndex + 1); + switch (typeof doesMatch) { + case "function": return subArray.findLastIndex(doesMatch); + case "object": if (Array.isArray(doesMatch) && doesMatch.length === 2) { + const key = doesMatch[0]; + const value = doesMatch[1]; + return subArray.findLastIndex(require_matchesProperty.matchesProperty(key, value)); + } else return subArray.findLastIndex(require_matches.matches(doesMatch)); + case "number": + case "symbol": + case "string": return subArray.findLastIndex(require_property.property(doesMatch)); + } +} +//#endregion +exports.findLastIndex = findLastIndex; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/findLastIndex.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/findLastIndex.mjs new file mode 100644 index 0000000000000000000000000000000000000000..aecc3283544ecbaacedd44e7308e657624367572 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/findLastIndex.mjs @@ -0,0 +1,39 @@ +import { identity } from "../../function/identity.mjs"; +import { toArray } from "../_internal/toArray.mjs"; +import { property } from "../object/property.mjs"; +import { matches } from "../predicate/matches.mjs"; +import { matchesProperty } from "../predicate/matchesProperty.mjs"; +//#region src/compat/array/findLastIndex.ts +/** +* Finds the index of the last element in the array that satisfies the predicate. +* +* @template T +* @param {ArrayLike | null | undefined} arr - The array to search through. +* @param {((item: T, index: number, arr: any) => unknown) | Partial | [keyof T, unknown] | PropertyKey} doesMatch - The predicate function, partial object, property-value pair, or property name. +* @param {number} [fromIndex=arr.length - 1] - The index to start the search from, defaults to the last index of the array. +* @returns {number} The index of the last matching element, or -1 if not found. +* +* @example +* const items = [{ id: 1, name: 'Alice' }, { id: 2, name: 'Bob' }]; +* findLastIndex(items, 'name'); +* // => 1 +*/ +function findLastIndex(arr, doesMatch = identity, fromIndex = arr ? arr.length - 1 : 0) { + if (!arr) return -1; + if (fromIndex < 0) fromIndex = Math.max(arr.length + fromIndex, 0); + else fromIndex = Math.min(fromIndex, arr.length - 1); + const subArray = toArray(arr).slice(0, fromIndex + 1); + switch (typeof doesMatch) { + case "function": return subArray.findLastIndex(doesMatch); + case "object": if (Array.isArray(doesMatch) && doesMatch.length === 2) { + const key = doesMatch[0]; + const value = doesMatch[1]; + return subArray.findLastIndex(matchesProperty(key, value)); + } else return subArray.findLastIndex(matches(doesMatch)); + case "number": + case "symbol": + case "string": return subArray.findLastIndex(property(doesMatch)); + } +} +//#endregion +export { findLastIndex }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/first.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/first.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..296a68fe229488bb52cd6cf3681ceac84d66fbfb --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/first.d.mts @@ -0,0 +1 @@ +import { head } from "./head.mjs"; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/first.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/first.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d00dedd2263318bb311327fd48f43d129458d860 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/first.d.ts @@ -0,0 +1 @@ +import { head } from "./head.js"; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/first.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/first.js new file mode 100644 index 0000000000000000000000000000000000000000..1d480d84873840936af9b2c9d1c58c2f187153d2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/first.js @@ -0,0 +1 @@ +require("./head.js"); diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/first.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/first.mjs new file mode 100644 index 0000000000000000000000000000000000000000..1d5c01873db1ed8005d38ac50b97c0d8cb5b70c9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/first.mjs @@ -0,0 +1 @@ +import "./head.mjs"; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMap.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMap.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..3339cc2a812314dc56cf50a3f4a42763846f58ee --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMap.d.mts @@ -0,0 +1,94 @@ +import { ListIterator } from "../_internal/ListIterator.mjs"; +import { ObjectIterator } from "../_internal/ObjectIterator.mjs"; +import { Many } from "../_internal/Many.mjs"; + +//#region src/compat/array/flatMap.d.ts +/** + * Creates a flattened array of values by running each element in collection through iteratee and flattening the mapped results. + * + * @template T + * @param {Record> | Record> | null | undefined} collection - The collection to iterate over. + * @returns {T[]} Returns the new flattened array. + * + * @example + * const obj = { a: [1, 2], b: [3, 4] }; + * flatMap(obj); + * // => [1, 2, 3, 4] + */ +declare function flatMap(collection: Record> | Record> | null | undefined): T[]; +/** + * Creates a flattened array of values by running each element in collection through iteratee and flattening the mapped results. + * + * @param {object | null | undefined} collection - The collection to iterate over. + * @returns {any[]} Returns the new flattened array. + * + * @example + * flatMap({ a: 1, b: 2 }); + * // => [1, 2] + */ +declare function flatMap(collection: object | null | undefined): any[]; +/** + * Creates a flattened array of values by running each element in collection through iteratee and flattening the mapped results. + * + * @template T, R + * @param {ArrayLike | null | undefined} collection - The collection to iterate over. + * @param {ListIterator>} iteratee - The function invoked per iteration. + * @returns {R[]} Returns the new flattened array. + * + * @example + * function duplicate(n) { + * return [n, n]; + * } + * + * flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ +declare function flatMap(collection: ArrayLike | null | undefined, iteratee: ListIterator>): R[]; +/** + * Creates a flattened array of values by running each element in collection through iteratee and flattening the mapped results. + * + * @template T, R + * @param {T | null | undefined} collection - The object to iterate over. + * @param {ObjectIterator>} iteratee - The function invoked per iteration. + * @returns {R[]} Returns the new flattened array. + * + * @example + * const obj = { a: 1, b: 2 }; + * flatMap(obj, (value, key) => [key, value]); + * // => ['a', 1, 'b', 2] + */ +declare function flatMap(collection: T | null | undefined, iteratee: ObjectIterator>): R[]; +/** + * Creates a flattened array of values by running each element in collection through iteratee and flattening the mapped results. + * + * @param {object | null | undefined} collection - The collection to iterate over. + * @param {string} iteratee - The property name to use as iteratee. + * @returns {any[]} Returns the new flattened array. + * + * @example + * const users = [ + * { user: 'barney', hobbies: ['hiking', 'coding'] }, + * { user: 'fred', hobbies: ['reading'] } + * ]; + * flatMap(users, 'hobbies'); + * // => ['hiking', 'coding', 'reading'] + */ +declare function flatMap(collection: object | null | undefined, iteratee: string): any[]; +/** + * Creates a flattened array of values by running each element in collection through iteratee and flattening the mapped results. + * + * @param {object | null | undefined} collection - The collection to iterate over. + * @param {object} iteratee - The object properties to match. + * @returns {boolean[]} Returns the new flattened array. + * + * @example + * const users = [ + * { user: 'barney', age: 36, active: true }, + * { user: 'fred', age: 40, active: false } + * ]; + * flatMap(users, { active: false }); + * // => [false] + */ +declare function flatMap(collection: object | null | undefined, iteratee: object): boolean[]; +//#endregion +export { flatMap }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMap.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMap.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..80126a40db3ea1492eff36918d9fcac6b858e848 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMap.d.ts @@ -0,0 +1,94 @@ +import { ListIterator } from "../_internal/ListIterator.js"; +import { ObjectIterator } from "../_internal/ObjectIterator.js"; +import { Many } from "../_internal/Many.js"; + +//#region src/compat/array/flatMap.d.ts +/** + * Creates a flattened array of values by running each element in collection through iteratee and flattening the mapped results. + * + * @template T + * @param {Record> | Record> | null | undefined} collection - The collection to iterate over. + * @returns {T[]} Returns the new flattened array. + * + * @example + * const obj = { a: [1, 2], b: [3, 4] }; + * flatMap(obj); + * // => [1, 2, 3, 4] + */ +declare function flatMap(collection: Record> | Record> | null | undefined): T[]; +/** + * Creates a flattened array of values by running each element in collection through iteratee and flattening the mapped results. + * + * @param {object | null | undefined} collection - The collection to iterate over. + * @returns {any[]} Returns the new flattened array. + * + * @example + * flatMap({ a: 1, b: 2 }); + * // => [1, 2] + */ +declare function flatMap(collection: object | null | undefined): any[]; +/** + * Creates a flattened array of values by running each element in collection through iteratee and flattening the mapped results. + * + * @template T, R + * @param {ArrayLike | null | undefined} collection - The collection to iterate over. + * @param {ListIterator>} iteratee - The function invoked per iteration. + * @returns {R[]} Returns the new flattened array. + * + * @example + * function duplicate(n) { + * return [n, n]; + * } + * + * flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ +declare function flatMap(collection: ArrayLike | null | undefined, iteratee: ListIterator>): R[]; +/** + * Creates a flattened array of values by running each element in collection through iteratee and flattening the mapped results. + * + * @template T, R + * @param {T | null | undefined} collection - The object to iterate over. + * @param {ObjectIterator>} iteratee - The function invoked per iteration. + * @returns {R[]} Returns the new flattened array. + * + * @example + * const obj = { a: 1, b: 2 }; + * flatMap(obj, (value, key) => [key, value]); + * // => ['a', 1, 'b', 2] + */ +declare function flatMap(collection: T | null | undefined, iteratee: ObjectIterator>): R[]; +/** + * Creates a flattened array of values by running each element in collection through iteratee and flattening the mapped results. + * + * @param {object | null | undefined} collection - The collection to iterate over. + * @param {string} iteratee - The property name to use as iteratee. + * @returns {any[]} Returns the new flattened array. + * + * @example + * const users = [ + * { user: 'barney', hobbies: ['hiking', 'coding'] }, + * { user: 'fred', hobbies: ['reading'] } + * ]; + * flatMap(users, 'hobbies'); + * // => ['hiking', 'coding', 'reading'] + */ +declare function flatMap(collection: object | null | undefined, iteratee: string): any[]; +/** + * Creates a flattened array of values by running each element in collection through iteratee and flattening the mapped results. + * + * @param {object | null | undefined} collection - The collection to iterate over. + * @param {object} iteratee - The object properties to match. + * @returns {boolean[]} Returns the new flattened array. + * + * @example + * const users = [ + * { user: 'barney', age: 36, active: true }, + * { user: 'fred', age: 40, active: false } + * ]; + * flatMap(users, { active: false }); + * // => [false] + */ +declare function flatMap(collection: object | null | undefined, iteratee: object): boolean[]; +//#endregion +export { flatMap }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMap.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMap.js new file mode 100644 index 0000000000000000000000000000000000000000..99b596aaaa2ee7d72af4c989f516675c6bb67b1a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMap.js @@ -0,0 +1,23 @@ +const require_isNil = require("../../predicate/isNil.js"); +const require_flattenDepth = require("./flattenDepth.js"); +const require_map = require("./map.js"); +//#region src/compat/array/flatMap.ts +/** +* Creates a flattened array of values by running each element in collection through iteratee and flattening the mapped results. +* +* @template R +* @param {object | null | undefined} collection - The collection to iterate over. +* @param {any} [iteratee] - The function invoked per iteration. +* @returns {R[]} Returns the new flattened array. +* +* @example +* flatMap([1, 2], n => [n, n * 2]); +* // => [1, 2, 2, 4] +*/ +function flatMap(collection, iteratee) { + if (require_isNil.isNil(collection)) return []; + const mapped = require_isNil.isNil(iteratee) ? require_map.map(collection) : require_map.map(collection, iteratee); + return require_flattenDepth.flattenDepth(mapped, 1); +} +//#endregion +exports.flatMap = flatMap; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMap.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMap.mjs new file mode 100644 index 0000000000000000000000000000000000000000..3ba7ecc2fdeb6cb6ee87660a0b7e00ab3f49492a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMap.mjs @@ -0,0 +1,22 @@ +import { isNil } from "../../predicate/isNil.mjs"; +import { flattenDepth } from "./flattenDepth.mjs"; +import { map } from "./map.mjs"; +//#region src/compat/array/flatMap.ts +/** +* Creates a flattened array of values by running each element in collection through iteratee and flattening the mapped results. +* +* @template R +* @param {object | null | undefined} collection - The collection to iterate over. +* @param {any} [iteratee] - The function invoked per iteration. +* @returns {R[]} Returns the new flattened array. +* +* @example +* flatMap([1, 2], n => [n, n * 2]); +* // => [1, 2, 2, 4] +*/ +function flatMap(collection, iteratee) { + if (isNil(collection)) return []; + return flattenDepth(isNil(iteratee) ? map(collection) : map(collection, iteratee), 1); +} +//#endregion +export { flatMap }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDeep.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDeep.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..d2bb0b579ba4e756d86819674c026adc2602f3a5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDeep.d.mts @@ -0,0 +1,83 @@ +import { ListIterator } from "../_internal/ListIterator.mjs"; +import { ObjectIterator } from "../_internal/ObjectIterator.mjs"; +import { ListOfRecursiveArraysOrValues } from "../_internal/ListOfRecursiveArraysOrValues.mjs"; + +//#region src/compat/array/flatMapDeep.d.ts +/** + * Creates a flattened array of values by running each element through iteratee and recursively flattening the mapped results. + * + * @template T + * @param {Record | T> | Record | T> | null | undefined} collection - The collection to iterate over. + * @returns {T[]} Returns the new deeply flattened array. + * + * @example + * const obj = { a: [[1, 2]], b: [[[3]]] }; + * flatMapDeep(obj); + * // => [1, 2, 3] + */ +declare function flatMapDeep(collection: Record | T> | Record | T> | null | undefined): T[]; +/** + * Creates a flattened array of values by running each element through iteratee and recursively flattening the mapped results. + * + * @template T, R + * @param {ArrayLike | null | undefined} collection - The collection to iterate over. + * @param {ListIterator | R>} iteratee - The function invoked per iteration. + * @returns {R[]} Returns the new deeply flattened array. + * + * @example + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ +declare function flatMapDeep(collection: ArrayLike | null | undefined, iteratee: ListIterator | R>): R[]; +/** + * Creates a flattened array of values by running each element through iteratee and recursively flattening the mapped results. + * + * @template T, R + * @param {T | null | undefined} collection - The object to iterate over. + * @param {ObjectIterator | R>} iteratee - The function invoked per iteration. + * @returns {R[]} Returns the new deeply flattened array. + * + * @example + * const obj = { a: 1, b: 2 }; + * flatMapDeep(obj, (value, key) => [[[key, value]]]); + * // => ['a', 1, 'b', 2] + */ +declare function flatMapDeep(collection: T | null | undefined, iteratee: ObjectIterator | R>): R[]; +/** + * Creates a flattened array of values by running each element through iteratee and recursively flattening the mapped results. + * + * @param {object | null | undefined} collection - The collection to iterate over. + * @param {string} iteratee - The property name to use as iteratee. + * @returns {any[]} Returns the new deeply flattened array. + * + * @example + * const users = [ + * { user: 'barney', hobbies: [['hiking', 'coding']] }, + * { user: 'fred', hobbies: [['reading']] } + * ]; + * flatMapDeep(users, 'hobbies'); + * // => ['hiking', 'coding', 'reading'] + */ +declare function flatMapDeep(collection: object | null | undefined, iteratee: string): any[]; +/** + * Creates a flattened array of values by running each element through iteratee and recursively flattening the mapped results. + * + * @param {object | null | undefined} collection - The collection to iterate over. + * @param {object} iteratee - The object properties to match. + * @returns {boolean[]} Returns the new deeply flattened array. + * + * @example + * const users = [ + * { user: 'barney', active: [true, false] }, + * { user: 'fred', active: [false] } + * ]; + * flatMapDeep(users, { active: [false] }); + * // => [false] + */ +declare function flatMapDeep(collection: object | null | undefined, iteratee: object): boolean[]; +//#endregion +export { flatMapDeep }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDeep.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDeep.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1e2f394fde7facfd79ed2208385fd4fcedd8339c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDeep.d.ts @@ -0,0 +1,83 @@ +import { ListIterator } from "../_internal/ListIterator.js"; +import { ObjectIterator } from "../_internal/ObjectIterator.js"; +import { ListOfRecursiveArraysOrValues } from "../_internal/ListOfRecursiveArraysOrValues.js"; + +//#region src/compat/array/flatMapDeep.d.ts +/** + * Creates a flattened array of values by running each element through iteratee and recursively flattening the mapped results. + * + * @template T + * @param {Record | T> | Record | T> | null | undefined} collection - The collection to iterate over. + * @returns {T[]} Returns the new deeply flattened array. + * + * @example + * const obj = { a: [[1, 2]], b: [[[3]]] }; + * flatMapDeep(obj); + * // => [1, 2, 3] + */ +declare function flatMapDeep(collection: Record | T> | Record | T> | null | undefined): T[]; +/** + * Creates a flattened array of values by running each element through iteratee and recursively flattening the mapped results. + * + * @template T, R + * @param {ArrayLike | null | undefined} collection - The collection to iterate over. + * @param {ListIterator | R>} iteratee - The function invoked per iteration. + * @returns {R[]} Returns the new deeply flattened array. + * + * @example + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ +declare function flatMapDeep(collection: ArrayLike | null | undefined, iteratee: ListIterator | R>): R[]; +/** + * Creates a flattened array of values by running each element through iteratee and recursively flattening the mapped results. + * + * @template T, R + * @param {T | null | undefined} collection - The object to iterate over. + * @param {ObjectIterator | R>} iteratee - The function invoked per iteration. + * @returns {R[]} Returns the new deeply flattened array. + * + * @example + * const obj = { a: 1, b: 2 }; + * flatMapDeep(obj, (value, key) => [[[key, value]]]); + * // => ['a', 1, 'b', 2] + */ +declare function flatMapDeep(collection: T | null | undefined, iteratee: ObjectIterator | R>): R[]; +/** + * Creates a flattened array of values by running each element through iteratee and recursively flattening the mapped results. + * + * @param {object | null | undefined} collection - The collection to iterate over. + * @param {string} iteratee - The property name to use as iteratee. + * @returns {any[]} Returns the new deeply flattened array. + * + * @example + * const users = [ + * { user: 'barney', hobbies: [['hiking', 'coding']] }, + * { user: 'fred', hobbies: [['reading']] } + * ]; + * flatMapDeep(users, 'hobbies'); + * // => ['hiking', 'coding', 'reading'] + */ +declare function flatMapDeep(collection: object | null | undefined, iteratee: string): any[]; +/** + * Creates a flattened array of values by running each element through iteratee and recursively flattening the mapped results. + * + * @param {object | null | undefined} collection - The collection to iterate over. + * @param {object} iteratee - The object properties to match. + * @returns {boolean[]} Returns the new deeply flattened array. + * + * @example + * const users = [ + * { user: 'barney', active: [true, false] }, + * { user: 'fred', active: [false] } + * ]; + * flatMapDeep(users, { active: [false] }); + * // => [false] + */ +declare function flatMapDeep(collection: object | null | undefined, iteratee: object): boolean[]; +//#endregion +export { flatMapDeep }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDeep.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDeep.js new file mode 100644 index 0000000000000000000000000000000000000000..4596d7e98dc3d60143fcaa7c20490ff24df26f55 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDeep.js @@ -0,0 +1,19 @@ +const require_flatMapDepth = require("./flatMapDepth.js"); +//#region src/compat/array/flatMapDeep.ts +/** +* Creates a flattened array of values by running each element through iteratee and recursively flattening the mapped results. +* +* @template T, R +* @param {Record> | T> | Record> | T> | ArrayLike | object | null | undefined} collection - The array or object to iterate over. +* @param {((value: T, index: number, array: ArrayLike) => ArrayLike> | R) | ((value: T[keyof T], key: string, object: T) => ArrayLike> | R) | string | object} [iteratee] - The function that produces the new array elements. +* @returns {T[] | R[] | any[] | boolean[]} A new array that has been deeply flattened. +* +* @example +* flatMapDeep([1, 2, 3], n => [[n, n]]); +* // => [1, 1, 2, 2, 3, 3] +*/ +function flatMapDeep(collection, iteratee) { + return require_flatMapDepth.flatMapDepth(collection, iteratee, Infinity); +} +//#endregion +exports.flatMapDeep = flatMapDeep; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDeep.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDeep.mjs new file mode 100644 index 0000000000000000000000000000000000000000..fcbe38a0f32d2b9a18198b1c5bc9f7c336c5e97a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDeep.mjs @@ -0,0 +1,19 @@ +import { flatMapDepth } from "./flatMapDepth.mjs"; +//#region src/compat/array/flatMapDeep.ts +/** +* Creates a flattened array of values by running each element through iteratee and recursively flattening the mapped results. +* +* @template T, R +* @param {Record> | T> | Record> | T> | ArrayLike | object | null | undefined} collection - The array or object to iterate over. +* @param {((value: T, index: number, array: ArrayLike) => ArrayLike> | R) | ((value: T[keyof T], key: string, object: T) => ArrayLike> | R) | string | object} [iteratee] - The function that produces the new array elements. +* @returns {T[] | R[] | any[] | boolean[]} A new array that has been deeply flattened. +* +* @example +* flatMapDeep([1, 2, 3], n => [[n, n]]); +* // => [1, 1, 2, 2, 3, 3] +*/ +function flatMapDeep(collection, iteratee) { + return flatMapDepth(collection, iteratee, Infinity); +} +//#endregion +export { flatMapDeep }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDepth.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDepth.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..91e82fc17944b1dcee651928e0ca1a0d40dd4ce3 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDepth.d.mts @@ -0,0 +1,87 @@ +import { ListIterator } from "../_internal/ListIterator.mjs"; +import { ObjectIterator } from "../_internal/ObjectIterator.mjs"; +import { ListOfRecursiveArraysOrValues } from "../_internal/ListOfRecursiveArraysOrValues.mjs"; + +//#region src/compat/array/flatMapDepth.d.ts +/** + * Creates a flattened array of values by running each element through iteratee and flattening the mapped results up to depth times. + * + * @template T + * @param {Record | T> | Record | T> | null | undefined} collection - The collection to iterate over. + * @returns {T[]} Returns the new flattened array. + * + * @example + * const obj = { a: [[1, 2]], b: [[[3]]] }; + * flatMapDepth(obj); + * // => [1, 2, [3]] + */ +declare function flatMapDepth(collection: Record | T> | Record | T> | null | undefined): T[]; +/** + * Creates a flattened array of values by running each element through iteratee and flattening the mapped results up to depth times. + * + * @template T, R + * @param {ArrayLike | null | undefined} collection - The collection to iterate over. + * @param {ListIterator | R>} iteratee - The function invoked per iteration. + * @param {number} [depth=1] - The maximum recursion depth. + * @returns {R[]} Returns the new flattened array. + * + * @example + * function duplicate(n) { + * return [[n, n]]; + * } + * + * flatMapDepth([1, 2], duplicate, 2); + * // => [1, 1, 2, 2] + */ +declare function flatMapDepth(collection: ArrayLike | null | undefined, iteratee: ListIterator | R>, depth?: number): R[]; +/** + * Creates a flattened array of values by running each element through iteratee and flattening the mapped results up to depth times. + * + * @template T, R + * @param {T | null | undefined} collection - The object to iterate over. + * @param {ObjectIterator | R>} iteratee - The function invoked per iteration. + * @param {number} [depth=1] - The maximum recursion depth. + * @returns {R[]} Returns the new flattened array. + * + * @example + * const obj = { a: 1, b: 2 }; + * flatMapDepth(obj, (value, key) => [[key, value]], 2); + * // => ['a', 1, 'b', 2] + */ +declare function flatMapDepth(collection: T | null | undefined, iteratee: ObjectIterator | R>, depth?: number): R[]; +/** + * Creates a flattened array of values by running each element through iteratee and flattening the mapped results up to depth times. + * + * @param {object | null | undefined} collection - The collection to iterate over. + * @param {string} iteratee - The property name to use as iteratee. + * @param {number} [depth=1] - The maximum recursion depth. + * @returns {any[]} Returns the new flattened array. + * + * @example + * const users = [ + * { user: 'barney', hobbies: [['hiking'], ['coding']] }, + * { user: 'fred', hobbies: [['reading']] } + * ]; + * flatMapDepth(users, 'hobbies', 2); + * // => ['hiking', 'coding', 'reading'] + */ +declare function flatMapDepth(collection: object | null | undefined, iteratee: string, depth?: number): any[]; +/** + * Creates a flattened array of values by running each element through iteratee and flattening the mapped results up to depth times. + * + * @param {object | null | undefined} collection - The collection to iterate over. + * @param {object} iteratee - The object properties to match. + * @param {number} [depth=1] - The maximum recursion depth. + * @returns {boolean[]} Returns the new flattened array. + * + * @example + * const users = [ + * { user: 'barney', active: [[true], [false]] }, + * { user: 'fred', active: [[false]] } + * ]; + * flatMapDepth(users, { active: [[false]] }); + * // => [false] + */ +declare function flatMapDepth(collection: object | null | undefined, iteratee: object, depth?: number): boolean[]; +//#endregion +export { flatMapDepth }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDepth.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDepth.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e0b30d58219d97e712c5ec4771d1788ca8a8ef9f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDepth.d.ts @@ -0,0 +1,87 @@ +import { ListIterator } from "../_internal/ListIterator.js"; +import { ObjectIterator } from "../_internal/ObjectIterator.js"; +import { ListOfRecursiveArraysOrValues } from "../_internal/ListOfRecursiveArraysOrValues.js"; + +//#region src/compat/array/flatMapDepth.d.ts +/** + * Creates a flattened array of values by running each element through iteratee and flattening the mapped results up to depth times. + * + * @template T + * @param {Record | T> | Record | T> | null | undefined} collection - The collection to iterate over. + * @returns {T[]} Returns the new flattened array. + * + * @example + * const obj = { a: [[1, 2]], b: [[[3]]] }; + * flatMapDepth(obj); + * // => [1, 2, [3]] + */ +declare function flatMapDepth(collection: Record | T> | Record | T> | null | undefined): T[]; +/** + * Creates a flattened array of values by running each element through iteratee and flattening the mapped results up to depth times. + * + * @template T, R + * @param {ArrayLike | null | undefined} collection - The collection to iterate over. + * @param {ListIterator | R>} iteratee - The function invoked per iteration. + * @param {number} [depth=1] - The maximum recursion depth. + * @returns {R[]} Returns the new flattened array. + * + * @example + * function duplicate(n) { + * return [[n, n]]; + * } + * + * flatMapDepth([1, 2], duplicate, 2); + * // => [1, 1, 2, 2] + */ +declare function flatMapDepth(collection: ArrayLike | null | undefined, iteratee: ListIterator | R>, depth?: number): R[]; +/** + * Creates a flattened array of values by running each element through iteratee and flattening the mapped results up to depth times. + * + * @template T, R + * @param {T | null | undefined} collection - The object to iterate over. + * @param {ObjectIterator | R>} iteratee - The function invoked per iteration. + * @param {number} [depth=1] - The maximum recursion depth. + * @returns {R[]} Returns the new flattened array. + * + * @example + * const obj = { a: 1, b: 2 }; + * flatMapDepth(obj, (value, key) => [[key, value]], 2); + * // => ['a', 1, 'b', 2] + */ +declare function flatMapDepth(collection: T | null | undefined, iteratee: ObjectIterator | R>, depth?: number): R[]; +/** + * Creates a flattened array of values by running each element through iteratee and flattening the mapped results up to depth times. + * + * @param {object | null | undefined} collection - The collection to iterate over. + * @param {string} iteratee - The property name to use as iteratee. + * @param {number} [depth=1] - The maximum recursion depth. + * @returns {any[]} Returns the new flattened array. + * + * @example + * const users = [ + * { user: 'barney', hobbies: [['hiking'], ['coding']] }, + * { user: 'fred', hobbies: [['reading']] } + * ]; + * flatMapDepth(users, 'hobbies', 2); + * // => ['hiking', 'coding', 'reading'] + */ +declare function flatMapDepth(collection: object | null | undefined, iteratee: string, depth?: number): any[]; +/** + * Creates a flattened array of values by running each element through iteratee and flattening the mapped results up to depth times. + * + * @param {object | null | undefined} collection - The collection to iterate over. + * @param {object} iteratee - The object properties to match. + * @param {number} [depth=1] - The maximum recursion depth. + * @returns {boolean[]} Returns the new flattened array. + * + * @example + * const users = [ + * { user: 'barney', active: [[true], [false]] }, + * { user: 'fred', active: [[false]] } + * ]; + * flatMapDepth(users, { active: [[false]] }); + * // => [false] + */ +declare function flatMapDepth(collection: object | null | undefined, iteratee: object, depth?: number): boolean[]; +//#endregion +export { flatMapDepth }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDepth.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDepth.js new file mode 100644 index 0000000000000000000000000000000000000000..2698d8faa518569ed0621e5d8448514185fb19e0 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDepth.js @@ -0,0 +1,26 @@ +const require_identity = require("../../function/identity.js"); +const require_iteratee = require("../util/iteratee.js"); +const require_flatten = require("./flatten.js"); +const require_map = require("./map.js"); +//#region src/compat/array/flatMapDepth.ts +/** +* Creates a flattened array of values by running each element through iteratee and flattening the mapped results up to depth times. +* +* @template T, R +* @param {Record> | T> | Record> | T> | ArrayLike | object | null | undefined} collection - The array or object to iterate over. +* @param {((value: T, index: number, array: ArrayLike) => ArrayLike> | R) | ((value: T[keyof T], key: string, object: T) => ArrayLike> | R) | string | object} [iteratee] - The function that produces the new array elements. +* @param {number} [depth=1] - The maximum recursion depth. +* @returns {T[] | R[] | any[] | boolean[]} A new array that has been flattened up to the specified depth. +* +* @example +* flatMapDepth([1, 2, 3], n => [[n, n]], 2); +* // => [1, 1, 2, 2, 3, 3] +*/ +function flatMapDepth(collection, iteratee$1 = require_identity.identity, depth = 1) { + if (collection == null) return []; + const iterateeFn = require_iteratee.iteratee(iteratee$1); + const mapped = require_map.map(collection, iterateeFn); + return require_flatten.flatten(mapped, depth); +} +//#endregion +exports.flatMapDepth = flatMapDepth; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDepth.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDepth.mjs new file mode 100644 index 0000000000000000000000000000000000000000..780b63be659275047c0f309cc294ef788bdd5af6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatMapDepth.mjs @@ -0,0 +1,24 @@ +import { identity } from "../../function/identity.mjs"; +import { iteratee } from "../util/iteratee.mjs"; +import { flatten } from "./flatten.mjs"; +import { map } from "./map.mjs"; +//#region src/compat/array/flatMapDepth.ts +/** +* Creates a flattened array of values by running each element through iteratee and flattening the mapped results up to depth times. +* +* @template T, R +* @param {Record> | T> | Record> | T> | ArrayLike | object | null | undefined} collection - The array or object to iterate over. +* @param {((value: T, index: number, array: ArrayLike) => ArrayLike> | R) | ((value: T[keyof T], key: string, object: T) => ArrayLike> | R) | string | object} [iteratee] - The function that produces the new array elements. +* @param {number} [depth=1] - The maximum recursion depth. +* @returns {T[] | R[] | any[] | boolean[]} A new array that has been flattened up to the specified depth. +* +* @example +* flatMapDepth([1, 2, 3], n => [[n, n]], 2); +* // => [1, 1, 2, 2, 3, 3] +*/ +function flatMapDepth(collection, iteratee$1 = identity, depth = 1) { + if (collection == null) return []; + return flatten(map(collection, iteratee(iteratee$1)), depth); +} +//#endregion +export { flatMapDepth }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flatten.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatten.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..079047d6ec6dc3f5c93b17a97e0394fde367f9fc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatten.d.mts @@ -0,0 +1,16 @@ +//#region src/compat/array/flatten.d.ts +/** + * Flattens array up to depth times. + * + * @template T + * @param {ArrayLike | null | undefined} value - The array to flatten. + * @param {number} depth - The maximum recursion depth. + * @returns {any[]} Returns the new flattened array. + * + * @example + * flatten([1, [2, [3, [4]], 5]], 2); + * // => [1, 2, 3, [4], 5] + */ +declare function flatten(value: ArrayLike | null | undefined): T[]; +//#endregion +export { flatten }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flatten.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatten.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..079047d6ec6dc3f5c93b17a97e0394fde367f9fc --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatten.d.ts @@ -0,0 +1,16 @@ +//#region src/compat/array/flatten.d.ts +/** + * Flattens array up to depth times. + * + * @template T + * @param {ArrayLike | null | undefined} value - The array to flatten. + * @param {number} depth - The maximum recursion depth. + * @returns {any[]} Returns the new flattened array. + * + * @example + * flatten([1, [2, [3, [4]], 5]], 2); + * // => [1, 2, 3, [4], 5] + */ +declare function flatten(value: ArrayLike | null | undefined): T[]; +//#endregion +export { flatten }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flatten.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatten.js new file mode 100644 index 0000000000000000000000000000000000000000..bdb53fcd3ddb607962ad643a451f1b6c9fedac53 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatten.js @@ -0,0 +1,19 @@ +const require_isArrayLike = require("../predicate/isArrayLike.js"); +//#region src/compat/array/flatten.ts +function flatten(value, depth = 1) { + const result = []; + const flooredDepth = Math.floor(depth); + if (!require_isArrayLike.isArrayLike(value)) return result; + const recursive = (arr, currentDepth) => { + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + if (currentDepth < flooredDepth && (Array.isArray(item) || Boolean(item?.[Symbol.isConcatSpreadable]) || item !== null && typeof item === "object" && Object.prototype.toString.call(item) === "[object Arguments]")) if (Array.isArray(item)) recursive(item, currentDepth + 1); + else recursive(Array.from(item), currentDepth + 1); + else result.push(item); + } + }; + recursive(Array.from(value), 0); + return result; +} +//#endregion +exports.flatten = flatten; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flatten.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatten.mjs new file mode 100644 index 0000000000000000000000000000000000000000..0fb624710912acc84fb7ddc9b1cb6011434334dd --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flatten.mjs @@ -0,0 +1,19 @@ +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +//#region src/compat/array/flatten.ts +function flatten(value, depth = 1) { + const result = []; + const flooredDepth = Math.floor(depth); + if (!isArrayLike(value)) return result; + const recursive = (arr, currentDepth) => { + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + if (currentDepth < flooredDepth && (Array.isArray(item) || Boolean(item?.[Symbol.isConcatSpreadable]) || item !== null && typeof item === "object" && Object.prototype.toString.call(item) === "[object Arguments]")) if (Array.isArray(item)) recursive(item, currentDepth + 1); + else recursive(Array.from(item), currentDepth + 1); + else result.push(item); + } + }; + recursive(Array.from(value), 0); + return result; +} +//#endregion +export { flatten }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDeep.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDeep.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..636d86cb2011bf4fa91f6ec6f57aff3a433c9a65 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDeep.d.mts @@ -0,0 +1,17 @@ +import { ListOfRecursiveArraysOrValues } from "../_internal/ListOfRecursiveArraysOrValues.mjs"; + +//#region src/compat/array/flattenDeep.d.ts +/** + * Recursively flattens array. + * + * @template T + * @param {ArrayLike | null | undefined} array - The array to flatten. + * @returns {Array>} Returns the new flattened array. + * + * @example + * flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ +declare function flattenDeep(value: ListOfRecursiveArraysOrValues | null | undefined): Array ? never : T>; +//#endregion +export { flattenDeep }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDeep.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDeep.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..38687cbd45a70ad532df7dddad715785a0745343 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDeep.d.ts @@ -0,0 +1,17 @@ +import { ListOfRecursiveArraysOrValues } from "../_internal/ListOfRecursiveArraysOrValues.js"; + +//#region src/compat/array/flattenDeep.d.ts +/** + * Recursively flattens array. + * + * @template T + * @param {ArrayLike | null | undefined} array - The array to flatten. + * @returns {Array>} Returns the new flattened array. + * + * @example + * flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ +declare function flattenDeep(value: ListOfRecursiveArraysOrValues | null | undefined): Array ? never : T>; +//#endregion +export { flattenDeep }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDeep.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDeep.js new file mode 100644 index 0000000000000000000000000000000000000000..323686ed45f4819fce6ed444e89a14b84245d6c6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDeep.js @@ -0,0 +1,18 @@ +const require_flattenDepth = require("./flattenDepth.js"); +//#region src/compat/array/flattenDeep.ts +/** +* Recursively flattens array. +* +* @template T +* @param {ArrayLike | null | undefined} array - The array to flatten. +* @returns {Array>} Returns the new flattened array. +* +* @example +* flattenDeep([1, [2, [3, [4]], 5]]); +* // => [1, 2, 3, 4, 5] +*/ +function flattenDeep(value) { + return require_flattenDepth.flattenDepth(value, Infinity); +} +//#endregion +exports.flattenDeep = flattenDeep; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDeep.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDeep.mjs new file mode 100644 index 0000000000000000000000000000000000000000..53d64b704a3a15b2914d3fed81c71a104dfe22b2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDeep.mjs @@ -0,0 +1,18 @@ +import { flattenDepth } from "./flattenDepth.mjs"; +//#region src/compat/array/flattenDeep.ts +/** +* Recursively flattens array. +* +* @template T +* @param {ArrayLike | null | undefined} array - The array to flatten. +* @returns {Array>} Returns the new flattened array. +* +* @example +* flattenDeep([1, [2, [3, [4]], 5]]); +* // => [1, 2, 3, 4, 5] +*/ +function flattenDeep(value) { + return flattenDepth(value, Infinity); +} +//#endregion +export { flattenDeep }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDepth.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDepth.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..1ea0968de848304acf505646b9ab81dfa23d4029 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDepth.d.mts @@ -0,0 +1,23 @@ +import { ListOfRecursiveArraysOrValues } from "../_internal/ListOfRecursiveArraysOrValues.mjs"; + +//#region src/compat/array/flattenDepth.d.ts +/** + * Recursively flattens array up to depth times. + * + * @template T + * @param {ArrayLike | null | undefined} array - The array to flatten. + * @param {number} [depth=1] - The maximum recursion depth. + * @returns {T[]} Returns the new flattened array. + * + * @example + * const array = [1, [2, [3, [4]], 5]]; + * + * flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ +declare function flattenDepth(array: ListOfRecursiveArraysOrValues | null | undefined, depth?: number): T[]; +//#endregion +export { flattenDepth }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDepth.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDepth.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..62bbc1349c45406127d929ea720f6388b0402165 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDepth.d.ts @@ -0,0 +1,23 @@ +import { ListOfRecursiveArraysOrValues } from "../_internal/ListOfRecursiveArraysOrValues.js"; + +//#region src/compat/array/flattenDepth.d.ts +/** + * Recursively flattens array up to depth times. + * + * @template T + * @param {ArrayLike | null | undefined} array - The array to flatten. + * @param {number} [depth=1] - The maximum recursion depth. + * @returns {T[]} Returns the new flattened array. + * + * @example + * const array = [1, [2, [3, [4]], 5]]; + * + * flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ +declare function flattenDepth(array: ListOfRecursiveArraysOrValues | null | undefined, depth?: number): T[]; +//#endregion +export { flattenDepth }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDepth.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDepth.js new file mode 100644 index 0000000000000000000000000000000000000000..25e7ff0ab884f5e36b1c4fff62f04f7157d9a53d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDepth.js @@ -0,0 +1,24 @@ +const require_flatten = require("./flatten.js"); +//#region src/compat/array/flattenDepth.ts +/** +* Recursively flattens array up to depth times. +* +* @template T +* @param {ArrayLike | null | undefined} array - The array to flatten. +* @param {number} [depth=1] - The maximum recursion depth. +* @returns {T[]} Returns the new flattened array. +* +* @example +* const array = [1, [2, [3, [4]], 5]]; +* +* flattenDepth(array, 1); +* // => [1, 2, [3, [4]], 5] +* +* flattenDepth(array, 2); +* // => [1, 2, 3, [4], 5] +*/ +function flattenDepth(array, depth = 1) { + return require_flatten.flatten(array, depth); +} +//#endregion +exports.flattenDepth = flattenDepth; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDepth.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDepth.mjs new file mode 100644 index 0000000000000000000000000000000000000000..472d75d0743e7acfa45891a91a59307a47c45f96 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/flattenDepth.mjs @@ -0,0 +1,24 @@ +import { flatten } from "./flatten.mjs"; +//#region src/compat/array/flattenDepth.ts +/** +* Recursively flattens array up to depth times. +* +* @template T +* @param {ArrayLike | null | undefined} array - The array to flatten. +* @param {number} [depth=1] - The maximum recursion depth. +* @returns {T[]} Returns the new flattened array. +* +* @example +* const array = [1, [2, [3, [4]], 5]]; +* +* flattenDepth(array, 1); +* // => [1, 2, [3, [4]], 5] +* +* flattenDepth(array, 2); +* // => [1, 2, 3, [4], 5] +*/ +function flattenDepth(array, depth = 1) { + return flatten(array, depth); +} +//#endregion +export { flattenDepth }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/forEach.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/forEach.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..2fcc4e13dceb3e8e0672e3c09857c6f881d675a5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/forEach.d.mts @@ -0,0 +1,111 @@ +import { ArrayIterator } from "../_internal/ArrayIterator.mjs"; +import { ListIterator } from "../_internal/ListIterator.mjs"; +import { ObjectIterator } from "../_internal/ObjectIterator.mjs"; +import { StringIterator } from "../_internal/StringIterator.mjs"; + +//#region src/compat/array/forEach.d.ts +/** + * Iterates over elements of array and invokes iteratee for each element. + * + * @template T + * @param {T[]} collection - The array to iterate over. + * @param {ArrayIterator} [iteratee] - The function invoked per iteration. + * @returns {T[]} Returns array. + * + * @example + * forEach([1, 2], value => console.log(value)); + * // => Logs `1` then `2`. + */ +declare function forEach(collection: T[], iteratee?: ArrayIterator): T[]; +/** + * Iterates over characters of string and invokes iteratee for each character. + * + * @param {string} collection - The string to iterate over. + * @param {StringIterator} [iteratee] - The function invoked per iteration. + * @returns {string} Returns string. + * + * @example + * forEach('abc', char => console.log(char)); + * // => Logs 'a', 'b', then 'c'. + */ +declare function forEach(collection: string, iteratee?: StringIterator): string; +/** + * Iterates over elements of collection and invokes iteratee for each element. + * + * @template T + * @param {ArrayLike} collection - The collection to iterate over. + * @param {ListIterator} [iteratee] - The function invoked per iteration. + * @returns {ArrayLike} Returns collection. + * + * @example + * forEach({ 0: 'a', 1: 'b', length: 2 }, value => console.log(value)); + * // => Logs 'a' then 'b'. + */ +declare function forEach(collection: ArrayLike, iteratee?: ListIterator): ArrayLike; +/** + * Iterates over own enumerable string keyed properties of an object and invokes iteratee for each property. + * + * @template T + * @param {T} collection - The object to iterate over. + * @param {ObjectIterator} [iteratee] - The function invoked per iteration. + * @returns {T} Returns object. + * + * @example + * forEach({ a: 1, b: 2 }, (value, key) => console.log(key)); + * // => Logs 'a' then 'b'. + */ +declare function forEach(collection: T, iteratee?: ObjectIterator): T; +/** + * Iterates over elements of array and invokes iteratee for each element. + * + * @template T, U + * @param {U & (T[] | null | undefined)} collection - The array to iterate over. + * @param {ArrayIterator} [iteratee] - The function invoked per iteration. + * @returns {U} Returns the array. + * + * @example + * forEach([1, 2], value => console.log(value)); + * // => Logs `1` then `2`. + */ +declare function forEach(collection: U & (T[] | null | undefined), iteratee?: ArrayIterator): U; +/** + * Iterates over characters of string and invokes iteratee for each character. + * + * @template T + * @param {T} collection - The string to iterate over. + * @param {StringIterator} [iteratee] - The function invoked per iteration. + * @returns {T} Returns the string. + * + * @example + * forEach('abc', char => console.log(char)); + * // => Logs 'a', 'b', then 'c'. + */ +declare function forEach(collection: T, iteratee?: StringIterator): T; +/** + * Iterates over elements of collection and invokes iteratee for each element. + * + * @template T, L + * @param {L & (ArrayLike | null | undefined)} collection - The collection to iterate over. + * @param {ListIterator} [iteratee] - The function invoked per iteration. + * @returns {L} Returns the collection. + * + * @example + * forEach({ 0: 'a', 1: 'b', length: 2 }, value => console.log(value)); + * // => Logs 'a' then 'b'. + */ +declare function forEach | null | undefined>(collection: L & (ArrayLike | null | undefined), iteratee?: ListIterator): L; +/** + * Iterates over own enumerable string keyed properties of an object and invokes iteratee for each property. + * + * @template T + * @param {T | null | undefined} collection - The object to iterate over. + * @param {ObjectIterator} [iteratee] - The function invoked per iteration. + * @returns {T | null | undefined} Returns the object. + * + * @example + * forEach({ a: 1, b: 2 }, (value, key) => console.log(key)); + * // => Logs 'a' then 'b'. + */ +declare function forEach(collection: T | null | undefined, iteratee?: ObjectIterator): T | null | undefined; +//#endregion +export { forEach }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/forEach.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/forEach.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8e6cbcaa5077d12493bc33db5a044d29fe471459 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/forEach.d.ts @@ -0,0 +1,111 @@ +import { ArrayIterator } from "../_internal/ArrayIterator.js"; +import { ListIterator } from "../_internal/ListIterator.js"; +import { ObjectIterator } from "../_internal/ObjectIterator.js"; +import { StringIterator } from "../_internal/StringIterator.js"; + +//#region src/compat/array/forEach.d.ts +/** + * Iterates over elements of array and invokes iteratee for each element. + * + * @template T + * @param {T[]} collection - The array to iterate over. + * @param {ArrayIterator} [iteratee] - The function invoked per iteration. + * @returns {T[]} Returns array. + * + * @example + * forEach([1, 2], value => console.log(value)); + * // => Logs `1` then `2`. + */ +declare function forEach(collection: T[], iteratee?: ArrayIterator): T[]; +/** + * Iterates over characters of string and invokes iteratee for each character. + * + * @param {string} collection - The string to iterate over. + * @param {StringIterator} [iteratee] - The function invoked per iteration. + * @returns {string} Returns string. + * + * @example + * forEach('abc', char => console.log(char)); + * // => Logs 'a', 'b', then 'c'. + */ +declare function forEach(collection: string, iteratee?: StringIterator): string; +/** + * Iterates over elements of collection and invokes iteratee for each element. + * + * @template T + * @param {ArrayLike} collection - The collection to iterate over. + * @param {ListIterator} [iteratee] - The function invoked per iteration. + * @returns {ArrayLike} Returns collection. + * + * @example + * forEach({ 0: 'a', 1: 'b', length: 2 }, value => console.log(value)); + * // => Logs 'a' then 'b'. + */ +declare function forEach(collection: ArrayLike, iteratee?: ListIterator): ArrayLike; +/** + * Iterates over own enumerable string keyed properties of an object and invokes iteratee for each property. + * + * @template T + * @param {T} collection - The object to iterate over. + * @param {ObjectIterator} [iteratee] - The function invoked per iteration. + * @returns {T} Returns object. + * + * @example + * forEach({ a: 1, b: 2 }, (value, key) => console.log(key)); + * // => Logs 'a' then 'b'. + */ +declare function forEach(collection: T, iteratee?: ObjectIterator): T; +/** + * Iterates over elements of array and invokes iteratee for each element. + * + * @template T, U + * @param {U & (T[] | null | undefined)} collection - The array to iterate over. + * @param {ArrayIterator} [iteratee] - The function invoked per iteration. + * @returns {U} Returns the array. + * + * @example + * forEach([1, 2], value => console.log(value)); + * // => Logs `1` then `2`. + */ +declare function forEach(collection: U & (T[] | null | undefined), iteratee?: ArrayIterator): U; +/** + * Iterates over characters of string and invokes iteratee for each character. + * + * @template T + * @param {T} collection - The string to iterate over. + * @param {StringIterator} [iteratee] - The function invoked per iteration. + * @returns {T} Returns the string. + * + * @example + * forEach('abc', char => console.log(char)); + * // => Logs 'a', 'b', then 'c'. + */ +declare function forEach(collection: T, iteratee?: StringIterator): T; +/** + * Iterates over elements of collection and invokes iteratee for each element. + * + * @template T, L + * @param {L & (ArrayLike | null | undefined)} collection - The collection to iterate over. + * @param {ListIterator} [iteratee] - The function invoked per iteration. + * @returns {L} Returns the collection. + * + * @example + * forEach({ 0: 'a', 1: 'b', length: 2 }, value => console.log(value)); + * // => Logs 'a' then 'b'. + */ +declare function forEach | null | undefined>(collection: L & (ArrayLike | null | undefined), iteratee?: ListIterator): L; +/** + * Iterates over own enumerable string keyed properties of an object and invokes iteratee for each property. + * + * @template T + * @param {T | null | undefined} collection - The object to iterate over. + * @param {ObjectIterator} [iteratee] - The function invoked per iteration. + * @returns {T | null | undefined} Returns the object. + * + * @example + * forEach({ a: 1, b: 2 }, (value, key) => console.log(key)); + * // => Logs 'a' then 'b'. + */ +declare function forEach(collection: T | null | undefined, iteratee?: ObjectIterator): T | null | undefined; +//#endregion +export { forEach }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/forEach.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/forEach.js new file mode 100644 index 0000000000000000000000000000000000000000..a19b54437541c695c492cc27b276356c1f48987c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/forEach.js @@ -0,0 +1,34 @@ +const require_identity = require("../../function/identity.js"); +const require_range = require("../../math/range.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +//#region src/compat/array/forEach.ts +/** +* Iterates over each element of the object invoking the provided callback function for each property. +* +* @template T - The type of object. +* @param {T} object - The object to iterate over. +* @param {(value: T[keyof T], key: keyof T, object: T) => unknown} [callback] - The function invoked for each property. +* The callback function receives three arguments: +* - 'value': The current property being processed in the object. +* - 'key': The key of the current property being processed in the object. +* - 'object': The object 'forEach' was called upon. +* @returns {T} Returns the original object. +* +* @example +* forEach({'a': 1, 'b': 2 }, (value, key, object) => console.log(value, key)); +* // Output: +* // 1 'a' +* // 2 'b' +*/ +function forEach(collection, callback = require_identity.identity) { + if (!collection) return collection; + const keys = require_isArrayLike.isArrayLike(collection) || Array.isArray(collection) ? require_range.range(0, collection.length) : Object.keys(collection); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const value = collection[key]; + if (callback(value, key, collection) === false) break; + } + return collection; +} +//#endregion +exports.forEach = forEach; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/forEach.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/forEach.mjs new file mode 100644 index 0000000000000000000000000000000000000000..8a2ca410512df328bcb64022bd6cb9364517414a --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/forEach.mjs @@ -0,0 +1,34 @@ +import { identity } from "../../function/identity.mjs"; +import { range } from "../../math/range.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +//#region src/compat/array/forEach.ts +/** +* Iterates over each element of the object invoking the provided callback function for each property. +* +* @template T - The type of object. +* @param {T} object - The object to iterate over. +* @param {(value: T[keyof T], key: keyof T, object: T) => unknown} [callback] - The function invoked for each property. +* The callback function receives three arguments: +* - 'value': The current property being processed in the object. +* - 'key': The key of the current property being processed in the object. +* - 'object': The object 'forEach' was called upon. +* @returns {T} Returns the original object. +* +* @example +* forEach({'a': 1, 'b': 2 }, (value, key, object) => console.log(value, key)); +* // Output: +* // 1 'a' +* // 2 'b' +*/ +function forEach(collection, callback = identity) { + if (!collection) return collection; + const keys = isArrayLike(collection) || Array.isArray(collection) ? range(0, collection.length) : Object.keys(collection); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const value = collection[key]; + if (callback(value, key, collection) === false) break; + } + return collection; +} +//#endregion +export { forEach }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/forEachRight.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/forEachRight.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..c3b6a884973db9f2efbcae1ab3ef8a23d55386d6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/forEachRight.d.mts @@ -0,0 +1,111 @@ +import { ArrayIterator } from "../_internal/ArrayIterator.mjs"; +import { ListIterator } from "../_internal/ListIterator.mjs"; +import { ObjectIterator } from "../_internal/ObjectIterator.mjs"; +import { StringIterator } from "../_internal/StringIterator.mjs"; + +//#region src/compat/array/forEachRight.d.ts +/** + * Iterates over elements of array from right to left and invokes iteratee for each element. + * + * @template T + * @param {T[]} collection - The array to iterate over. + * @param {ArrayIterator} [iteratee] - The function invoked per iteration. + * @returns {T[]} Returns array. + * + * @example + * forEachRight([1, 2], value => console.log(value)); + * // => Logs `2` then `1`. + */ +declare function forEachRight(collection: T[], iteratee?: ArrayIterator): T[]; +/** + * Iterates over characters of string from right to left and invokes iteratee for each character. + * + * @param {string} collection - The string to iterate over. + * @param {StringIterator} [iteratee] - The function invoked per iteration. + * @returns {string} Returns string. + * + * @example + * forEachRight('abc', char => console.log(char)); + * // => Logs 'c', 'b', then 'a'. + */ +declare function forEachRight(collection: string, iteratee?: StringIterator): string; +/** + * Iterates over elements of collection from right to left and invokes iteratee for each element. + * + * @template T + * @param {ArrayLike} collection - The collection to iterate over. + * @param {ListIterator} [iteratee] - The function invoked per iteration. + * @returns {ArrayLike} Returns collection. + * + * @example + * forEachRight({ 0: 'a', 1: 'b', length: 2 }, value => console.log(value)); + * // => Logs 'b' then 'a'. + */ +declare function forEachRight(collection: ArrayLike, iteratee?: ListIterator): ArrayLike; +/** + * Iterates over own enumerable string keyed properties of an object from right to left and invokes iteratee for each property. + * + * @template T + * @param {T} collection - The object to iterate over. + * @param {ObjectIterator} [iteratee] - The function invoked per iteration. + * @returns {T} Returns object. + * + * @example + * forEachRight({ a: 1, b: 2 }, (value, key) => console.log(key)); + * // => Logs 'b' then 'a'. + */ +declare function forEachRight(collection: T, iteratee?: ObjectIterator): T; +/** + * Iterates over elements of array from right to left and invokes iteratee for each element. + * + * @template T, U + * @param {U & (T[] | null | undefined)} collection - The array to iterate over. + * @param {ArrayIterator} [iteratee] - The function invoked per iteration. + * @returns {U} Returns the array. + * + * @example + * forEachRight([1, 2], value => console.log(value)); + * // => Logs `2` then `1`. + */ +declare function forEachRight(collection: U & (T[] | null | undefined), iteratee?: ArrayIterator): U; +/** + * Iterates over characters of string from right to left and invokes iteratee for each character. + * + * @template T + * @param {T} collection - The string to iterate over. + * @param {StringIterator} [iteratee] - The function invoked per iteration. + * @returns {T} Returns the string. + * + * @example + * forEachRight('abc', char => console.log(char)); + * // => Logs 'c', 'b', then 'a'. + */ +declare function forEachRight(collection: T, iteratee?: StringIterator): T; +/** + * Iterates over elements of collection from right to left and invokes iteratee for each element. + * + * @template T, L + * @param {L & (ArrayLike | null | undefined)} collection - The collection to iterate over. + * @param {ListIterator} [iteratee] - The function invoked per iteration. + * @returns {L} Returns the collection. + * + * @example + * forEachRight({ 0: 'a', 1: 'b', length: 2 }, value => console.log(value)); + * // => Logs 'b' then 'a'. + */ +declare function forEachRight | null | undefined>(collection: L & (ArrayLike | null | undefined), iteratee?: ListIterator): L; +/** + * Iterates over own enumerable string keyed properties of an object from right to left and invokes iteratee for each property. + * + * @template T + * @param {T | null | undefined} collection - The object to iterate over. + * @param {ObjectIterator} [iteratee] - The function invoked per iteration. + * @returns {T | null | undefined} Returns the object. + * + * @example + * forEachRight({ a: 1, b: 2 }, (value, key) => console.log(key)); + * // => Logs 'b' then 'a'. + */ +declare function forEachRight(collection: T | null | undefined, iteratee?: ObjectIterator): T | null | undefined; +//#endregion +export { forEachRight }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/forEachRight.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/forEachRight.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..319c5971a211c49615c292fd9a82de5dfadd5a40 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/forEachRight.d.ts @@ -0,0 +1,111 @@ +import { ArrayIterator } from "../_internal/ArrayIterator.js"; +import { ListIterator } from "../_internal/ListIterator.js"; +import { ObjectIterator } from "../_internal/ObjectIterator.js"; +import { StringIterator } from "../_internal/StringIterator.js"; + +//#region src/compat/array/forEachRight.d.ts +/** + * Iterates over elements of array from right to left and invokes iteratee for each element. + * + * @template T + * @param {T[]} collection - The array to iterate over. + * @param {ArrayIterator} [iteratee] - The function invoked per iteration. + * @returns {T[]} Returns array. + * + * @example + * forEachRight([1, 2], value => console.log(value)); + * // => Logs `2` then `1`. + */ +declare function forEachRight(collection: T[], iteratee?: ArrayIterator): T[]; +/** + * Iterates over characters of string from right to left and invokes iteratee for each character. + * + * @param {string} collection - The string to iterate over. + * @param {StringIterator} [iteratee] - The function invoked per iteration. + * @returns {string} Returns string. + * + * @example + * forEachRight('abc', char => console.log(char)); + * // => Logs 'c', 'b', then 'a'. + */ +declare function forEachRight(collection: string, iteratee?: StringIterator): string; +/** + * Iterates over elements of collection from right to left and invokes iteratee for each element. + * + * @template T + * @param {ArrayLike} collection - The collection to iterate over. + * @param {ListIterator} [iteratee] - The function invoked per iteration. + * @returns {ArrayLike} Returns collection. + * + * @example + * forEachRight({ 0: 'a', 1: 'b', length: 2 }, value => console.log(value)); + * // => Logs 'b' then 'a'. + */ +declare function forEachRight(collection: ArrayLike, iteratee?: ListIterator): ArrayLike; +/** + * Iterates over own enumerable string keyed properties of an object from right to left and invokes iteratee for each property. + * + * @template T + * @param {T} collection - The object to iterate over. + * @param {ObjectIterator} [iteratee] - The function invoked per iteration. + * @returns {T} Returns object. + * + * @example + * forEachRight({ a: 1, b: 2 }, (value, key) => console.log(key)); + * // => Logs 'b' then 'a'. + */ +declare function forEachRight(collection: T, iteratee?: ObjectIterator): T; +/** + * Iterates over elements of array from right to left and invokes iteratee for each element. + * + * @template T, U + * @param {U & (T[] | null | undefined)} collection - The array to iterate over. + * @param {ArrayIterator} [iteratee] - The function invoked per iteration. + * @returns {U} Returns the array. + * + * @example + * forEachRight([1, 2], value => console.log(value)); + * // => Logs `2` then `1`. + */ +declare function forEachRight(collection: U & (T[] | null | undefined), iteratee?: ArrayIterator): U; +/** + * Iterates over characters of string from right to left and invokes iteratee for each character. + * + * @template T + * @param {T} collection - The string to iterate over. + * @param {StringIterator} [iteratee] - The function invoked per iteration. + * @returns {T} Returns the string. + * + * @example + * forEachRight('abc', char => console.log(char)); + * // => Logs 'c', 'b', then 'a'. + */ +declare function forEachRight(collection: T, iteratee?: StringIterator): T; +/** + * Iterates over elements of collection from right to left and invokes iteratee for each element. + * + * @template T, L + * @param {L & (ArrayLike | null | undefined)} collection - The collection to iterate over. + * @param {ListIterator} [iteratee] - The function invoked per iteration. + * @returns {L} Returns the collection. + * + * @example + * forEachRight({ 0: 'a', 1: 'b', length: 2 }, value => console.log(value)); + * // => Logs 'b' then 'a'. + */ +declare function forEachRight | null | undefined>(collection: L & (ArrayLike | null | undefined), iteratee?: ListIterator): L; +/** + * Iterates over own enumerable string keyed properties of an object from right to left and invokes iteratee for each property. + * + * @template T + * @param {T | null | undefined} collection - The object to iterate over. + * @param {ObjectIterator} [iteratee] - The function invoked per iteration. + * @returns {T | null | undefined} Returns the object. + * + * @example + * forEachRight({ a: 1, b: 2 }, (value, key) => console.log(key)); + * // => Logs 'b' then 'a'. + */ +declare function forEachRight(collection: T | null | undefined, iteratee?: ObjectIterator): T | null | undefined; +//#endregion +export { forEachRight }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/forEachRight.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/forEachRight.js new file mode 100644 index 0000000000000000000000000000000000000000..21096b9ef8ec9b75eafe710fbe39e04e3b421c81 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/forEachRight.js @@ -0,0 +1,34 @@ +const require_identity = require("../../function/identity.js"); +const require_range = require("../../math/range.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +//#region src/compat/array/forEachRight.ts +/** +* Iterates over elements of 'array' from right to left and invokes 'callback' for each element. +* +* @template T - The type of object. +* @param {T} object - The object to iterate over. +* @param {(value: T[keyof T], key: keyof T, object: T) => unknown} [callback] - The function invoked for each property. +* The callback function receives three arguments: +* - 'value': The current property being processed in the object. +* - 'key': The key of the current property being processed in the object. +* - 'object': The object 'forEachRight' was called upon. +* @returns {T} Returns the original object. +* +* @example +* forEachRight({'a': 1, 'b': 2 }, (value, key, object) => console.log(value, key)); +* // Output: +* // 2 'b' +* // 1 'a' +*/ +function forEachRight(collection, callback = require_identity.identity) { + if (!collection) return collection; + const keys = require_isArrayLike.isArrayLike(collection) ? require_range.range(0, collection.length) : Object.keys(collection); + for (let i = keys.length - 1; i >= 0; i--) { + const key = keys[i]; + const value = collection[key]; + if (callback(value, key, collection) === false) break; + } + return collection; +} +//#endregion +exports.forEachRight = forEachRight; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/forEachRight.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/forEachRight.mjs new file mode 100644 index 0000000000000000000000000000000000000000..896e9a553e382c98438a92a495faee4173334259 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/forEachRight.mjs @@ -0,0 +1,34 @@ +import { identity } from "../../function/identity.mjs"; +import { range } from "../../math/range.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +//#region src/compat/array/forEachRight.ts +/** +* Iterates over elements of 'array' from right to left and invokes 'callback' for each element. +* +* @template T - The type of object. +* @param {T} object - The object to iterate over. +* @param {(value: T[keyof T], key: keyof T, object: T) => unknown} [callback] - The function invoked for each property. +* The callback function receives three arguments: +* - 'value': The current property being processed in the object. +* - 'key': The key of the current property being processed in the object. +* - 'object': The object 'forEachRight' was called upon. +* @returns {T} Returns the original object. +* +* @example +* forEachRight({'a': 1, 'b': 2 }, (value, key, object) => console.log(value, key)); +* // Output: +* // 2 'b' +* // 1 'a' +*/ +function forEachRight(collection, callback = identity) { + if (!collection) return collection; + const keys = isArrayLike(collection) ? range(0, collection.length) : Object.keys(collection); + for (let i = keys.length - 1; i >= 0; i--) { + const key = keys[i]; + const value = collection[key]; + if (callback(value, key, collection) === false) break; + } + return collection; +} +//#endregion +export { forEachRight }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/groupBy.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/groupBy.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..d6c92d448943fd46c045a0d93a37d2d2af0cab99 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/groupBy.d.mts @@ -0,0 +1,36 @@ +import { ValueIteratee } from "../_internal/ValueIteratee.mjs"; + +//#region src/compat/array/groupBy.d.ts +/** + * Creates an object composed of keys generated from the results of running each element of collection through iteratee. + * The order of grouped values is determined by the order they occur in collection. + * + * @template T - The type of elements in the array-like collection + * @param {ArrayLike | null | undefined} collection - The collection to iterate over + * @param {ValueIteratee} [iteratee=identity] - The iteratee to transform keys + * @returns {Record} Returns the composed aggregate object + * + * @example + * groupBy([6.1, 4.2, 6.3], Math.floor) + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * groupBy(['one', 'two', 'three'], 'length') + * // => { '3': ['one', 'two'], '5': ['three'] } + */ +declare function groupBy(collection: ArrayLike | null | undefined, iteratee?: ValueIteratee): Record; +/** + * Creates an object composed of keys generated from the results of running each element of collection through iteratee. + * The order of grouped values is determined by the order they occur in collection. + * + * @template T - The type of the object + * @param {T | null | undefined} collection - The object to iterate over + * @param {ValueIteratee} [iteratee=identity] - The iteratee to transform keys + * @returns {Record>} Returns the composed aggregate object + * + * @example + * groupBy({ a: 6.1, b: 4.2, c: 6.3 }, Math.floor) + * // => { '4': [4.2], '6': [6.1, 6.3] } + */ +declare function groupBy(collection: T | null | undefined, iteratee?: ValueIteratee): Record>; +//#endregion +export { groupBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/groupBy.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/groupBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..67c018cb2418e67575c0dde2686bb8e8cb5d27be --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/groupBy.d.ts @@ -0,0 +1,36 @@ +import { ValueIteratee } from "../_internal/ValueIteratee.js"; + +//#region src/compat/array/groupBy.d.ts +/** + * Creates an object composed of keys generated from the results of running each element of collection through iteratee. + * The order of grouped values is determined by the order they occur in collection. + * + * @template T - The type of elements in the array-like collection + * @param {ArrayLike | null | undefined} collection - The collection to iterate over + * @param {ValueIteratee} [iteratee=identity] - The iteratee to transform keys + * @returns {Record} Returns the composed aggregate object + * + * @example + * groupBy([6.1, 4.2, 6.3], Math.floor) + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * groupBy(['one', 'two', 'three'], 'length') + * // => { '3': ['one', 'two'], '5': ['three'] } + */ +declare function groupBy(collection: ArrayLike | null | undefined, iteratee?: ValueIteratee): Record; +/** + * Creates an object composed of keys generated from the results of running each element of collection through iteratee. + * The order of grouped values is determined by the order they occur in collection. + * + * @template T - The type of the object + * @param {T | null | undefined} collection - The object to iterate over + * @param {ValueIteratee} [iteratee=identity] - The iteratee to transform keys + * @returns {Record>} Returns the composed aggregate object + * + * @example + * groupBy({ a: 6.1, b: 4.2, c: 6.3 }, Math.floor) + * // => { '4': [4.2], '6': [6.1, 6.3] } + */ +declare function groupBy(collection: T | null | undefined, iteratee?: ValueIteratee): Record>; +//#endregion +export { groupBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/groupBy.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/groupBy.js new file mode 100644 index 0000000000000000000000000000000000000000..a9d0bf7984382b74e3b5006c845adc497b27ad63 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/groupBy.js @@ -0,0 +1,43 @@ +const require_groupBy = require("../../array/groupBy.js"); +const require_identity = require("../../function/identity.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +const require_iteratee = require("../util/iteratee.js"); +//#region src/compat/array/groupBy.ts +/** +* Groups the elements of an array or object based on a provided key-generating function. +* +* This function takes an array or object and a function that generates a key from each element or value. +* It returns an object where the keys are the generated keys and the values are arrays of elements that +* share the same key. +* +* @template T - The type of elements in the array or values in the object. +* @template K - The type of keys. +* @param {ArrayLike | Record | null | undefined} source - The collection to group. +* @param {Function | PropertyKey | Array | Object} [_getKeyFromItem] - The iteratee to transform keys. +* - If a function is provided, it's invoked for each element in the collection. +* - If a property name (string) is provided, that property of each element is used as the key. +* - If a property-value pair (array) is provided, elements with matching property values are used. +* - If a partial object is provided, elements with matching properties are used. +* @returns {Record} An object where each key is associated with an array of elements that +* share that key. +* +* @example +* // Using an array +* const array = [6.1, 4.2, 6.3]; +* const result = groupBy(array, Math.floor); +* // => { 4: [4.2], 6: [6.1, 6.3] } +* +* @example +* // Using a property name +* const array = ['one', 'two', 'three']; +* const result = groupBy(array, 'length'); +* // => { 3: ['one', 'two'], 5: ['three'] } +*/ +function groupBy(source, _getKeyFromItem) { + if (source == null) return {}; + const items = require_isArrayLike.isArrayLike(source) ? Array.from(source) : Object.values(source); + const getKeyFromItem = require_iteratee.iteratee(_getKeyFromItem ?? require_identity.identity); + return require_groupBy.groupBy(items, getKeyFromItem); +} +//#endregion +exports.groupBy = groupBy; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/groupBy.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/groupBy.mjs new file mode 100644 index 0000000000000000000000000000000000000000..912c1706625eb3126cbe5574a71c80e560e40ce4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/groupBy.mjs @@ -0,0 +1,41 @@ +import { groupBy as groupBy$1 } from "../../array/groupBy.mjs"; +import { identity } from "../../function/identity.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +import { iteratee } from "../util/iteratee.mjs"; +//#region src/compat/array/groupBy.ts +/** +* Groups the elements of an array or object based on a provided key-generating function. +* +* This function takes an array or object and a function that generates a key from each element or value. +* It returns an object where the keys are the generated keys and the values are arrays of elements that +* share the same key. +* +* @template T - The type of elements in the array or values in the object. +* @template K - The type of keys. +* @param {ArrayLike | Record | null | undefined} source - The collection to group. +* @param {Function | PropertyKey | Array | Object} [_getKeyFromItem] - The iteratee to transform keys. +* - If a function is provided, it's invoked for each element in the collection. +* - If a property name (string) is provided, that property of each element is used as the key. +* - If a property-value pair (array) is provided, elements with matching property values are used. +* - If a partial object is provided, elements with matching properties are used. +* @returns {Record} An object where each key is associated with an array of elements that +* share that key. +* +* @example +* // Using an array +* const array = [6.1, 4.2, 6.3]; +* const result = groupBy(array, Math.floor); +* // => { 4: [4.2], 6: [6.1, 6.3] } +* +* @example +* // Using a property name +* const array = ['one', 'two', 'three']; +* const result = groupBy(array, 'length'); +* // => { 3: ['one', 'two'], 5: ['three'] } +*/ +function groupBy(source, _getKeyFromItem) { + if (source == null) return {}; + return groupBy$1(isArrayLike(source) ? Array.from(source) : Object.values(source), iteratee(_getKeyFromItem ?? identity)); +} +//#endregion +export { groupBy }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/head.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/head.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..74c212968ee5846b4c14147a2d9fa32ea91403e7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/head.d.mts @@ -0,0 +1,33 @@ +//#region src/compat/array/head.d.ts +/** + * Returns the first element of an array or `undefined` if the array is empty. + * + * @template T - The type of elements in the array. + * @param {readonly [T, ...unknown[]]} array - A non-empty tuple with at least one element. + * @returns {T} The first element of the array. + * + * @example + * const arr = [1, 2, 3] as const; + * const first = head(arr); + * // first will be 1 + */ +declare function head(array: readonly [T, ...unknown[]]): T; +/** + * Returns the first element of an array or `undefined` if the array is empty. + * + * @template T - The type of elements in the array. + * @param {ArrayLike | null | undefined} array - The array from which to get the first element. + * @returns {T | undefined} The first element of the array, or `undefined` if the array is empty/null/undefined. + * + * @example + * const arr = [1, 2, 3]; + * const first = head(arr); + * // first will be 1 + * + * const emptyArr: number[] = []; + * const noElement = head(emptyArr); + * // noElement will be undefined + */ +declare function head(array: ArrayLike | null | undefined): T | undefined; +//#endregion +export { head }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/head.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/head.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..74c212968ee5846b4c14147a2d9fa32ea91403e7 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/head.d.ts @@ -0,0 +1,33 @@ +//#region src/compat/array/head.d.ts +/** + * Returns the first element of an array or `undefined` if the array is empty. + * + * @template T - The type of elements in the array. + * @param {readonly [T, ...unknown[]]} array - A non-empty tuple with at least one element. + * @returns {T} The first element of the array. + * + * @example + * const arr = [1, 2, 3] as const; + * const first = head(arr); + * // first will be 1 + */ +declare function head(array: readonly [T, ...unknown[]]): T; +/** + * Returns the first element of an array or `undefined` if the array is empty. + * + * @template T - The type of elements in the array. + * @param {ArrayLike | null | undefined} array - The array from which to get the first element. + * @returns {T | undefined} The first element of the array, or `undefined` if the array is empty/null/undefined. + * + * @example + * const arr = [1, 2, 3]; + * const first = head(arr); + * // first will be 1 + * + * const emptyArr: number[] = []; + * const noElement = head(emptyArr); + * // noElement will be undefined + */ +declare function head(array: ArrayLike | null | undefined): T | undefined; +//#endregion +export { head }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/head.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/head.js new file mode 100644 index 0000000000000000000000000000000000000000..398b477c4da9f9b17318d04c1261250b8c2522a6 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/head.js @@ -0,0 +1,25 @@ +const require_head = require("../../array/head.js"); +const require_toArray = require("../_internal/toArray.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +//#region src/compat/array/head.ts +/** +* Returns the first element of an array or `undefined` if the array is empty. +* +* This function takes an array and returns the first element of the array. +* If the array is empty, the function returns `undefined`. +* +* @template T - The type of elements in the array. +* @param {ArrayLike | undefined | null} arr - The array from which to get the first element. +* @returns {T | undefined} The first element of the array, or `undefined` if the array is empty. +* +* @example +* const emptyArr: number[] = []; +* const noElement = head(emptyArr); +* // noElement will be undefined +*/ +function head(arr) { + if (!require_isArrayLike.isArrayLike(arr)) return; + return require_head.head(require_toArray.toArray(arr)); +} +//#endregion +exports.head = head; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/head.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/head.mjs new file mode 100644 index 0000000000000000000000000000000000000000..c76b0a0a7ffae4b92c61f50d7bc72c6262cf1e73 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/head.mjs @@ -0,0 +1,25 @@ +import { head as head$1 } from "../../array/head.mjs"; +import { toArray } from "../_internal/toArray.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +//#region src/compat/array/head.ts +/** +* Returns the first element of an array or `undefined` if the array is empty. +* +* This function takes an array and returns the first element of the array. +* If the array is empty, the function returns `undefined`. +* +* @template T - The type of elements in the array. +* @param {ArrayLike | undefined | null} arr - The array from which to get the first element. +* @returns {T | undefined} The first element of the array, or `undefined` if the array is empty. +* +* @example +* const emptyArr: number[] = []; +* const noElement = head(emptyArr); +* // noElement will be undefined +*/ +function head(arr) { + if (!isArrayLike(arr)) return; + return head$1(toArray(arr)); +} +//#endregion +export { head }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/includes.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/includes.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..aa218e098830171699dca6fb8035412142b97090 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/includes.d.mts @@ -0,0 +1,23 @@ +//#region src/compat/array/includes.d.ts +/** + * Checks if a specified value exists within a given array-like collection. + * + * The comparison uses SameValueZero to check for inclusion. + * + * @template T The type of elements in the collection + * @param collection The array-like collection to search in + * @param target The value to search for in the collection + * @param [fromIndex=0] The index to start searching from. If negative, it is treated as an offset from the end + * @returns `true` if the value is found in the collection, `false` otherwise + * + * @example + * includes([1, 2, 3], 2); // true + * includes([1, 2, 3], 4); // false + * includes('hello', 'e'); // true + * includes(null, 1); // false + * includes([1, 2, 3], 2, 2); // false + * includes([1, 2, 3], 2, -2); // true + */ +declare function includes(collection: Record | Record | null | undefined, target: T, fromIndex?: number): boolean; +//#endregion +export { includes }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/includes.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/includes.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aa218e098830171699dca6fb8035412142b97090 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/includes.d.ts @@ -0,0 +1,23 @@ +//#region src/compat/array/includes.d.ts +/** + * Checks if a specified value exists within a given array-like collection. + * + * The comparison uses SameValueZero to check for inclusion. + * + * @template T The type of elements in the collection + * @param collection The array-like collection to search in + * @param target The value to search for in the collection + * @param [fromIndex=0] The index to start searching from. If negative, it is treated as an offset from the end + * @returns `true` if the value is found in the collection, `false` otherwise + * + * @example + * includes([1, 2, 3], 2); // true + * includes([1, 2, 3], 4); // false + * includes('hello', 'e'); // true + * includes(null, 1); // false + * includes([1, 2, 3], 2, 2); // false + * includes([1, 2, 3], 2, -2); // true + */ +declare function includes(collection: Record | Record | null | undefined, target: T, fromIndex?: number): boolean; +//#endregion +export { includes }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/includes.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/includes.js new file mode 100644 index 0000000000000000000000000000000000000000..77007816e1966a54ed68a090b30829542f565f89 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/includes.js @@ -0,0 +1,41 @@ +const require_toInteger = require("../util/toInteger.js"); +const require_isEqualsSameValueZero = require("../../_internal/isEqualsSameValueZero.js"); +require("../util/eq.js"); +const require_isString = require("../predicate/isString.js"); +//#region src/compat/array/includes.ts +/** +* Checks if a specified value exists within a given source, which can be an array, an object, or a string. +* +* The comparison uses SameValueZero to check for inclusion. +* +* @param {T[] | Record | string} source - The source to search in. It can be an array, an object, or a string. +* @param {T} [target] - The value to search for in the source. +* @param {number} [fromIndex=0] - The index to start searching from. If negative, it is treated as an offset from the end of the source. +* @returns {boolean} `true` if the value is found in the source, `false` otherwise. +* +* @example +* includes([1, 2, 3], 2); // true +* includes({ a: 1, b: 'a', c: NaN }, 'a'); // true +* includes('hello world', 'world'); // true +* includes('hello world', 'test'); // false +*/ +function includes(source, target, fromIndex, guard) { + if (source == null) return false; + if (guard || !fromIndex) fromIndex = 0; + else fromIndex = require_toInteger.toInteger(fromIndex); + if (require_isString.isString(source)) { + if (fromIndex > source.length || target instanceof RegExp) return false; + if (fromIndex < 0) fromIndex = Math.max(0, source.length + fromIndex); + return source.includes(target, fromIndex); + } + if (Array.isArray(source)) return source.includes(target, fromIndex); + const keys = Object.keys(source); + if (fromIndex < 0) fromIndex = Math.max(0, keys.length + fromIndex); + for (let i = fromIndex; i < keys.length; i++) { + const value = Reflect.get(source, keys[i]); + if (require_isEqualsSameValueZero.isEqualsSameValueZero(value, target)) return true; + } + return false; +} +//#endregion +exports.includes = includes; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/includes.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/includes.mjs new file mode 100644 index 0000000000000000000000000000000000000000..3f0d92063f7a4337605834f8e9dad53c7dd3a35f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/includes.mjs @@ -0,0 +1,38 @@ +import { toInteger } from "../util/toInteger.mjs"; +import { isEqualsSameValueZero } from "../../_internal/isEqualsSameValueZero.mjs"; +import "../util/eq.mjs"; +import { isString } from "../predicate/isString.mjs"; +//#region src/compat/array/includes.ts +/** +* Checks if a specified value exists within a given source, which can be an array, an object, or a string. +* +* The comparison uses SameValueZero to check for inclusion. +* +* @param {T[] | Record | string} source - The source to search in. It can be an array, an object, or a string. +* @param {T} [target] - The value to search for in the source. +* @param {number} [fromIndex=0] - The index to start searching from. If negative, it is treated as an offset from the end of the source. +* @returns {boolean} `true` if the value is found in the source, `false` otherwise. +* +* @example +* includes([1, 2, 3], 2); // true +* includes({ a: 1, b: 'a', c: NaN }, 'a'); // true +* includes('hello world', 'world'); // true +* includes('hello world', 'test'); // false +*/ +function includes(source, target, fromIndex, guard) { + if (source == null) return false; + if (guard || !fromIndex) fromIndex = 0; + else fromIndex = toInteger(fromIndex); + if (isString(source)) { + if (fromIndex > source.length || target instanceof RegExp) return false; + if (fromIndex < 0) fromIndex = Math.max(0, source.length + fromIndex); + return source.includes(target, fromIndex); + } + if (Array.isArray(source)) return source.includes(target, fromIndex); + const keys = Object.keys(source); + if (fromIndex < 0) fromIndex = Math.max(0, keys.length + fromIndex); + for (let i = fromIndex; i < keys.length; i++) if (isEqualsSameValueZero(Reflect.get(source, keys[i]), target)) return true; + return false; +} +//#endregion +export { includes }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/indexOf.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/indexOf.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..1ce25288b052f8b7ae5a3fb807990afaea41660e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/indexOf.d.mts @@ -0,0 +1,21 @@ +//#region src/compat/array/indexOf.d.ts +/** + * Finds the index of the first occurrence of a value in an array. + * + * This method is similar to `Array.prototype.indexOf`, but it also finds `NaN` values. + * It uses strict equality (`===`) to compare elements. + * + * @template T - The type of elements in the array. + * @param {ArrayLike | null | undefined} array - The array to search. + * @param {T} searchElement - The value to search for. + * @param {number} [fromIndex] - The index to start the search at. + * @returns {number} The index (zero-based) of the first occurrence of the value in the array, or `-1` if the value is not found. + * + * @example + * const array = [1, 2, 3, NaN]; + * indexOf(array, 3); // => 2 + * indexOf(array, NaN); // => 3 + */ +declare function indexOf(array: ArrayLike | null | undefined, searchElement: T, fromIndex?: number): number; +//#endregion +export { indexOf }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/indexOf.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/indexOf.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1ce25288b052f8b7ae5a3fb807990afaea41660e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/indexOf.d.ts @@ -0,0 +1,21 @@ +//#region src/compat/array/indexOf.d.ts +/** + * Finds the index of the first occurrence of a value in an array. + * + * This method is similar to `Array.prototype.indexOf`, but it also finds `NaN` values. + * It uses strict equality (`===`) to compare elements. + * + * @template T - The type of elements in the array. + * @param {ArrayLike | null | undefined} array - The array to search. + * @param {T} searchElement - The value to search for. + * @param {number} [fromIndex] - The index to start the search at. + * @returns {number} The index (zero-based) of the first occurrence of the value in the array, or `-1` if the value is not found. + * + * @example + * const array = [1, 2, 3, NaN]; + * indexOf(array, 3); // => 2 + * indexOf(array, NaN); // => 3 + */ +declare function indexOf(array: ArrayLike | null | undefined, searchElement: T, fromIndex?: number): number; +//#endregion +export { indexOf }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/indexOf.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/indexOf.js new file mode 100644 index 0000000000000000000000000000000000000000..8cc6ca1c0c66b0414ee57976f3f4d3e101d00761 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/indexOf.js @@ -0,0 +1,31 @@ +const require_isArrayLike = require("../predicate/isArrayLike.js"); +//#region src/compat/array/indexOf.ts +/** +* Finds the index of the first occurrence of a value in an array. +* +* This method is similar to `Array.prototype.indexOf`, but it also finds `NaN` values. +* It uses strict equality (`===`) to compare elements. +* +* @template T - The type of elements in the array. +* @param {ArrayLike | null | undefined} array - The array to search. +* @param {T} searchElement - The value to search for. +* @param {number} [fromIndex] - The index to start the search at. +* @returns {number} The index (zero-based) of the first occurrence of the value in the array, or `-1` if the value is not found. +* +* @example +* const array = [1, 2, 3, NaN]; +* indexOf(array, 3); // => 2 +* indexOf(array, NaN); // => 3 +*/ +function indexOf(array, searchElement, fromIndex) { + if (!require_isArrayLike.isArrayLike(array)) return -1; + if (Number.isNaN(searchElement)) { + fromIndex = fromIndex ?? 0; + if (fromIndex < 0) fromIndex = Math.max(0, array.length + fromIndex); + for (let i = fromIndex; i < array.length; i++) if (Number.isNaN(array[i])) return i; + return -1; + } + return Array.from(array).indexOf(searchElement, fromIndex); +} +//#endregion +exports.indexOf = indexOf; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/indexOf.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/indexOf.mjs new file mode 100644 index 0000000000000000000000000000000000000000..7b418ee8777e82ab8b7e8a3f7db50976784b3baa --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/indexOf.mjs @@ -0,0 +1,31 @@ +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +//#region src/compat/array/indexOf.ts +/** +* Finds the index of the first occurrence of a value in an array. +* +* This method is similar to `Array.prototype.indexOf`, but it also finds `NaN` values. +* It uses strict equality (`===`) to compare elements. +* +* @template T - The type of elements in the array. +* @param {ArrayLike | null | undefined} array - The array to search. +* @param {T} searchElement - The value to search for. +* @param {number} [fromIndex] - The index to start the search at. +* @returns {number} The index (zero-based) of the first occurrence of the value in the array, or `-1` if the value is not found. +* +* @example +* const array = [1, 2, 3, NaN]; +* indexOf(array, 3); // => 2 +* indexOf(array, NaN); // => 3 +*/ +function indexOf(array, searchElement, fromIndex) { + if (!isArrayLike(array)) return -1; + if (Number.isNaN(searchElement)) { + fromIndex = fromIndex ?? 0; + if (fromIndex < 0) fromIndex = Math.max(0, array.length + fromIndex); + for (let i = fromIndex; i < array.length; i++) if (Number.isNaN(array[i])) return i; + return -1; + } + return Array.from(array).indexOf(searchElement, fromIndex); +} +//#endregion +export { indexOf }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/initial.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/initial.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..19db68b26664f48a41a5f5bad788f16fcc367664 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/initial.d.mts @@ -0,0 +1,17 @@ +//#region src/compat/array/initial.d.ts +/** + * Returns a new array containing all elements except the last one from the input array. + * If the input array is empty or has only one element, the function returns an empty array. + * + * @template T The type of elements in the array. + * @param {ArrayLike | null | undefined} arr - The input array. + * @returns {T[]} A new array containing all but the last element of the input array. + * + * @example + * const arr = [1, 2, 3, 4]; + * const result = initial(arr); + * // result will be [1, 2, 3] + */ +declare function initial(arr: ArrayLike | null | undefined): T[]; +//#endregion +export { initial }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/initial.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/initial.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..19db68b26664f48a41a5f5bad788f16fcc367664 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/initial.d.ts @@ -0,0 +1,17 @@ +//#region src/compat/array/initial.d.ts +/** + * Returns a new array containing all elements except the last one from the input array. + * If the input array is empty or has only one element, the function returns an empty array. + * + * @template T The type of elements in the array. + * @param {ArrayLike | null | undefined} arr - The input array. + * @returns {T[]} A new array containing all but the last element of the input array. + * + * @example + * const arr = [1, 2, 3, 4]; + * const result = initial(arr); + * // result will be [1, 2, 3] + */ +declare function initial(arr: ArrayLike | null | undefined): T[]; +//#endregion +export { initial }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/initial.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/initial.js new file mode 100644 index 0000000000000000000000000000000000000000..2bc59655e812eff5e817393848adb7b8fa9612fa --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/initial.js @@ -0,0 +1,22 @@ +const require_initial = require("../../array/initial.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +//#region src/compat/array/initial.ts +/** +* Returns a new array containing all elements except the last one from the input array. +* If the input array is empty or has only one element, the function returns an empty array. +* +* @template T The type of elements in the array. +* @param {ArrayLike | null | undefined} arr - The input array. +* @returns {T[]} A new array containing all but the last element of the input array. +* +* @example +* const arr = [1, 2, 3, 4]; +* const result = initial(arr); +* // result will be [1, 2, 3] +*/ +function initial(arr) { + if (!require_isArrayLike.isArrayLike(arr)) return []; + return require_initial.initial(Array.from(arr)); +} +//#endregion +exports.initial = initial; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/initial.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/initial.mjs new file mode 100644 index 0000000000000000000000000000000000000000..4c410eb6b32a2605c630feef174ed4899c90db1d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/initial.mjs @@ -0,0 +1,22 @@ +import { initial as initial$1 } from "../../array/initial.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +//#region src/compat/array/initial.ts +/** +* Returns a new array containing all elements except the last one from the input array. +* If the input array is empty or has only one element, the function returns an empty array. +* +* @template T The type of elements in the array. +* @param {ArrayLike | null | undefined} arr - The input array. +* @returns {T[]} A new array containing all but the last element of the input array. +* +* @example +* const arr = [1, 2, 3, 4]; +* const result = initial(arr); +* // result will be [1, 2, 3] +*/ +function initial(arr) { + if (!isArrayLike(arr)) return []; + return initial$1(Array.from(arr)); +} +//#endregion +export { initial }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/intersection.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersection.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..3b093228e5d89f69648f1b319acfa71ee54c9891 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersection.d.mts @@ -0,0 +1,21 @@ +//#region src/compat/array/intersection.d.ts +/** + * Returns the intersection of multiple arrays. + * + * This function takes multiple arrays and returns a new array containing the elements that are + * present in all provided arrays. It effectively filters out any elements that are not found + * in every array. + * + * @template T - The type of elements in the arrays. + * @param {...(ArrayLike | null | undefined)} arrays - The arrays to compare. + * @returns {T[]} A new array containing the elements that are present in all arrays. + * + * @example + * const array1 = [1, 2, 3, 4, 5]; + * const array2 = [3, 4, 5, 6, 7]; + * const result = intersection(array1, array2); + * // result will be [3, 4, 5] since these elements are in both arrays. + */ +declare function intersection(...arrays: Array | null | undefined>): T[]; +//#endregion +export { intersection }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/intersection.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersection.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b093228e5d89f69648f1b319acfa71ee54c9891 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersection.d.ts @@ -0,0 +1,21 @@ +//#region src/compat/array/intersection.d.ts +/** + * Returns the intersection of multiple arrays. + * + * This function takes multiple arrays and returns a new array containing the elements that are + * present in all provided arrays. It effectively filters out any elements that are not found + * in every array. + * + * @template T - The type of elements in the arrays. + * @param {...(ArrayLike | null | undefined)} arrays - The arrays to compare. + * @returns {T[]} A new array containing the elements that are present in all arrays. + * + * @example + * const array1 = [1, 2, 3, 4, 5]; + * const array2 = [3, 4, 5, 6, 7]; + * const result = intersection(array1, array2); + * // result will be [3, 4, 5] since these elements are in both arrays. + */ +declare function intersection(...arrays: Array | null | undefined>): T[]; +//#endregion +export { intersection }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/intersection.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersection.js new file mode 100644 index 0000000000000000000000000000000000000000..a142affd59f4f2fd8fd9c605205c7c65db373f96 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersection.js @@ -0,0 +1,34 @@ +const require_intersection = require("../../array/intersection.js"); +const require_uniq = require("../../array/uniq.js"); +const require_isArrayLikeObject = require("../predicate/isArrayLikeObject.js"); +//#region src/compat/array/intersection.ts +/** +* Returns the intersection of multiple arrays. +* +* This function takes multiple arrays and returns a new array containing the elements that are +* present in all provided arrays. It effectively filters out any elements that are not found +* in every array. +* +* @template T - The type of elements in the arrays. +* @param {...(ArrayLike | null | undefined)} arrays - The arrays to compare. +* @returns {T[]} A new array containing the elements that are present in all arrays. +* +* @example +* const array1 = [1, 2, 3, 4, 5]; +* const array2 = [3, 4, 5, 6, 7]; +* const result = intersection(array1, array2); +* // result will be [3, 4, 5] since these elements are in both arrays. +*/ +function intersection(...arrays) { + if (arrays.length === 0) return []; + if (!require_isArrayLikeObject.isArrayLikeObject(arrays[0])) return []; + let result = require_uniq.uniq(Array.from(arrays[0])); + for (let i = 1; i < arrays.length; i++) { + const array = arrays[i]; + if (!require_isArrayLikeObject.isArrayLikeObject(array)) return []; + result = require_intersection.intersection(result, Array.from(array)); + } + return result; +} +//#endregion +exports.intersection = intersection; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/intersection.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersection.mjs new file mode 100644 index 0000000000000000000000000000000000000000..2d0f3345e33e305d50aadd9fa8ca0bf74e41b1c5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersection.mjs @@ -0,0 +1,34 @@ +import { intersection as intersection$1 } from "../../array/intersection.mjs"; +import { uniq } from "../../array/uniq.mjs"; +import { isArrayLikeObject } from "../predicate/isArrayLikeObject.mjs"; +//#region src/compat/array/intersection.ts +/** +* Returns the intersection of multiple arrays. +* +* This function takes multiple arrays and returns a new array containing the elements that are +* present in all provided arrays. It effectively filters out any elements that are not found +* in every array. +* +* @template T - The type of elements in the arrays. +* @param {...(ArrayLike | null | undefined)} arrays - The arrays to compare. +* @returns {T[]} A new array containing the elements that are present in all arrays. +* +* @example +* const array1 = [1, 2, 3, 4, 5]; +* const array2 = [3, 4, 5, 6, 7]; +* const result = intersection(array1, array2); +* // result will be [3, 4, 5] since these elements are in both arrays. +*/ +function intersection(...arrays) { + if (arrays.length === 0) return []; + if (!isArrayLikeObject(arrays[0])) return []; + let result = uniq(Array.from(arrays[0])); + for (let i = 1; i < arrays.length; i++) { + const array = arrays[i]; + if (!isArrayLikeObject(array)) return []; + result = intersection$1(result, Array.from(array)); + } + return result; +} +//#endregion +export { intersection }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionBy.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionBy.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..aac396c9d8472e8e8d81b1c913a5fbfe12f19707 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionBy.d.mts @@ -0,0 +1,74 @@ +import { ValueIteratee } from "../_internal/ValueIteratee.mjs"; + +//#region src/compat/array/intersectionBy.d.ts +/** + * Creates an array of unique values that are included in all given arrays, using an iteratee to compute equality. + * + * @template T, U + * @param {ArrayLike | null} array - The array to inspect. + * @param {ArrayLike} values - The values to compare. + * @param {ValueIteratee} iteratee - The iteratee invoked per element. + * @returns {T[]} Returns the new array of intersecting values. + * + * @example + * intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + */ +declare function intersectionBy(array: ArrayLike | null, values: ArrayLike, iteratee: ValueIteratee): T[]; +/** + * Creates an array of unique values that are included in all given arrays, using an iteratee to compute equality. + * + * @template T, U, V + * @param {ArrayLike | null} array - The array to inspect. + * @param {ArrayLike} values1 - The first values to compare. + * @param {ArrayLike} values2 - The second values to compare. + * @param {ValueIteratee} iteratee - The iteratee invoked per element. + * @returns {T[]} Returns the new array of intersecting values. + * + * @example + * intersectionBy([2.1, 1.2], [2.3, 3.4], [2.5], Math.floor); + * // => [2.1] + */ +declare function intersectionBy(array: ArrayLike | null, values1: ArrayLike, values2: ArrayLike, iteratee: ValueIteratee): T[]; +/** + * Creates an array of unique values that are included in all given arrays, using an iteratee to compute equality. + * + * @template T, U, V, W + * @param {ArrayLike | null | undefined} array - The array to inspect. + * @param {ArrayLike} values1 - The first values to compare. + * @param {ArrayLike} values2 - The second values to compare. + * @param {...Array | ValueIteratee>} values - The other arrays to compare, and the iteratee to use. + * @returns {T[]} Returns the new array of intersecting values. + * + * @example + * intersectionBy([2.1, 1.2], [2.3, 3.4], [2.5], [2.6, 1.7], Math.floor); + * // => [2.1] + */ +declare function intersectionBy(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, ...values: Array | ValueIteratee>): T[]; +/** + * Creates an array of unique values that are included in all given arrays. + * + * @template T + * @param {ArrayLike | null} [array] - The array to inspect. + * @param {...Array>} values - The values to compare. + * @returns {T[]} Returns the new array of intersecting values. + * + * @example + * intersectionBy([2, 1], [2, 3]); + * // => [2] + */ +declare function intersectionBy(array?: ArrayLike | null, ...values: Array>): T[]; +/** + * Creates an array of unique values that are included in all given arrays, using an iteratee to compute equality. + * + * @template T + * @param {...Array | ValueIteratee>} values - The arrays to compare and the iteratee to use. + * @returns {T[]} Returns the new array of intersecting values. + * + * @example + * intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + */ +declare function intersectionBy(...values: Array | ValueIteratee>): T[]; +//#endregion +export { intersectionBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionBy.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..87223752156d90b56e6aad2db0b429a9c9b275b5 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionBy.d.ts @@ -0,0 +1,74 @@ +import { ValueIteratee } from "../_internal/ValueIteratee.js"; + +//#region src/compat/array/intersectionBy.d.ts +/** + * Creates an array of unique values that are included in all given arrays, using an iteratee to compute equality. + * + * @template T, U + * @param {ArrayLike | null} array - The array to inspect. + * @param {ArrayLike} values - The values to compare. + * @param {ValueIteratee} iteratee - The iteratee invoked per element. + * @returns {T[]} Returns the new array of intersecting values. + * + * @example + * intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + */ +declare function intersectionBy(array: ArrayLike | null, values: ArrayLike, iteratee: ValueIteratee): T[]; +/** + * Creates an array of unique values that are included in all given arrays, using an iteratee to compute equality. + * + * @template T, U, V + * @param {ArrayLike | null} array - The array to inspect. + * @param {ArrayLike} values1 - The first values to compare. + * @param {ArrayLike} values2 - The second values to compare. + * @param {ValueIteratee} iteratee - The iteratee invoked per element. + * @returns {T[]} Returns the new array of intersecting values. + * + * @example + * intersectionBy([2.1, 1.2], [2.3, 3.4], [2.5], Math.floor); + * // => [2.1] + */ +declare function intersectionBy(array: ArrayLike | null, values1: ArrayLike, values2: ArrayLike, iteratee: ValueIteratee): T[]; +/** + * Creates an array of unique values that are included in all given arrays, using an iteratee to compute equality. + * + * @template T, U, V, W + * @param {ArrayLike | null | undefined} array - The array to inspect. + * @param {ArrayLike} values1 - The first values to compare. + * @param {ArrayLike} values2 - The second values to compare. + * @param {...Array | ValueIteratee>} values - The other arrays to compare, and the iteratee to use. + * @returns {T[]} Returns the new array of intersecting values. + * + * @example + * intersectionBy([2.1, 1.2], [2.3, 3.4], [2.5], [2.6, 1.7], Math.floor); + * // => [2.1] + */ +declare function intersectionBy(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, ...values: Array | ValueIteratee>): T[]; +/** + * Creates an array of unique values that are included in all given arrays. + * + * @template T + * @param {ArrayLike | null} [array] - The array to inspect. + * @param {...Array>} values - The values to compare. + * @returns {T[]} Returns the new array of intersecting values. + * + * @example + * intersectionBy([2, 1], [2, 3]); + * // => [2] + */ +declare function intersectionBy(array?: ArrayLike | null, ...values: Array>): T[]; +/** + * Creates an array of unique values that are included in all given arrays, using an iteratee to compute equality. + * + * @template T + * @param {...Array | ValueIteratee>} values - The arrays to compare and the iteratee to use. + * @returns {T[]} Returns the new array of intersecting values. + * + * @example + * intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + */ +declare function intersectionBy(...values: Array | ValueIteratee>): T[]; +//#endregion +export { intersectionBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionBy.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionBy.js new file mode 100644 index 0000000000000000000000000000000000000000..09ca0b71f64b36dc1cac6fd54b5cc5dcf49826fd --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionBy.js @@ -0,0 +1,52 @@ +const require_intersectionBy = require("../../array/intersectionBy.js"); +const require_last = require("../../array/last.js"); +const require_uniq = require("../../array/uniq.js"); +const require_identity = require("../../function/identity.js"); +const require_property = require("../object/property.js"); +const require_isArrayLikeObject = require("../predicate/isArrayLikeObject.js"); +//#region src/compat/array/intersectionBy.ts +/** +* Returns the intersection of multiple arrays after applying the iteratee function to their elements. +* +* This function takes multiple arrays and an optional iteratee function (or property key) +* to compare the elements after transforming them. It returns a new array containing the elements from +* the first array that are present in all subsequent arrays after applying the iteratee to each element. +* If no iteratee is provided, the identity function is used. +* +* If the first array is `null` or `undefined`, an empty array is returned. +* +* @template T +* @param {ArrayLike | null | undefined} array - The first array to compare. +* @param {...(ArrayLike | ((value: T) => unknown) | string)} values - The arrays to compare, or the iteratee function. +* @returns {T[]} A new array containing the elements from the first array that are present +* in all subsequent arrays after applying the iteratee. +* +* @example +* const array1 = [{ x: 1 }, { x: 2 }, { x: 3 }]; +* const array2 = [{ x: 2 }, { x: 3 }]; +* const result = intersectionBy(array1, array2, 'x'); +* // result will be [{ x: 2 }, { x: 3 }] since these elements have the same `x` property. +* +* @example +* const array1 = [1.1, 2.2, 3.3]; +* const array2 = [2.3, 3.3]; +* const result = intersectionBy(array1, array2, Math.floor); +* // result will be [2.3, 3.3] since it shares the same integer part when `Math.floor` is applied. +*/ +function intersectionBy(array, ...values) { + if (!require_isArrayLikeObject.isArrayLikeObject(array)) return []; + const lastValue = require_last.last(values); + if (lastValue === void 0) return Array.from(array); + let result = require_uniq.uniq(Array.from(array)); + const count = require_isArrayLikeObject.isArrayLikeObject(lastValue) ? values.length : values.length - 1; + for (let i = 0; i < count; ++i) { + const value = values[i]; + if (!require_isArrayLikeObject.isArrayLikeObject(value)) return []; + if (require_isArrayLikeObject.isArrayLikeObject(lastValue)) result = require_intersectionBy.intersectionBy(result, Array.from(value), require_identity.identity); + else if (typeof lastValue === "function") result = require_intersectionBy.intersectionBy(result, Array.from(value), (value) => lastValue(value)); + else if (typeof lastValue === "string") result = require_intersectionBy.intersectionBy(result, Array.from(value), require_property.property(lastValue)); + } + return result; +} +//#endregion +exports.intersectionBy = intersectionBy; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionBy.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionBy.mjs new file mode 100644 index 0000000000000000000000000000000000000000..b067f7cf7e43686c2394c9b4d3a8630384fdb70c --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionBy.mjs @@ -0,0 +1,52 @@ +import { intersectionBy as intersectionBy$1 } from "../../array/intersectionBy.mjs"; +import { last } from "../../array/last.mjs"; +import { uniq } from "../../array/uniq.mjs"; +import { identity } from "../../function/identity.mjs"; +import { property } from "../object/property.mjs"; +import { isArrayLikeObject } from "../predicate/isArrayLikeObject.mjs"; +//#region src/compat/array/intersectionBy.ts +/** +* Returns the intersection of multiple arrays after applying the iteratee function to their elements. +* +* This function takes multiple arrays and an optional iteratee function (or property key) +* to compare the elements after transforming them. It returns a new array containing the elements from +* the first array that are present in all subsequent arrays after applying the iteratee to each element. +* If no iteratee is provided, the identity function is used. +* +* If the first array is `null` or `undefined`, an empty array is returned. +* +* @template T +* @param {ArrayLike | null | undefined} array - The first array to compare. +* @param {...(ArrayLike | ((value: T) => unknown) | string)} values - The arrays to compare, or the iteratee function. +* @returns {T[]} A new array containing the elements from the first array that are present +* in all subsequent arrays after applying the iteratee. +* +* @example +* const array1 = [{ x: 1 }, { x: 2 }, { x: 3 }]; +* const array2 = [{ x: 2 }, { x: 3 }]; +* const result = intersectionBy(array1, array2, 'x'); +* // result will be [{ x: 2 }, { x: 3 }] since these elements have the same `x` property. +* +* @example +* const array1 = [1.1, 2.2, 3.3]; +* const array2 = [2.3, 3.3]; +* const result = intersectionBy(array1, array2, Math.floor); +* // result will be [2.3, 3.3] since it shares the same integer part when `Math.floor` is applied. +*/ +function intersectionBy(array, ...values) { + if (!isArrayLikeObject(array)) return []; + const lastValue = last(values); + if (lastValue === void 0) return Array.from(array); + let result = uniq(Array.from(array)); + const count = isArrayLikeObject(lastValue) ? values.length : values.length - 1; + for (let i = 0; i < count; ++i) { + const value = values[i]; + if (!isArrayLikeObject(value)) return []; + if (isArrayLikeObject(lastValue)) result = intersectionBy$1(result, Array.from(value), identity); + else if (typeof lastValue === "function") result = intersectionBy$1(result, Array.from(value), (value) => lastValue(value)); + else if (typeof lastValue === "string") result = intersectionBy$1(result, Array.from(value), property(lastValue)); + } + return result; +} +//#endregion +export { intersectionBy }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionWith.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionWith.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..97dfe752b0fc1c790a4d4b547851e57a975ba0d0 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionWith.d.mts @@ -0,0 +1,69 @@ +//#region src/compat/array/intersectionWith.d.ts +/** + * Creates an array of unique values that are included in all given arrays, using a comparator function for equality comparisons. + * + * @template T, U + * @param {ArrayLike | null | undefined} array - The array to inspect. + * @param {ArrayLike} values - The values to compare. + * @param {(a: T, b: T | U) => boolean} comparator - The comparator invoked per element. + * @returns {T[]} Returns the new array of intersecting values. + * + * @example + * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * const others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * intersectionWith(objects, others, (a, b) => a.x === b.x && a.y === b.y); + * // => [{ 'x': 1, 'y': 2 }] + */ +declare function intersectionWith(array: ArrayLike | null | undefined, values: ArrayLike, comparator: (a: T, b: T | U) => boolean): T[]; +/** + * Creates an array of unique values that are included in all given arrays, using a comparator function for equality comparisons. + * + * @template T, U, V + * @param {ArrayLike | null | undefined} array - The array to inspect. + * @param {ArrayLike} values1 - The first values to compare. + * @param {ArrayLike} values2 - The second values to compare. + * @param {(a: T, b: T | U | V) => boolean} comparator - The comparator invoked per element. + * @returns {T[]} Returns the new array of intersecting values. + * + * @example + * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * const others1 = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * const others2 = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }]; + * intersectionWith(objects, others1, others2, (a, b) => a.x === b.x && a.y === b.y); + * // => [{ 'x': 1, 'y': 2 }] + */ +declare function intersectionWith(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, comparator: (a: T, b: T | U | V) => boolean): T[]; +/** + * Creates an array of unique values that are included in all given arrays, using a comparator function for equality comparisons. + * + * @template T, U, V, W + * @param {ArrayLike | null | undefined} array - The array to inspect. + * @param {ArrayLike} values1 - The first values to compare. + * @param {ArrayLike} values2 - The second values to compare. + * @param {...Array | (a: T, b: T | U | V | W) => boolean>} values - The other arrays to compare, and the comparator to use. + * @returns {T[]} Returns the new array of intersecting values. + * + * @example + * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * const others1 = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * const others2 = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }]; + * const others3 = [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]; + * intersectionWith(objects, others1, others2, others3, (a, b) => a.x === b.x && a.y === b.y); + * // => [{ 'x': 1, 'y': 2 }] + */ +declare function intersectionWith(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, ...values: Array | ((a: T, b: T | U | V | W) => boolean)>): T[]; +/** + * Creates an array of unique values that are included in all given arrays. + * + * @template T + * @param {ArrayLike | null} [array] - The array to inspect. + * @param {...Array | (a: T, b: never) => boolean>} values - The values to compare. + * @returns {T[]} Returns the new array of intersecting values. + * + * @example + * intersectionWith([2, 1], [2, 3]); + * // => [2] + */ +declare function intersectionWith(array?: ArrayLike | null, ...values: Array | ((a: T, b: never) => boolean)>): T[]; +//#endregion +export { intersectionWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionWith.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionWith.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..97dfe752b0fc1c790a4d4b547851e57a975ba0d0 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionWith.d.ts @@ -0,0 +1,69 @@ +//#region src/compat/array/intersectionWith.d.ts +/** + * Creates an array of unique values that are included in all given arrays, using a comparator function for equality comparisons. + * + * @template T, U + * @param {ArrayLike | null | undefined} array - The array to inspect. + * @param {ArrayLike} values - The values to compare. + * @param {(a: T, b: T | U) => boolean} comparator - The comparator invoked per element. + * @returns {T[]} Returns the new array of intersecting values. + * + * @example + * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * const others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * intersectionWith(objects, others, (a, b) => a.x === b.x && a.y === b.y); + * // => [{ 'x': 1, 'y': 2 }] + */ +declare function intersectionWith(array: ArrayLike | null | undefined, values: ArrayLike, comparator: (a: T, b: T | U) => boolean): T[]; +/** + * Creates an array of unique values that are included in all given arrays, using a comparator function for equality comparisons. + * + * @template T, U, V + * @param {ArrayLike | null | undefined} array - The array to inspect. + * @param {ArrayLike} values1 - The first values to compare. + * @param {ArrayLike} values2 - The second values to compare. + * @param {(a: T, b: T | U | V) => boolean} comparator - The comparator invoked per element. + * @returns {T[]} Returns the new array of intersecting values. + * + * @example + * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * const others1 = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * const others2 = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }]; + * intersectionWith(objects, others1, others2, (a, b) => a.x === b.x && a.y === b.y); + * // => [{ 'x': 1, 'y': 2 }] + */ +declare function intersectionWith(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, comparator: (a: T, b: T | U | V) => boolean): T[]; +/** + * Creates an array of unique values that are included in all given arrays, using a comparator function for equality comparisons. + * + * @template T, U, V, W + * @param {ArrayLike | null | undefined} array - The array to inspect. + * @param {ArrayLike} values1 - The first values to compare. + * @param {ArrayLike} values2 - The second values to compare. + * @param {...Array | (a: T, b: T | U | V | W) => boolean>} values - The other arrays to compare, and the comparator to use. + * @returns {T[]} Returns the new array of intersecting values. + * + * @example + * const objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * const others1 = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * const others2 = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }]; + * const others3 = [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]; + * intersectionWith(objects, others1, others2, others3, (a, b) => a.x === b.x && a.y === b.y); + * // => [{ 'x': 1, 'y': 2 }] + */ +declare function intersectionWith(array: ArrayLike | null | undefined, values1: ArrayLike, values2: ArrayLike, ...values: Array | ((a: T, b: T | U | V | W) => boolean)>): T[]; +/** + * Creates an array of unique values that are included in all given arrays. + * + * @template T + * @param {ArrayLike | null} [array] - The array to inspect. + * @param {...Array | (a: T, b: never) => boolean>} values - The values to compare. + * @returns {T[]} Returns the new array of intersecting values. + * + * @example + * intersectionWith([2, 1], [2, 3]); + * // => [2] + */ +declare function intersectionWith(array?: ArrayLike | null, ...values: Array | ((a: T, b: never) => boolean)>): T[]; +//#endregion +export { intersectionWith }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionWith.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionWith.js new file mode 100644 index 0000000000000000000000000000000000000000..0f0f2629e5d98e83a321c48397d6d520b55386bf --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionWith.js @@ -0,0 +1,54 @@ +const require_intersectionWith = require("../../array/intersectionWith.js"); +const require_isEqualsSameValueZero = require("../../_internal/isEqualsSameValueZero.js"); +require("../util/eq.js"); +const require_last = require("./last.js"); +const require_uniq = require("./uniq.js"); +//#region src/compat/array/intersectionWith.ts +/** +* Returns the intersection of multiple arrays based on a custom equality function. +* +* @template T - The type of elements in the arrays +* @param {ArrayLike | null | undefined} firstArr - The first array to compare +* @param {...(ArrayLike | null | undefined | ((x: T, y: T) => boolean))} otherArrs - Additional arrays and optional equality function +* @returns {T[]} Elements from first array that match in all arrays +* +* @example +* const arr1 = [{id: 1}, {id: 2}]; +* const arr2 = [{id: 2}, {id: 3}]; +* const result = intersectionWith(arr1, arr2, (a, b) => a.id === b.id); +* // result is [{id: 2}] +*/ +function intersectionWith(firstArr, ...otherArrs) { + if (firstArr == null) return []; + const _comparator = require_last.last(otherArrs); + let comparator = require_isEqualsSameValueZero.isEqualsSameValueZero; + let uniq$1 = require_uniq.uniq; + if (typeof _comparator === "function") { + comparator = _comparator; + uniq$1 = uniqPreserve0; + otherArrs.pop(); + } + let result = uniq$1(Array.from(firstArr)); + for (let i = 0; i < otherArrs.length; ++i) { + const otherArr = otherArrs[i]; + if (otherArr == null) return []; + result = require_intersectionWith.intersectionWith(result, Array.from(otherArr), comparator); + } + return result; +} +/** +* This function is to preserve the sign of `-0`, which is a behavior in lodash. +*/ +function uniqPreserve0(arr) { + const result = []; + const added = /* @__PURE__ */ new Set(); + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + if (added.has(item)) continue; + result.push(item); + added.add(item); + } + return result; +} +//#endregion +exports.intersectionWith = intersectionWith; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionWith.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionWith.mjs new file mode 100644 index 0000000000000000000000000000000000000000..cb795904059ffa23791917af45ca2774a817a962 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/intersectionWith.mjs @@ -0,0 +1,54 @@ +import { intersectionWith as intersectionWith$1 } from "../../array/intersectionWith.mjs"; +import { isEqualsSameValueZero } from "../../_internal/isEqualsSameValueZero.mjs"; +import "../util/eq.mjs"; +import { last } from "./last.mjs"; +import { uniq } from "./uniq.mjs"; +//#region src/compat/array/intersectionWith.ts +/** +* Returns the intersection of multiple arrays based on a custom equality function. +* +* @template T - The type of elements in the arrays +* @param {ArrayLike | null | undefined} firstArr - The first array to compare +* @param {...(ArrayLike | null | undefined | ((x: T, y: T) => boolean))} otherArrs - Additional arrays and optional equality function +* @returns {T[]} Elements from first array that match in all arrays +* +* @example +* const arr1 = [{id: 1}, {id: 2}]; +* const arr2 = [{id: 2}, {id: 3}]; +* const result = intersectionWith(arr1, arr2, (a, b) => a.id === b.id); +* // result is [{id: 2}] +*/ +function intersectionWith(firstArr, ...otherArrs) { + if (firstArr == null) return []; + const _comparator = last(otherArrs); + let comparator = isEqualsSameValueZero; + let uniq$1 = uniq; + if (typeof _comparator === "function") { + comparator = _comparator; + uniq$1 = uniqPreserve0; + otherArrs.pop(); + } + let result = uniq$1(Array.from(firstArr)); + for (let i = 0; i < otherArrs.length; ++i) { + const otherArr = otherArrs[i]; + if (otherArr == null) return []; + result = intersectionWith$1(result, Array.from(otherArr), comparator); + } + return result; +} +/** +* This function is to preserve the sign of `-0`, which is a behavior in lodash. +*/ +function uniqPreserve0(arr) { + const result = []; + const added = /* @__PURE__ */ new Set(); + for (let i = 0; i < arr.length; i++) { + const item = arr[i]; + if (added.has(item)) continue; + result.push(item); + added.add(item); + } + return result; +} +//#endregion +export { intersectionWith }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/invokeMap.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/invokeMap.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..ea3c13f44db5eeac15bc1fb17d58f596798e3d52 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/invokeMap.d.mts @@ -0,0 +1,33 @@ +//#region src/compat/array/invokeMap.d.ts +/** + * Invokes the method at path of each element in collection. + * + * @param {object | null | undefined} collection - The collection to iterate over. + * @param {string} methodName - The name of the method to invoke. + * @param {...any[]} args - The arguments to invoke each method with. + * @returns {any[]} Returns the array of results. + * + * @example + * invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * invokeMap([123, 456], 'toString', 2); + * // => ['1111011', '111001000'] + */ +declare function invokeMap(collection: object | null | undefined, methodName: string, ...args: any[]): any[]; +/** + * Invokes the method at path of each element in collection. + * + * @template R + * @param {object | null | undefined} collection - The collection to iterate over. + * @param {(...args: any[]) => R} method - The method to invoke. + * @param {...any[]} args - The arguments to invoke each method with. + * @returns {R[]} Returns the array of results. + * + * @example + * invokeMap([5, 1, 7], Array.prototype.slice, 1); + * // => [[], [], []] + */ +declare function invokeMap(collection: object | null | undefined, method: (...args: any[]) => R, ...args: any[]): R[]; +//#endregion +export { invokeMap }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/invokeMap.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/invokeMap.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ea3c13f44db5eeac15bc1fb17d58f596798e3d52 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/invokeMap.d.ts @@ -0,0 +1,33 @@ +//#region src/compat/array/invokeMap.d.ts +/** + * Invokes the method at path of each element in collection. + * + * @param {object | null | undefined} collection - The collection to iterate over. + * @param {string} methodName - The name of the method to invoke. + * @param {...any[]} args - The arguments to invoke each method with. + * @returns {any[]} Returns the array of results. + * + * @example + * invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * invokeMap([123, 456], 'toString', 2); + * // => ['1111011', '111001000'] + */ +declare function invokeMap(collection: object | null | undefined, methodName: string, ...args: any[]): any[]; +/** + * Invokes the method at path of each element in collection. + * + * @template R + * @param {object | null | undefined} collection - The collection to iterate over. + * @param {(...args: any[]) => R} method - The method to invoke. + * @param {...any[]} args - The arguments to invoke each method with. + * @returns {R[]} Returns the array of results. + * + * @example + * invokeMap([5, 1, 7], Array.prototype.slice, 1); + * // => [[], [], []] + */ +declare function invokeMap(collection: object | null | undefined, method: (...args: any[]) => R, ...args: any[]): R[]; +//#endregion +export { invokeMap }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/invokeMap.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/invokeMap.js new file mode 100644 index 0000000000000000000000000000000000000000..5283a3f773ba58908cd5e7c181f10b7aeb75e85f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/invokeMap.js @@ -0,0 +1,44 @@ +const require_isFunction = require("../../predicate/isFunction.js"); +const require_isNil = require("../../predicate/isNil.js"); +require("../../predicate/index.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +const require_get = require("../object/get.js"); +//#region src/compat/array/invokeMap.ts +/** +* Invokes the method at path of each element in collection. +* +* @template T, R +* @param {ArrayLike | Record | null | undefined} collection - The collection to iterate over. +* @param {string | ((...args: any[]) => R)} path - The path of the method to invoke or the method to invoke. +* @param {...any[]} args - The arguments to invoke each method with. +* @returns {Array} Returns the array of results. +* +* @example +* invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); +* // => [[1, 5, 7], [1, 2, 3]] +*/ +function invokeMap(collection, path, ...args) { + if (require_isNil.isNil(collection)) return []; + const values = require_isArrayLike.isArrayLike(collection) ? Array.from(collection) : Object.values(collection); + const result = []; + for (let i = 0; i < values.length; i++) { + const value = values[i]; + if (require_isFunction.isFunction(path)) { + result.push(path.apply(value, args)); + continue; + } + const method = require_get.get(value, path); + let thisContext = value; + if (Array.isArray(path)) { + const pathExceptLast = path.slice(0, -1); + if (pathExceptLast.length > 0) thisContext = require_get.get(value, pathExceptLast); + } else if (typeof path === "string" && path.includes(".")) { + const pathExceptLast = path.split(".").slice(0, -1).join("."); + thisContext = require_get.get(value, pathExceptLast); + } + result.push(method == null ? void 0 : method.apply(thisContext, args)); + } + return result; +} +//#endregion +exports.invokeMap = invokeMap; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/invokeMap.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/invokeMap.mjs new file mode 100644 index 0000000000000000000000000000000000000000..821d517dfe874dfd0409311938c7824859517b32 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/invokeMap.mjs @@ -0,0 +1,41 @@ +import { isFunction } from "../../predicate/isFunction.mjs"; +import { isNil } from "../../predicate/isNil.mjs"; +import "../../predicate/index.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +import { get } from "../object/get.mjs"; +//#region src/compat/array/invokeMap.ts +/** +* Invokes the method at path of each element in collection. +* +* @template T, R +* @param {ArrayLike | Record | null | undefined} collection - The collection to iterate over. +* @param {string | ((...args: any[]) => R)} path - The path of the method to invoke or the method to invoke. +* @param {...any[]} args - The arguments to invoke each method with. +* @returns {Array} Returns the array of results. +* +* @example +* invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); +* // => [[1, 5, 7], [1, 2, 3]] +*/ +function invokeMap(collection, path, ...args) { + if (isNil(collection)) return []; + const values = isArrayLike(collection) ? Array.from(collection) : Object.values(collection); + const result = []; + for (let i = 0; i < values.length; i++) { + const value = values[i]; + if (isFunction(path)) { + result.push(path.apply(value, args)); + continue; + } + const method = get(value, path); + let thisContext = value; + if (Array.isArray(path)) { + const pathExceptLast = path.slice(0, -1); + if (pathExceptLast.length > 0) thisContext = get(value, pathExceptLast); + } else if (typeof path === "string" && path.includes(".")) thisContext = get(value, path.split(".").slice(0, -1).join(".")); + result.push(method == null ? void 0 : method.apply(thisContext, args)); + } + return result; +} +//#endregion +export { invokeMap }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/join.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/join.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..989afb58d1fc202665b24c0891ec9f11896be1b3 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/join.d.mts @@ -0,0 +1,16 @@ +//#region src/compat/array/join.d.ts +/** + * Joins elements of an array into a string. + * + * @param {ArrayLike | null | undefined} array - The array to join. + * @param {string} [separator=','] - The separator used to join the elements, default is common separator `,`. + * @returns {string} - Returns a string containing all elements of the array joined by the specified separator. + * + * @example + * const arr = ["a", "b", "c"]; + * const result = join(arr, "~"); + * console.log(result); // Output: "a~b~c" + */ +declare function join(array: ArrayLike | null | undefined, separator?: string): string; +//#endregion +export { join }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/join.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/join.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..989afb58d1fc202665b24c0891ec9f11896be1b3 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/join.d.ts @@ -0,0 +1,16 @@ +//#region src/compat/array/join.d.ts +/** + * Joins elements of an array into a string. + * + * @param {ArrayLike | null | undefined} array - The array to join. + * @param {string} [separator=','] - The separator used to join the elements, default is common separator `,`. + * @returns {string} - Returns a string containing all elements of the array joined by the specified separator. + * + * @example + * const arr = ["a", "b", "c"]; + * const result = join(arr, "~"); + * console.log(result); // Output: "a~b~c" + */ +declare function join(array: ArrayLike | null | undefined, separator?: string): string; +//#endregion +export { join }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/join.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/join.js new file mode 100644 index 0000000000000000000000000000000000000000..dfccaf9b8e009b47f5e3483385c42b660de9cfa4 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/join.js @@ -0,0 +1,20 @@ +const require_isArrayLike = require("../predicate/isArrayLike.js"); +//#region src/compat/array/join.ts +/** +* Joins elements of an array into a string. +* +* @param {ArrayLike | null | undefined} array - The array to join. +* @param {string} [separator=','] - The separator used to join the elements, default is common separator `,`. +* @returns {string} - Returns a string containing all elements of the array joined by the specified separator. +* +* @example +* const arr = ["a", "b", "c"]; +* const result = join(arr, "~"); +* console.log(result); // Output: "a~b~c" +*/ +function join(array, separator) { + if (!require_isArrayLike.isArrayLike(array)) return ""; + return Array.from(array).join(separator); +} +//#endregion +exports.join = join; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/join.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/join.mjs new file mode 100644 index 0000000000000000000000000000000000000000..1b54d8ab08ddf95edb593b652fb498cd5b71a7b2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/join.mjs @@ -0,0 +1,20 @@ +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +//#region src/compat/array/join.ts +/** +* Joins elements of an array into a string. +* +* @param {ArrayLike | null | undefined} array - The array to join. +* @param {string} [separator=','] - The separator used to join the elements, default is common separator `,`. +* @returns {string} - Returns a string containing all elements of the array joined by the specified separator. +* +* @example +* const arr = ["a", "b", "c"]; +* const result = join(arr, "~"); +* console.log(result); // Output: "a~b~c" +*/ +function join(array, separator) { + if (!isArrayLike(array)) return ""; + return Array.from(array).join(separator); +} +//#endregion +export { join }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/keyBy.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/keyBy.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..fe9bd27a59c9e15a825e965d619dc201a51f9729 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/keyBy.d.mts @@ -0,0 +1,40 @@ +import { ValueIterateeCustom } from "../_internal/ValueIterateeCustom.mjs"; + +//#region src/compat/array/keyBy.d.ts +/** + * Creates an object composed of keys generated from the results of running each element of collection thru iteratee. + * + * @template T + * @param {ArrayLike | null | undefined} collection - The collection to iterate over. + * @param {ValueIterateeCustom} [iteratee] - The iteratee to transform keys. + * @returns {Record} Returns the composed aggregate object. + * + * @example + * const array = [ + * { dir: 'left', code: 97 }, + * { dir: 'right', code: 100 } + * ]; + * + * keyBy(array, o => String.fromCharCode(o.code)); + * // => { a: { dir: 'left', code: 97 }, d: { dir: 'right', code: 100 } } + * + * keyBy(array, 'dir'); + * // => { left: { dir: 'left', code: 97 }, right: { dir: 'right', code: 100 } } + */ +declare function keyBy(collection: ArrayLike | null | undefined, iteratee?: ValueIterateeCustom): Record; +/** + * Creates an object composed of keys generated from the results of running each element of collection thru iteratee. + * + * @template T + * @param {T | null | undefined} collection - The object to iterate over. + * @param {ValueIterateeCustom} [iteratee] - The iteratee to transform keys. + * @returns {Record} Returns the composed aggregate object. + * + * @example + * const obj = { a: { dir: 'left', code: 97 }, b: { dir: 'right', code: 100 } }; + * keyBy(obj, o => String.fromCharCode(o.code)); + * // => { a: { dir: 'left', code: 97 }, d: { dir: 'right', code: 100 } } + */ +declare function keyBy(collection: T | null | undefined, iteratee?: ValueIterateeCustom): Record; +//#endregion +export { keyBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/keyBy.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/keyBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fbd7734f7c12022a7e9baecfcfeefe0f3988f638 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/keyBy.d.ts @@ -0,0 +1,40 @@ +import { ValueIterateeCustom } from "../_internal/ValueIterateeCustom.js"; + +//#region src/compat/array/keyBy.d.ts +/** + * Creates an object composed of keys generated from the results of running each element of collection thru iteratee. + * + * @template T + * @param {ArrayLike | null | undefined} collection - The collection to iterate over. + * @param {ValueIterateeCustom} [iteratee] - The iteratee to transform keys. + * @returns {Record} Returns the composed aggregate object. + * + * @example + * const array = [ + * { dir: 'left', code: 97 }, + * { dir: 'right', code: 100 } + * ]; + * + * keyBy(array, o => String.fromCharCode(o.code)); + * // => { a: { dir: 'left', code: 97 }, d: { dir: 'right', code: 100 } } + * + * keyBy(array, 'dir'); + * // => { left: { dir: 'left', code: 97 }, right: { dir: 'right', code: 100 } } + */ +declare function keyBy(collection: ArrayLike | null | undefined, iteratee?: ValueIterateeCustom): Record; +/** + * Creates an object composed of keys generated from the results of running each element of collection thru iteratee. + * + * @template T + * @param {T | null | undefined} collection - The object to iterate over. + * @param {ValueIterateeCustom} [iteratee] - The iteratee to transform keys. + * @returns {Record} Returns the composed aggregate object. + * + * @example + * const obj = { a: { dir: 'left', code: 97 }, b: { dir: 'right', code: 100 } }; + * keyBy(obj, o => String.fromCharCode(o.code)); + * // => { a: { dir: 'left', code: 97 }, d: { dir: 'right', code: 100 } } + */ +declare function keyBy(collection: T | null | undefined, iteratee?: ValueIterateeCustom): Record; +//#endregion +export { keyBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/keyBy.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/keyBy.js new file mode 100644 index 0000000000000000000000000000000000000000..bddb5c92ab23eadb68ea91c0c155de99b952efe9 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/keyBy.js @@ -0,0 +1,44 @@ +const require_identity = require("../../function/identity.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +const require_iteratee = require("../util/iteratee.js"); +const require_isObjectLike = require("../predicate/isObjectLike.js"); +const require_reduce = require("./reduce.js"); +//#region src/compat/array/keyBy.ts +/** +* Maps each element of an array or an object based on a provided key-generating function. +* +* This function takes an array or object and a function that generates a key from each element or value. It returns +* an object where the keys are the generated keys and the values are the corresponding elements or values. +* If there are multiple elements or values generating the same key, the last one among them is used +* as the value. +* +* @param {ArrayLike | null | undefined} collection - The collection to iterate over. +* @param {Function | PropertyKey | Array | Object} [iteratee] - The iteratee to transform keys. +* - If a function is provided, it's invoked for each element in the collection. +* - If a property name (string) is provided, that property of each element is used as the key. +* - If a property-value pair (array) is provided, elements with matching property values are used. +* - If a partial object is provided, elements with matching properties are used. +* - If omitted, the identity function is used. +* @returns {Object} Returns the composed aggregate object. +* +* @example +* // Using an array of objects +* keyBy([{ id: 'a' }, { id: 'b' }], 'id'); +* // => { a: { id: 'a' }, b: { id: 'b' } } +* +* @example +* // Using a function iteratee +* keyBy(['a', 'b', 'c'], val => val.toUpperCase()); +* // => { A: 'a', B: 'b', C: 'c' } +*/ +function keyBy(collection, iteratee$1) { + if (!require_isArrayLike.isArrayLike(collection) && !require_isObjectLike.isObjectLike(collection)) return {}; + const keyFn = require_iteratee.iteratee(iteratee$1 ?? require_identity.identity); + return require_reduce.reduce(collection, (result, value) => { + const key = keyFn(value); + result[key] = value; + return result; + }, {}); +} +//#endregion +exports.keyBy = keyBy; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/keyBy.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/keyBy.mjs new file mode 100644 index 0000000000000000000000000000000000000000..078fa08887997536dd1f9192858d30d1b84cb96e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/keyBy.mjs @@ -0,0 +1,44 @@ +import { identity } from "../../function/identity.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +import { iteratee } from "../util/iteratee.mjs"; +import { isObjectLike } from "../predicate/isObjectLike.mjs"; +import { reduce } from "./reduce.mjs"; +//#region src/compat/array/keyBy.ts +/** +* Maps each element of an array or an object based on a provided key-generating function. +* +* This function takes an array or object and a function that generates a key from each element or value. It returns +* an object where the keys are the generated keys and the values are the corresponding elements or values. +* If there are multiple elements or values generating the same key, the last one among them is used +* as the value. +* +* @param {ArrayLike | null | undefined} collection - The collection to iterate over. +* @param {Function | PropertyKey | Array | Object} [iteratee] - The iteratee to transform keys. +* - If a function is provided, it's invoked for each element in the collection. +* - If a property name (string) is provided, that property of each element is used as the key. +* - If a property-value pair (array) is provided, elements with matching property values are used. +* - If a partial object is provided, elements with matching properties are used. +* - If omitted, the identity function is used. +* @returns {Object} Returns the composed aggregate object. +* +* @example +* // Using an array of objects +* keyBy([{ id: 'a' }, { id: 'b' }], 'id'); +* // => { a: { id: 'a' }, b: { id: 'b' } } +* +* @example +* // Using a function iteratee +* keyBy(['a', 'b', 'c'], val => val.toUpperCase()); +* // => { A: 'a', B: 'b', C: 'c' } +*/ +function keyBy(collection, iteratee$1) { + if (!isArrayLike(collection) && !isObjectLike(collection)) return {}; + const keyFn = iteratee(iteratee$1 ?? identity); + return reduce(collection, (result, value) => { + const key = keyFn(value); + result[key] = value; + return result; + }, {}); +} +//#endregion +export { keyBy }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/last.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/last.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..39074b9301a1559b39748ded34fbcb5b89494bef --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/last.d.mts @@ -0,0 +1,26 @@ +//#region src/compat/array/last.d.ts +/** + * Returns the last element of an array. + * + * This function takes an array and returns the last element of the array. + * If the array is empty, the function returns `undefined`. + * + * Unlike some implementations, this function is optimized for performance + * by directly accessing the last index of the array. + * + * @template T - The type of elements in the array. + * @param {ArrayLike | null | undefined} arr - The array from which to get the last element. + * @returns {T | undefined} The last element of the array, or `undefined` if the array is empty. + * + * @example + * const arr = [1, 2, 3]; + * const lastElement = last(arr); + * // lastElement will be 3 + * + * const emptyArr: number[] = []; + * const noElement = last(emptyArr); + * // noElement will be undefined + */ +declare function last(array: ArrayLike | null | undefined): T | undefined; +//#endregion +export { last }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/last.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/last.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..39074b9301a1559b39748ded34fbcb5b89494bef --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/last.d.ts @@ -0,0 +1,26 @@ +//#region src/compat/array/last.d.ts +/** + * Returns the last element of an array. + * + * This function takes an array and returns the last element of the array. + * If the array is empty, the function returns `undefined`. + * + * Unlike some implementations, this function is optimized for performance + * by directly accessing the last index of the array. + * + * @template T - The type of elements in the array. + * @param {ArrayLike | null | undefined} arr - The array from which to get the last element. + * @returns {T | undefined} The last element of the array, or `undefined` if the array is empty. + * + * @example + * const arr = [1, 2, 3]; + * const lastElement = last(arr); + * // lastElement will be 3 + * + * const emptyArr: number[] = []; + * const noElement = last(emptyArr); + * // noElement will be undefined + */ +declare function last(array: ArrayLike | null | undefined): T | undefined; +//#endregion +export { last }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/last.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/last.js new file mode 100644 index 0000000000000000000000000000000000000000..4b3108c52986ba0d526fb24af01ff9d036fa9146 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/last.js @@ -0,0 +1,32 @@ +const require_last = require("../../array/last.js"); +const require_toArray = require("../_internal/toArray.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +//#region src/compat/array/last.ts +/** +* Returns the last element of an array. +* +* This function takes an array and returns the last element of the array. +* If the array is empty, the function returns `undefined`. +* +* Unlike some implementations, this function is optimized for performance +* by directly accessing the last index of the array. +* +* @template T - The type of elements in the array. +* @param {ArrayLike | null | undefined} arr - The array from which to get the last element. +* @returns {T | undefined} The last element of the array, or `undefined` if the array is empty. +* +* @example +* const arr = [1, 2, 3]; +* const lastElement = last(arr); +* // lastElement will be 3 +* +* const emptyArr: number[] = []; +* const noElement = last(emptyArr); +* // noElement will be undefined +*/ +function last(array) { + if (!require_isArrayLike.isArrayLike(array)) return; + return require_last.last(require_toArray.toArray(array)); +} +//#endregion +exports.last = last; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/last.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/last.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d92309775de48dcd83e002fd3efa369819feb9f3 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/last.mjs @@ -0,0 +1,32 @@ +import { last as last$1 } from "../../array/last.mjs"; +import { toArray } from "../_internal/toArray.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +//#region src/compat/array/last.ts +/** +* Returns the last element of an array. +* +* This function takes an array and returns the last element of the array. +* If the array is empty, the function returns `undefined`. +* +* Unlike some implementations, this function is optimized for performance +* by directly accessing the last index of the array. +* +* @template T - The type of elements in the array. +* @param {ArrayLike | null | undefined} arr - The array from which to get the last element. +* @returns {T | undefined} The last element of the array, or `undefined` if the array is empty. +* +* @example +* const arr = [1, 2, 3]; +* const lastElement = last(arr); +* // lastElement will be 3 +* +* const emptyArr: number[] = []; +* const noElement = last(emptyArr); +* // noElement will be undefined +*/ +function last(array) { + if (!isArrayLike(array)) return; + return last$1(toArray(array)); +} +//#endregion +export { last }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/lastIndexOf.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/lastIndexOf.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..4dce31f0aa0171046f15ca80c029b4d3ad579b47 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/lastIndexOf.d.mts @@ -0,0 +1,23 @@ +//#region src/compat/array/lastIndexOf.d.ts +/** + * Gets the index at which the last occurrence of value is found in array. + * + * @template T + * @param {ArrayLike | null | undefined} array - The array to inspect. + * @param {T} value - The value to search for. + * @param {true | number} [fromIndex] - The index to search from or true to search from the end. + * @returns {number} Returns the index of the matched value, else -1. + * + * @example + * lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + * + * lastIndexOf([1, 2, 1, 2], 2, true); + * // => 1 + */ +declare function lastIndexOf(array: ArrayLike | null | undefined, searchElement: T, fromIndex?: true | number): number; +//#endregion +export { lastIndexOf }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/lastIndexOf.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/lastIndexOf.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4dce31f0aa0171046f15ca80c029b4d3ad579b47 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/lastIndexOf.d.ts @@ -0,0 +1,23 @@ +//#region src/compat/array/lastIndexOf.d.ts +/** + * Gets the index at which the last occurrence of value is found in array. + * + * @template T + * @param {ArrayLike | null | undefined} array - The array to inspect. + * @param {T} value - The value to search for. + * @param {true | number} [fromIndex] - The index to search from or true to search from the end. + * @returns {number} Returns the index of the matched value, else -1. + * + * @example + * lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + * + * lastIndexOf([1, 2, 1, 2], 2, true); + * // => 1 + */ +declare function lastIndexOf(array: ArrayLike | null | undefined, searchElement: T, fromIndex?: true | number): number; +//#endregion +export { lastIndexOf }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/lastIndexOf.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/lastIndexOf.js new file mode 100644 index 0000000000000000000000000000000000000000..9feb94a8cdd9b7df278affd46475f8d2d37a8ac2 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/lastIndexOf.js @@ -0,0 +1,14 @@ +const require_isArrayLike = require("../predicate/isArrayLike.js"); +//#region src/compat/array/lastIndexOf.ts +function lastIndexOf(array, searchElement, fromIndex) { + if (!require_isArrayLike.isArrayLike(array) || array.length === 0) return -1; + const length = array.length; + let index = fromIndex ?? length - 1; + if (fromIndex != null) index = index < 0 ? Math.max(length + index, 0) : Math.min(index, length - 1); + if (Number.isNaN(searchElement)) { + for (let i = index; i >= 0; i--) if (Number.isNaN(array[i])) return i; + } + return Array.from(array).lastIndexOf(searchElement, index); +} +//#endregion +exports.lastIndexOf = lastIndexOf; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/lastIndexOf.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/lastIndexOf.mjs new file mode 100644 index 0000000000000000000000000000000000000000..91241c93ae2992193c6f41adfc9e01ec86c1af34 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/lastIndexOf.mjs @@ -0,0 +1,14 @@ +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +//#region src/compat/array/lastIndexOf.ts +function lastIndexOf(array, searchElement, fromIndex) { + if (!isArrayLike(array) || array.length === 0) return -1; + const length = array.length; + let index = fromIndex ?? length - 1; + if (fromIndex != null) index = index < 0 ? Math.max(length + index, 0) : Math.min(index, length - 1); + if (Number.isNaN(searchElement)) { + for (let i = index; i >= 0; i--) if (Number.isNaN(array[i])) return i; + } + return Array.from(array).lastIndexOf(searchElement, index); +} +//#endregion +export { lastIndexOf }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/map.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/map.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..bca541070472814f9b575293b4c80df11d59e6ee --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/map.d.mts @@ -0,0 +1,111 @@ +import { ArrayIterator } from "../_internal/ArrayIterator.mjs"; +import { ListIterator } from "../_internal/ListIterator.mjs"; +import { ObjectIterator } from "../_internal/ObjectIterator.mjs"; +import { TupleIterator } from "../_internal/TupleIterator.mjs"; + +//#region src/compat/array/map.d.ts +/** + * Maps each element in a tuple to a new tuple of values using an iteratee. + * + * @param {T} collection - The tuple to iterate over + * @param {TupleIterator} iteratee - The function invoked per iteration + * @returns {{ [K in keyof T]: U }} - Returns the new mapped tuple + * + * @example + * // Using a transformation function on a tuple + * const tuple = [1, 'hello', true] as const; + * map(tuple, value => String(value)); // => ['1', 'hello', 'true'] + */ +declare function map(collection: T, iteratee: TupleIterator): { [K in keyof T]: U }; +/** + * Maps each element in an array to a new array using an iteratee. + * + * @param {T[] | null | undefined} collection - The array to iterate over + * @param {ArrayIterator} iteratee - The function invoked per iteration + * @returns {U[]} - Returns the new mapped array + * + * @example + * // Using a transformation function on an array + * const array = [1, 2, 3]; + * map(array, x => x * 2); // => [2, 4, 6] + */ +declare function map(collection: T[] | null | undefined, iteratee: ArrayIterator): U[]; +/** + * Maps each element in an array-like object to a new array using an iteratee. + * + * @param {ArrayLike | null | undefined} collection - The array-like object to iterate over + * @param {ListIterator} iteratee - The function invoked per iteration + * @returns {U[]} - Returns the new mapped array + * + * @example + * // Using a transformation function on an array-like object + * const arrayLike = { length: 2, 0: 'a', 1: 'b' }; + * map(arrayLike, x => x.toUpperCase()); // => ['A', 'B'] + */ +declare function map(collection: ArrayLike | null | undefined, iteratee: ListIterator): U[]; +/** + * Maps each value in an object to a new array. + * + * @param {Record | Record | null | undefined} collection - The object to iterate over + * @returns {T[]} - Returns an array of the object's values + * + * @example + * // Converting an object's values to an array + * const obj = { a: 1, b: 2, c: 3 }; + * map(obj); // => [1, 2, 3] + */ +declare function map(collection: Record | Record | null | undefined): T[]; +/** + * Maps each element in an object to a new array using an iteratee. + * + * @param {T | null | undefined} collection - The object to iterate over + * @param {ObjectIterator} iteratee - The function invoked per iteration + * @returns {U[]} - Returns the new mapped array + * + * @example + * // Using a transformation function on an object + * const obj = { a: 1, b: 2 }; + * map(obj, (value, key) => `${key}:${value}`); // => ['a:1', 'b:2'] + */ +declare function map(collection: T | null | undefined, iteratee: ObjectIterator): U[]; +/** + * Maps each element in an object to a new array by plucking the specified property. + * + * @param {Record | Record | null | undefined} collection - The object to iterate over + * @param {K} iteratee - The property to pluck from each element + * @returns {Array} - Returns the new array of plucked values + * + * @example + * // Plucking a property from each object + * const users = [{ name: 'John', age: 30 }, { name: 'Jane', age: 25 }]; + * map(users, 'name'); // => ['John', 'Jane'] + */ +declare function map(collection: Record | Record | null | undefined, iteratee: K): Array; +/** + * Maps each element in an object to a new array by plucking the specified string property. + * + * @param {Record | Record | null | undefined} collection - The object to iterate over + * @param {string} [iteratee] - The string property to pluck from each element + * @returns {any[]} - Returns the new array of plucked values + * + * @example + * // Plucking a nested property + * const users = [{ info: { name: 'John' } }, { info: { name: 'Jane' } }]; + * map(users, 'info.name'); // => ['John', 'Jane'] + */ +declare function map(collection: Record | Record | null | undefined, iteratee?: string): any[]; +/** + * Maps each element in an object to a new array by matching against a source object. + * + * @param {Record | Record | null | undefined} collection - The object to iterate over + * @param {object} [iteratee] - The object to match against + * @returns {boolean[]} - Returns an array of boolean values indicating matches + * + * @example + * // Matching against a source object + * const users = [{ name: 'John', age: 30 }, { name: 'Jane', age: 25 }]; + * map(users, { age: 30 }); // => [true, false] + */ +declare function map(collection: Record | Record | null | undefined, iteratee?: object): boolean[]; +//#endregion +export { map }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/map.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/map.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..71e6913797e342b0dbff316000def6f8251ca345 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/map.d.ts @@ -0,0 +1,111 @@ +import { ArrayIterator } from "../_internal/ArrayIterator.js"; +import { ListIterator } from "../_internal/ListIterator.js"; +import { ObjectIterator } from "../_internal/ObjectIterator.js"; +import { TupleIterator } from "../_internal/TupleIterator.js"; + +//#region src/compat/array/map.d.ts +/** + * Maps each element in a tuple to a new tuple of values using an iteratee. + * + * @param {T} collection - The tuple to iterate over + * @param {TupleIterator} iteratee - The function invoked per iteration + * @returns {{ [K in keyof T]: U }} - Returns the new mapped tuple + * + * @example + * // Using a transformation function on a tuple + * const tuple = [1, 'hello', true] as const; + * map(tuple, value => String(value)); // => ['1', 'hello', 'true'] + */ +declare function map(collection: T, iteratee: TupleIterator): { [K in keyof T]: U }; +/** + * Maps each element in an array to a new array using an iteratee. + * + * @param {T[] | null | undefined} collection - The array to iterate over + * @param {ArrayIterator} iteratee - The function invoked per iteration + * @returns {U[]} - Returns the new mapped array + * + * @example + * // Using a transformation function on an array + * const array = [1, 2, 3]; + * map(array, x => x * 2); // => [2, 4, 6] + */ +declare function map(collection: T[] | null | undefined, iteratee: ArrayIterator): U[]; +/** + * Maps each element in an array-like object to a new array using an iteratee. + * + * @param {ArrayLike | null | undefined} collection - The array-like object to iterate over + * @param {ListIterator} iteratee - The function invoked per iteration + * @returns {U[]} - Returns the new mapped array + * + * @example + * // Using a transformation function on an array-like object + * const arrayLike = { length: 2, 0: 'a', 1: 'b' }; + * map(arrayLike, x => x.toUpperCase()); // => ['A', 'B'] + */ +declare function map(collection: ArrayLike | null | undefined, iteratee: ListIterator): U[]; +/** + * Maps each value in an object to a new array. + * + * @param {Record | Record | null | undefined} collection - The object to iterate over + * @returns {T[]} - Returns an array of the object's values + * + * @example + * // Converting an object's values to an array + * const obj = { a: 1, b: 2, c: 3 }; + * map(obj); // => [1, 2, 3] + */ +declare function map(collection: Record | Record | null | undefined): T[]; +/** + * Maps each element in an object to a new array using an iteratee. + * + * @param {T | null | undefined} collection - The object to iterate over + * @param {ObjectIterator} iteratee - The function invoked per iteration + * @returns {U[]} - Returns the new mapped array + * + * @example + * // Using a transformation function on an object + * const obj = { a: 1, b: 2 }; + * map(obj, (value, key) => `${key}:${value}`); // => ['a:1', 'b:2'] + */ +declare function map(collection: T | null | undefined, iteratee: ObjectIterator): U[]; +/** + * Maps each element in an object to a new array by plucking the specified property. + * + * @param {Record | Record | null | undefined} collection - The object to iterate over + * @param {K} iteratee - The property to pluck from each element + * @returns {Array} - Returns the new array of plucked values + * + * @example + * // Plucking a property from each object + * const users = [{ name: 'John', age: 30 }, { name: 'Jane', age: 25 }]; + * map(users, 'name'); // => ['John', 'Jane'] + */ +declare function map(collection: Record | Record | null | undefined, iteratee: K): Array; +/** + * Maps each element in an object to a new array by plucking the specified string property. + * + * @param {Record | Record | null | undefined} collection - The object to iterate over + * @param {string} [iteratee] - The string property to pluck from each element + * @returns {any[]} - Returns the new array of plucked values + * + * @example + * // Plucking a nested property + * const users = [{ info: { name: 'John' } }, { info: { name: 'Jane' } }]; + * map(users, 'info.name'); // => ['John', 'Jane'] + */ +declare function map(collection: Record | Record | null | undefined, iteratee?: string): any[]; +/** + * Maps each element in an object to a new array by matching against a source object. + * + * @param {Record | Record | null | undefined} collection - The object to iterate over + * @param {object} [iteratee] - The object to match against + * @returns {boolean[]} - Returns an array of boolean values indicating matches + * + * @example + * // Matching against a source object + * const users = [{ name: 'John', age: 30 }, { name: 'Jane', age: 25 }]; + * map(users, { age: 30 }); // => [true, false] + */ +declare function map(collection: Record | Record | null | undefined, iteratee?: object): boolean[]; +//#endregion +export { map }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/map.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/map.js new file mode 100644 index 0000000000000000000000000000000000000000..75b2909975267e4401b311a5350f9c776e99795e --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/map.js @@ -0,0 +1,19 @@ +const require_identity = require("../../function/identity.js"); +const require_range = require("../../math/range.js"); +const require_isArrayLike = require("../predicate/isArrayLike.js"); +const require_iteratee = require("../util/iteratee.js"); +//#region src/compat/array/map.ts +function map(collection, _iteratee) { + if (!collection) return []; + const keys = require_isArrayLike.isArrayLike(collection) || Array.isArray(collection) ? require_range.range(0, collection.length) : Object.keys(collection); + const iteratee$1 = require_iteratee.iteratee(_iteratee ?? require_identity.identity); + const result = new Array(keys.length); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const value = collection[key]; + result[i] = iteratee$1(value, key, collection); + } + return result; +} +//#endregion +exports.map = map; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/map.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/map.mjs new file mode 100644 index 0000000000000000000000000000000000000000..634a388fb31c2a46405ad0b1c3ab0ff27cc66f52 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/map.mjs @@ -0,0 +1,19 @@ +import { identity } from "../../function/identity.mjs"; +import { range } from "../../math/range.mjs"; +import { isArrayLike } from "../predicate/isArrayLike.mjs"; +import { iteratee } from "../util/iteratee.mjs"; +//#region src/compat/array/map.ts +function map(collection, _iteratee) { + if (!collection) return []; + const keys = isArrayLike(collection) || Array.isArray(collection) ? range(0, collection.length) : Object.keys(collection); + const iteratee$1 = iteratee(_iteratee ?? identity); + const result = new Array(keys.length); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const value = collection[key]; + result[i] = iteratee$1(value, key, collection); + } + return result; +} +//#endregion +export { map }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/nth.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/nth.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..bc1e2689a7fbce4996830bcaed469f2f195a1750 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/nth.d.mts @@ -0,0 +1,15 @@ +//#region src/compat/array/nth.d.ts +/** + * Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. + * + * @param {ArrayLike | null | undefined} array - The array to query. + * @param {number} [n=0] - The index of the element to return. + * @return {T | undefined} Returns the nth element of `array`. + * + * @example + * nth([1, 2, 3], 1); // => 2 + * nth([1, 2, 3], -1); // => 3 + */ +declare function nth(array: ArrayLike | null | undefined, n?: number): T | undefined; +//#endregion +export { nth }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/nth.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/nth.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bc1e2689a7fbce4996830bcaed469f2f195a1750 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/nth.d.ts @@ -0,0 +1,15 @@ +//#region src/compat/array/nth.d.ts +/** + * Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. + * + * @param {ArrayLike | null | undefined} array - The array to query. + * @param {number} [n=0] - The index of the element to return. + * @return {T | undefined} Returns the nth element of `array`. + * + * @example + * nth([1, 2, 3], 1); // => 2 + * nth([1, 2, 3], -1); // => 3 + */ +declare function nth(array: ArrayLike | null | undefined, n?: number): T | undefined; +//#endregion +export { nth }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/nth.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/nth.js new file mode 100644 index 0000000000000000000000000000000000000000..0fcb4bead781a75c412b04d5e99bf3f9c49ed74f --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/nth.js @@ -0,0 +1,22 @@ +const require_toInteger = require("../util/toInteger.js"); +const require_isArrayLikeObject = require("../predicate/isArrayLikeObject.js"); +//#region src/compat/array/nth.ts +/** +* Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. +* +* @param {ArrayLike | null | undefined} array - The array to query. +* @param {number} [n=0] - The index of the element to return. +* @return {T | undefined} Returns the nth element of `array`. +* +* @example +* nth([1, 2, 3], 1); // => 2 +* nth([1, 2, 3], -1); // => 3 +*/ +function nth(array, n = 0) { + if (!require_isArrayLikeObject.isArrayLikeObject(array) || array.length === 0) return; + n = require_toInteger.toInteger(n); + if (n < 0) n += array.length; + return array[n]; +} +//#endregion +exports.nth = nth; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/nth.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/nth.mjs new file mode 100644 index 0000000000000000000000000000000000000000..5cf8132608fefa1b96d4e3e81c8e44105ef7e03d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/nth.mjs @@ -0,0 +1,22 @@ +import { toInteger } from "../util/toInteger.mjs"; +import { isArrayLikeObject } from "../predicate/isArrayLikeObject.mjs"; +//#region src/compat/array/nth.ts +/** +* Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. +* +* @param {ArrayLike | null | undefined} array - The array to query. +* @param {number} [n=0] - The index of the element to return. +* @return {T | undefined} Returns the nth element of `array`. +* +* @example +* nth([1, 2, 3], 1); // => 2 +* nth([1, 2, 3], -1); // => 3 +*/ +function nth(array, n = 0) { + if (!isArrayLikeObject(array) || array.length === 0) return; + n = toInteger(n); + if (n < 0) n += array.length; + return array[n]; +} +//#endregion +export { nth }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/orderBy.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/orderBy.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..72c30d95028e42b9f60d06a3469332238c20307b --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/orderBy.d.mts @@ -0,0 +1,86 @@ +import { ListIteratee } from "../_internal/ListIteratee.mjs"; +import { ListIterator } from "../_internal/ListIterator.mjs"; +import { ObjectIterator } from "../_internal/ObjectIterator.mjs"; +import { ObjectIteratee } from "../_internal/ObjectIteratee.mjs"; +import { Many } from "../_internal/Many.mjs"; + +//#region src/compat/array/orderBy.d.ts +type Criterion = ((item: T) => unknown) | PropertyKey | PropertyKey[] | null | undefined; +/** + * Sorts an array of elements based on multiple iteratee functions and their corresponding order directions. + * + * @template T The type of elements in the array + * @param {ArrayLike | null | undefined} collection The array to sort + * @param {Many>} iteratees The iteratee functions to sort by + * @param {Many} orders The sort orders + * @returns {T[]} Returns the new sorted array + * @example + * const users = [ + * { name: 'fred', age: 48 }, + * { name: 'barney', age: 34 } + * ]; + * + * // Sort by age in ascending order + * orderBy(users, [(user) => user.age], ['asc']); + * // => [{ name: 'barney', age: 34 }, { name: 'fred', age: 48 }] + */ +declare function orderBy(collection: ArrayLike | null | undefined, iteratees?: Many>, orders?: Many): T[]; +/** + * Sorts an array of elements based on multiple property names/paths and their corresponding order directions. + * + * @template T The type of elements in the array + * @param {ArrayLike | null | undefined} collection The array to sort + * @param {Many>} iteratees The property names/paths to sort by + * @param {Many} orders The sort orders + * @returns {T[]} Returns the new sorted array + * @example + * const users = [ + * { name: 'fred', age: 48 }, + * { name: 'barney', age: 34 } + * ]; + * + * // Sort by name in ascending order + * orderBy(users, ['name'], ['asc']); + * // => [{ name: 'barney', age: 34 }, { name: 'fred', age: 48 }] + */ +declare function orderBy(collection: ArrayLike | null | undefined, iteratees?: Many>, orders?: Many): T[]; +/** + * Sorts an object's values based on multiple iteratee functions and their corresponding order directions. + * + * @template T The object type + * @param {T | null | undefined} collection The object to sort values from + * @param {Many>} iteratees The iteratee functions to sort by + * @param {Many} orders The sort orders + * @returns {Array} Returns the new sorted array + * @example + * const obj = { + * a: { name: 'fred', age: 48 }, + * b: { name: 'barney', age: 34 } + * }; + * + * // Sort by age in ascending order + * orderBy(obj, [(user) => user.age], ['asc']); + * // => [{ name: 'barney', age: 34 }, { name: 'fred', age: 48 }] + */ +declare function orderBy(collection: T | null | undefined, iteratees?: Many>, orders?: Many): Array; +/** + * Sorts an object's values based on multiple property names/paths and their corresponding order directions. + * + * @template T The object type + * @param {T | null | undefined} collection The object to sort values from + * @param {Many>} iteratees The property names/paths to sort by + * @param {Many} orders The sort orders + * @returns {Array} Returns the new sorted array + * @example + * const obj = { + * a: { name: 'fred', age: 48 }, + * b: { name: 'barney', age: 34 } + * }; + * + * // Sort by name in ascending order + * orderBy(obj, ['name'], ['asc']); + * // => [{ name: 'barney', age: 34 }, { name: 'fred', age: 48 }] + */ +declare function orderBy(collection: T | null | undefined, iteratees?: Many>, orders?: Many): Array; +//#endregion +export { orderBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/orderBy.d.ts b/tools/ui/node_modules/es-toolkit/dist/compat/array/orderBy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..85874630691e2b9e10f18250e196028eeab30b27 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/orderBy.d.ts @@ -0,0 +1,86 @@ +import { ListIteratee } from "../_internal/ListIteratee.js"; +import { ListIterator } from "../_internal/ListIterator.js"; +import { ObjectIterator } from "../_internal/ObjectIterator.js"; +import { ObjectIteratee } from "../_internal/ObjectIteratee.js"; +import { Many } from "../_internal/Many.js"; + +//#region src/compat/array/orderBy.d.ts +type Criterion = ((item: T) => unknown) | PropertyKey | PropertyKey[] | null | undefined; +/** + * Sorts an array of elements based on multiple iteratee functions and their corresponding order directions. + * + * @template T The type of elements in the array + * @param {ArrayLike | null | undefined} collection The array to sort + * @param {Many>} iteratees The iteratee functions to sort by + * @param {Many} orders The sort orders + * @returns {T[]} Returns the new sorted array + * @example + * const users = [ + * { name: 'fred', age: 48 }, + * { name: 'barney', age: 34 } + * ]; + * + * // Sort by age in ascending order + * orderBy(users, [(user) => user.age], ['asc']); + * // => [{ name: 'barney', age: 34 }, { name: 'fred', age: 48 }] + */ +declare function orderBy(collection: ArrayLike | null | undefined, iteratees?: Many>, orders?: Many): T[]; +/** + * Sorts an array of elements based on multiple property names/paths and their corresponding order directions. + * + * @template T The type of elements in the array + * @param {ArrayLike | null | undefined} collection The array to sort + * @param {Many>} iteratees The property names/paths to sort by + * @param {Many} orders The sort orders + * @returns {T[]} Returns the new sorted array + * @example + * const users = [ + * { name: 'fred', age: 48 }, + * { name: 'barney', age: 34 } + * ]; + * + * // Sort by name in ascending order + * orderBy(users, ['name'], ['asc']); + * // => [{ name: 'barney', age: 34 }, { name: 'fred', age: 48 }] + */ +declare function orderBy(collection: ArrayLike | null | undefined, iteratees?: Many>, orders?: Many): T[]; +/** + * Sorts an object's values based on multiple iteratee functions and their corresponding order directions. + * + * @template T The object type + * @param {T | null | undefined} collection The object to sort values from + * @param {Many>} iteratees The iteratee functions to sort by + * @param {Many} orders The sort orders + * @returns {Array} Returns the new sorted array + * @example + * const obj = { + * a: { name: 'fred', age: 48 }, + * b: { name: 'barney', age: 34 } + * }; + * + * // Sort by age in ascending order + * orderBy(obj, [(user) => user.age], ['asc']); + * // => [{ name: 'barney', age: 34 }, { name: 'fred', age: 48 }] + */ +declare function orderBy(collection: T | null | undefined, iteratees?: Many>, orders?: Many): Array; +/** + * Sorts an object's values based on multiple property names/paths and their corresponding order directions. + * + * @template T The object type + * @param {T | null | undefined} collection The object to sort values from + * @param {Many>} iteratees The property names/paths to sort by + * @param {Many} orders The sort orders + * @returns {Array} Returns the new sorted array + * @example + * const obj = { + * a: { name: 'fred', age: 48 }, + * b: { name: 'barney', age: 34 } + * }; + * + * // Sort by name in ascending order + * orderBy(obj, ['name'], ['asc']); + * // => [{ name: 'barney', age: 34 }, { name: 'fred', age: 48 }] + */ +declare function orderBy(collection: T | null | undefined, iteratees?: Many>, orders?: Many): Array; +//#endregion +export { orderBy }; \ No newline at end of file diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/orderBy.js b/tools/ui/node_modules/es-toolkit/dist/compat/array/orderBy.js new file mode 100644 index 0000000000000000000000000000000000000000..13c033f273d0d1e9365fc52f06f135f1fc047394 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/orderBy.js @@ -0,0 +1,80 @@ +const require_toPath = require("../util/toPath.js"); +const require_compareValues = require("../_internal/compareValues.js"); +const require_isKey = require("../_internal/isKey.js"); +//#region src/compat/array/orderBy.ts +/** +* Sorts an array of objects based on multiple properties and their corresponding order directions. +* +* This function takes an array of objects, an array of criteria to sort by, and an array of order directions. +* It returns the sorted array, ordering by each key according to its corresponding direction ('asc' for ascending or 'desc' for descending). +* If values for a key are equal, it moves to the next key to determine the order. +* +* @template T - The type of elements in the array. +* @param {ArrayLike | object | null | undefined} collection - The array of objects to be sorted. +* @param {Criterion | Array>} criteria - An array of criteria (property names or property paths or custom key functions) to sort by. +* @param {unknown | unknown[]} orders - An array of order directions ('asc' for ascending or 'desc' for descending). +* @param {unknown} [guard] Enables use as an iteratee for methods like `_.reduce`. +* @returns {T[]} - The sorted array. +* +* @example +* // Sort an array of objects by 'user' in ascending order and 'age' in descending order. +* const users = [ +* { user: 'fred', age: 48 }, +* { user: 'barney', age: 34 }, +* { user: 'fred', age: 40 }, +* { user: 'barney', age: 36 }, +* ]; +* const result = orderBy(users, ['user', (item) => item.age], ['asc', 'desc']); +* // result will be: +* // [ +* // { user: 'barney', age: 36 }, +* // { user: 'barney', age: 34 }, +* // { user: 'fred', age: 48 }, +* // { user: 'fred', age: 40 }, +* // ] +*/ +function orderBy(collection, criteria, orders, guard) { + if (collection == null) return []; + orders = guard ? void 0 : orders; + if (!Array.isArray(collection)) collection = Object.values(collection); + if (!Array.isArray(criteria)) criteria = criteria == null ? [null] : [criteria]; + if (criteria.length === 0) criteria = [null]; + if (!Array.isArray(orders)) orders = orders == null ? [] : [orders]; + orders = orders.map((order) => String(order)); + const getValueByNestedPath = (object, path) => { + let target = object; + for (let i = 0; i < path.length && target != null; ++i) target = target[path[i]]; + return target; + }; + const getValueByCriterion = (criterion, object) => { + if (object == null || criterion == null) return object; + if (typeof criterion === "object" && "key" in criterion) { + if (Object.hasOwn(object, criterion.key)) return object[criterion.key]; + return getValueByNestedPath(object, criterion.path); + } + if (typeof criterion === "function") return criterion(object); + if (Array.isArray(criterion)) return getValueByNestedPath(object, criterion); + if (typeof object === "object") return object[criterion]; + return object; + }; + const preparedCriteria = criteria.map((criterion) => { + if (Array.isArray(criterion) && criterion.length === 1) criterion = criterion[0]; + if (criterion == null || typeof criterion === "function" || Array.isArray(criterion) || require_isKey.isKey(criterion)) return criterion; + return { + key: criterion, + path: require_toPath.toPath(criterion) + }; + }); + return collection.map((item) => ({ + original: item, + criteria: preparedCriteria.map((criterion) => getValueByCriterion(criterion, item)) + })).slice().sort((a, b) => { + for (let i = 0; i < preparedCriteria.length; i++) { + const comparedResult = require_compareValues.compareValues(a.criteria[i], b.criteria[i], orders[i]); + if (comparedResult !== 0) return comparedResult; + } + return 0; + }).map((item) => item.original); +} +//#endregion +exports.orderBy = orderBy; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/orderBy.mjs b/tools/ui/node_modules/es-toolkit/dist/compat/array/orderBy.mjs new file mode 100644 index 0000000000000000000000000000000000000000..ef4ed15df5a9d5e70df2ee4e3ca0ba719f903128 --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/orderBy.mjs @@ -0,0 +1,80 @@ +import { toPath } from "../util/toPath.mjs"; +import { compareValues } from "../_internal/compareValues.mjs"; +import { isKey } from "../_internal/isKey.mjs"; +//#region src/compat/array/orderBy.ts +/** +* Sorts an array of objects based on multiple properties and their corresponding order directions. +* +* This function takes an array of objects, an array of criteria to sort by, and an array of order directions. +* It returns the sorted array, ordering by each key according to its corresponding direction ('asc' for ascending or 'desc' for descending). +* If values for a key are equal, it moves to the next key to determine the order. +* +* @template T - The type of elements in the array. +* @param {ArrayLike | object | null | undefined} collection - The array of objects to be sorted. +* @param {Criterion | Array>} criteria - An array of criteria (property names or property paths or custom key functions) to sort by. +* @param {unknown | unknown[]} orders - An array of order directions ('asc' for ascending or 'desc' for descending). +* @param {unknown} [guard] Enables use as an iteratee for methods like `_.reduce`. +* @returns {T[]} - The sorted array. +* +* @example +* // Sort an array of objects by 'user' in ascending order and 'age' in descending order. +* const users = [ +* { user: 'fred', age: 48 }, +* { user: 'barney', age: 34 }, +* { user: 'fred', age: 40 }, +* { user: 'barney', age: 36 }, +* ]; +* const result = orderBy(users, ['user', (item) => item.age], ['asc', 'desc']); +* // result will be: +* // [ +* // { user: 'barney', age: 36 }, +* // { user: 'barney', age: 34 }, +* // { user: 'fred', age: 48 }, +* // { user: 'fred', age: 40 }, +* // ] +*/ +function orderBy(collection, criteria, orders, guard) { + if (collection == null) return []; + orders = guard ? void 0 : orders; + if (!Array.isArray(collection)) collection = Object.values(collection); + if (!Array.isArray(criteria)) criteria = criteria == null ? [null] : [criteria]; + if (criteria.length === 0) criteria = [null]; + if (!Array.isArray(orders)) orders = orders == null ? [] : [orders]; + orders = orders.map((order) => String(order)); + const getValueByNestedPath = (object, path) => { + let target = object; + for (let i = 0; i < path.length && target != null; ++i) target = target[path[i]]; + return target; + }; + const getValueByCriterion = (criterion, object) => { + if (object == null || criterion == null) return object; + if (typeof criterion === "object" && "key" in criterion) { + if (Object.hasOwn(object, criterion.key)) return object[criterion.key]; + return getValueByNestedPath(object, criterion.path); + } + if (typeof criterion === "function") return criterion(object); + if (Array.isArray(criterion)) return getValueByNestedPath(object, criterion); + if (typeof object === "object") return object[criterion]; + return object; + }; + const preparedCriteria = criteria.map((criterion) => { + if (Array.isArray(criterion) && criterion.length === 1) criterion = criterion[0]; + if (criterion == null || typeof criterion === "function" || Array.isArray(criterion) || isKey(criterion)) return criterion; + return { + key: criterion, + path: toPath(criterion) + }; + }); + return collection.map((item) => ({ + original: item, + criteria: preparedCriteria.map((criterion) => getValueByCriterion(criterion, item)) + })).slice().sort((a, b) => { + for (let i = 0; i < preparedCriteria.length; i++) { + const comparedResult = compareValues(a.criteria[i], b.criteria[i], orders[i]); + if (comparedResult !== 0) return comparedResult; + } + return 0; + }).map((item) => item.original); +} +//#endregion +export { orderBy }; diff --git a/tools/ui/node_modules/es-toolkit/dist/compat/array/partition.d.mts b/tools/ui/node_modules/es-toolkit/dist/compat/array/partition.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..b8ef5d1fc0e4f4463c8c73dd8272cb221a43ec7d --- /dev/null +++ b/tools/ui/node_modules/es-toolkit/dist/compat/array/partition.d.mts @@ -0,0 +1,51 @@ +import { ValueIteratee } from "../_internal/ValueIteratee.mjs"; +import { ValueIteratorTypeGuard } from "../_internal/ValueIteratorTypeGuard.mjs"; + +//#region src/compat/array/partition.d.ts +/** + * Creates an array of elements split into two groups, the first of which contains elements + * predicate returns truthy for, while the second of which contains elements predicate returns falsey for. + * The predicate is invoked with one argument: (value). + * + * @template T, U + * @param {ArrayLike | null | undefined} collection - The collection to iterate over. + * @param {(value: T) => value is U} callback - The function invoked per iteration. + * @returns {[U[], Array>]} Returns the array of grouped elements. + * + * @example + * partition([1, 2, 3, 4], n => n % 2 === 0); + * // => [[2, 4], [1, 3]] + */ +declare function partition(collection: ArrayLike | null | undefined, callback: ValueIteratorTypeGuard): [U[], Array>]; +/** + * Creates an array of elements split into two groups, the first of which contains elements + * predicate returns truthy for, while the second of which contains elements predicate returns falsey for. + * The predicate is invoked with one argument: (value). + * + * @template T + * @param {ArrayLike | null | undefined} collection - The collection to iterate over. + * @param {((value: T) => unknown) | PropertyKey | [PropertyKey, any] | Partial} callback - The function invoked per iteration. + * @returns {[T[], T[]]} Returns the array of grouped elements. + * + * @example + * partition([1, 2, 3, 4], n => n % 2 === 0); + * // => [[2, 4], [1, 3]] + */ +declare function partition(collection: ArrayLike | null | undefined, callback: ValueIteratee): [T[], T[]]; +/** + * Creates an array of elements split into two groups, the first of which contains elements + * predicate returns truthy for, while the second of which contains elements predicate returns falsey for. + * The predicate is invoked with one argument: (value). + * + * @template T + * @param {T | null | undefined} collection - The collection to iterate over. + * @param {((value: T[keyof T]) => unknown) | PropertyKey | [PropertyKey, any] | Partial} callback - The function invoked per iteration. + * @returns {[Array, Array]} Returns the array of grouped elements. + * + * @example + * partition({ a: 1, b: 2, c: 3 }, n => n % 2 === 0); + * // => [[2], [1, 3]] + */ +declare function partition(collection: T | null | undefined, callback: ValueIteratee): [Array, Array]; +//#endregion +export { partition }; \ No newline at end of file