@nejs/basic-extensions 2.21.5 → 2.22.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -4
- package/dist/@nejs/basic-extensions.bundle.2.22.6.js +25 -0
- package/dist/@nejs/basic-extensions.bundle.2.22.6.js.map +7 -0
- package/dist/cjs/classes/index.cjs +11129 -0
- package/dist/cjs/classes/index.cjs.map +7 -0
- package/dist/cjs/index.cjs +15191 -0
- package/dist/cjs/index.cjs.map +7 -0
- package/dist/cjs/utils/index.cjs +3954 -0
- package/dist/cjs/utils/index.cjs.map +7 -0
- package/dist/esm/basic-extensions.mjs +25 -0
- package/dist/esm/basic-extensions.mjs.map +7 -0
- package/package.json +16 -22
- package/repl.bootstrap.js +4 -7
- package/repl.history +26 -26
- package/src/classes/enumeration.js +466 -0
- package/src/classes/index.js +5 -1
- package/src/index.js +3 -1
- package/src/regular.expression.extensions.js +0 -35
- package/src/utils/toolkit.js +699 -516
- package/tests/arrayextensions.test.js +3 -3
- package/tests/index.test.js +3 -1
- package/tests/newClasses/asyncIterable.test.js +3 -3
- package/tests/newClasses/deferred.test.js +3 -3
- package/tests/newClasses/descriptor.test.js +3 -3
- package/tests/newClasses/iterable.test.js +3 -3
- package/tests/newClasses/refmap.test.js +3 -3
- package/tests/newClasses/refset.test.js +3 -3
- package/tests/objectextensions.test.js +3 -3
- package/tests/setextensions.test.js +3 -3
- package/tests/stringextensions.test.js +3 -2
- package/tests/utils/descriptor.utils.test.js +1 -1
- package/tests/utils/toolkit.test.js +429 -163
- package/.esdoc.json +0 -9
- package/.vscode/settings.json +0 -5
- package/bin/build +0 -27
- package/bin/clean +0 -14
- package/bin/esbuild +0 -91
- package/bin/fixup +0 -13
- package/bin/repl.basics.js +0 -584
- package/bin/repl.signature.js +0 -63
- package/bin/version +0 -100
- package/dist/@nejs/basic-extensions.bundle.2.21.5.js +0 -25
- package/dist/@nejs/basic-extensions.bundle.2.21.5.js.map +0 -7
- package/dist/cjs/array.extensions.d.ts +0 -39
- package/dist/cjs/array.extensions.js +0 -477
- package/dist/cjs/array.extensions.js.map +0 -1
- package/dist/cjs/big.int.extension.d.ts +0 -31
- package/dist/cjs/big.int.extension.js +0 -273
- package/dist/cjs/big.int.extension.js.map +0 -1
- package/dist/cjs/classes/asyncIterable.d.ts +0 -126
- package/dist/cjs/classes/asyncIterable.js +0 -209
- package/dist/cjs/classes/asyncIterable.js.map +0 -1
- package/dist/cjs/classes/deferred.d.ts +0 -146
- package/dist/cjs/classes/deferred.js +0 -291
- package/dist/cjs/classes/deferred.js.map +0 -1
- package/dist/cjs/classes/descriptor.d.ts +0 -334
- package/dist/cjs/classes/descriptor.js +0 -537
- package/dist/cjs/classes/descriptor.js.map +0 -1
- package/dist/cjs/classes/enum.d.ts +0 -50
- package/dist/cjs/classes/enum.js +0 -405
- package/dist/cjs/classes/enum.js.map +0 -1
- package/dist/cjs/classes/index.d.ts +0 -15
- package/dist/cjs/classes/index.js +0 -63
- package/dist/cjs/classes/index.js.map +0 -1
- package/dist/cjs/classes/introspector.d.ts +0 -20
- package/dist/cjs/classes/introspector.js +0 -130
- package/dist/cjs/classes/introspector.js.map +0 -1
- package/dist/cjs/classes/iterable.d.ts +0 -169
- package/dist/cjs/classes/iterable.js +0 -268
- package/dist/cjs/classes/iterable.js.map +0 -1
- package/dist/cjs/classes/param.parser.d.ts +0 -221
- package/dist/cjs/classes/param.parser.js +0 -242
- package/dist/cjs/classes/param.parser.js.map +0 -1
- package/dist/cjs/classes/pluggable.proxy.d.ts +0 -153
- package/dist/cjs/classes/pluggable.proxy.js +0 -444
- package/dist/cjs/classes/pluggable.proxy.js.map +0 -1
- package/dist/cjs/classes/property.d.ts +0 -79
- package/dist/cjs/classes/property.js +0 -284
- package/dist/cjs/classes/property.js.map +0 -1
- package/dist/cjs/classes/refmap.d.ts +0 -238
- package/dist/cjs/classes/refmap.js +0 -421
- package/dist/cjs/classes/refmap.js.map +0 -1
- package/dist/cjs/classes/refset.d.ts +0 -186
- package/dist/cjs/classes/refset.js +0 -370
- package/dist/cjs/classes/refset.js.map +0 -1
- package/dist/cjs/classes/symkeys.d.ts +0 -349
- package/dist/cjs/classes/symkeys.js +0 -510
- package/dist/cjs/classes/symkeys.js.map +0 -1
- package/dist/cjs/classes/type.d.ts +0 -56
- package/dist/cjs/classes/type.js +0 -405
- package/dist/cjs/classes/type.js.map +0 -1
- package/dist/cjs/function.extensions.d.ts +0 -12
- package/dist/cjs/function.extensions.js +0 -758
- package/dist/cjs/function.extensions.js.map +0 -1
- package/dist/cjs/global.this.d.ts +0 -2
- package/dist/cjs/global.this.js +0 -300
- package/dist/cjs/global.this.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -31
- package/dist/cjs/index.js +0 -228
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/json.extensions.d.ts +0 -2
- package/dist/cjs/json.extensions.js +0 -109
- package/dist/cjs/json.extensions.js.map +0 -1
- package/dist/cjs/map.extensions.d.ts +0 -3
- package/dist/cjs/map.extensions.js +0 -143
- package/dist/cjs/map.extensions.js.map +0 -1
- package/dist/cjs/math.extension.d.ts +0 -14
- package/dist/cjs/math.extension.js +0 -71
- package/dist/cjs/math.extension.js.map +0 -1
- package/dist/cjs/number.extension.d.ts +0 -44
- package/dist/cjs/number.extension.js +0 -278
- package/dist/cjs/number.extension.js.map +0 -1
- package/dist/cjs/object.extensions.d.ts +0 -33
- package/dist/cjs/object.extensions.js +0 -1091
- package/dist/cjs/object.extensions.js.map +0 -1
- package/dist/cjs/package.json +0 -3
- package/dist/cjs/proxy.extensions.d.ts +0 -2
- package/dist/cjs/proxy.extensions.js +0 -207
- package/dist/cjs/proxy.extensions.js.map +0 -1
- package/dist/cjs/reflect.extensions.d.ts +0 -14
- package/dist/cjs/reflect.extensions.js +0 -316
- package/dist/cjs/reflect.extensions.js.map +0 -1
- package/dist/cjs/regular.expression.extensions.d.ts +0 -2
- package/dist/cjs/regular.expression.extensions.js +0 -423
- package/dist/cjs/regular.expression.extensions.js.map +0 -1
- package/dist/cjs/set.extensions.d.ts +0 -40
- package/dist/cjs/set.extensions.js +0 -355
- package/dist/cjs/set.extensions.js.map +0 -1
- package/dist/cjs/string.extensions.d.ts +0 -23
- package/dist/cjs/string.extensions.js +0 -704
- package/dist/cjs/string.extensions.js.map +0 -1
- package/dist/cjs/symbol.extensions.d.ts +0 -11
- package/dist/cjs/symbol.extensions.js +0 -735
- package/dist/cjs/symbol.extensions.js.map +0 -1
- package/dist/cjs/utils/copy.object.d.ts +0 -408
- package/dist/cjs/utils/copy.object.js +0 -720
- package/dist/cjs/utils/copy.object.js.map +0 -1
- package/dist/cjs/utils/descriptor.utils.d.ts +0 -298
- package/dist/cjs/utils/descriptor.utils.js +0 -889
- package/dist/cjs/utils/descriptor.utils.js.map +0 -1
- package/dist/cjs/utils/index.d.ts +0 -75
- package/dist/cjs/utils/index.js +0 -61
- package/dist/cjs/utils/index.js.map +0 -1
- package/dist/cjs/utils/stdout.d.ts +0 -742
- package/dist/cjs/utils/stdout.js +0 -1042
- package/dist/cjs/utils/stdout.js.map +0 -1
- package/dist/cjs/utils/toolkit.d.ts +0 -1898
- package/dist/cjs/utils/toolkit.js +0 -1378
- package/dist/cjs/utils/toolkit.js.map +0 -1
- package/dist/cjs/weakref.extensions.d.ts +0 -2
- package/dist/cjs/weakref.extensions.js +0 -19
- package/dist/cjs/weakref.extensions.js.map +0 -1
- package/dist/mjs/array.extensions.d.ts +0 -39
- package/dist/mjs/array.extensions.js +0 -474
- package/dist/mjs/array.extensions.js.map +0 -1
- package/dist/mjs/big.int.extension.d.ts +0 -31
- package/dist/mjs/big.int.extension.js +0 -270
- package/dist/mjs/big.int.extension.js.map +0 -1
- package/dist/mjs/classes/asyncIterable.d.ts +0 -126
- package/dist/mjs/classes/asyncIterable.js +0 -204
- package/dist/mjs/classes/asyncIterable.js.map +0 -1
- package/dist/mjs/classes/deferred.d.ts +0 -146
- package/dist/mjs/classes/deferred.js +0 -287
- package/dist/mjs/classes/deferred.js.map +0 -1
- package/dist/mjs/classes/descriptor.d.ts +0 -334
- package/dist/mjs/classes/descriptor.js +0 -533
- package/dist/mjs/classes/descriptor.js.map +0 -1
- package/dist/mjs/classes/enum.d.ts +0 -50
- package/dist/mjs/classes/enum.js +0 -400
- package/dist/mjs/classes/enum.js.map +0 -1
- package/dist/mjs/classes/index.d.ts +0 -15
- package/dist/mjs/classes/index.js +0 -46
- package/dist/mjs/classes/index.js.map +0 -1
- package/dist/mjs/classes/introspector.d.ts +0 -20
- package/dist/mjs/classes/introspector.js +0 -126
- package/dist/mjs/classes/introspector.js.map +0 -1
- package/dist/mjs/classes/iterable.d.ts +0 -169
- package/dist/mjs/classes/iterable.js +0 -263
- package/dist/mjs/classes/iterable.js.map +0 -1
- package/dist/mjs/classes/param.parser.d.ts +0 -221
- package/dist/mjs/classes/param.parser.js +0 -238
- package/dist/mjs/classes/param.parser.js.map +0 -1
- package/dist/mjs/classes/pluggable.proxy.d.ts +0 -153
- package/dist/mjs/classes/pluggable.proxy.js +0 -438
- package/dist/mjs/classes/pluggable.proxy.js.map +0 -1
- package/dist/mjs/classes/property.d.ts +0 -79
- package/dist/mjs/classes/property.js +0 -280
- package/dist/mjs/classes/property.js.map +0 -1
- package/dist/mjs/classes/refmap.d.ts +0 -238
- package/dist/mjs/classes/refmap.js +0 -417
- package/dist/mjs/classes/refmap.js.map +0 -1
- package/dist/mjs/classes/refset.d.ts +0 -186
- package/dist/mjs/classes/refset.js +0 -366
- package/dist/mjs/classes/refset.js.map +0 -1
- package/dist/mjs/classes/symkeys.d.ts +0 -349
- package/dist/mjs/classes/symkeys.js +0 -506
- package/dist/mjs/classes/symkeys.js.map +0 -1
- package/dist/mjs/classes/type.d.ts +0 -56
- package/dist/mjs/classes/type.js +0 -401
- package/dist/mjs/classes/type.js.map +0 -1
- package/dist/mjs/function.extensions.d.ts +0 -12
- package/dist/mjs/function.extensions.js +0 -755
- package/dist/mjs/function.extensions.js.map +0 -1
- package/dist/mjs/global.this.d.ts +0 -2
- package/dist/mjs/global.this.js +0 -264
- package/dist/mjs/global.this.js.map +0 -1
- package/dist/mjs/index.d.ts +0 -31
- package/dist/mjs/index.js +0 -206
- package/dist/mjs/index.js.map +0 -1
- package/dist/mjs/json.extensions.d.ts +0 -2
- package/dist/mjs/json.extensions.js +0 -106
- package/dist/mjs/json.extensions.js.map +0 -1
- package/dist/mjs/map.extensions.d.ts +0 -3
- package/dist/mjs/map.extensions.js +0 -140
- package/dist/mjs/map.extensions.js.map +0 -1
- package/dist/mjs/math.extension.d.ts +0 -14
- package/dist/mjs/math.extension.js +0 -68
- package/dist/mjs/math.extension.js.map +0 -1
- package/dist/mjs/number.extension.d.ts +0 -44
- package/dist/mjs/number.extension.js +0 -275
- package/dist/mjs/number.extension.js.map +0 -1
- package/dist/mjs/object.extensions.d.ts +0 -33
- package/dist/mjs/object.extensions.js +0 -1088
- package/dist/mjs/object.extensions.js.map +0 -1
- package/dist/mjs/package.json +0 -3
- package/dist/mjs/proxy.extensions.d.ts +0 -2
- package/dist/mjs/proxy.extensions.js +0 -204
- package/dist/mjs/proxy.extensions.js.map +0 -1
- package/dist/mjs/reflect.extensions.d.ts +0 -14
- package/dist/mjs/reflect.extensions.js +0 -313
- package/dist/mjs/reflect.extensions.js.map +0 -1
- package/dist/mjs/regular.expression.extensions.d.ts +0 -2
- package/dist/mjs/regular.expression.extensions.js +0 -420
- package/dist/mjs/regular.expression.extensions.js.map +0 -1
- package/dist/mjs/set.extensions.d.ts +0 -40
- package/dist/mjs/set.extensions.js +0 -352
- package/dist/mjs/set.extensions.js.map +0 -1
- package/dist/mjs/string.extensions.d.ts +0 -23
- package/dist/mjs/string.extensions.js +0 -701
- package/dist/mjs/string.extensions.js.map +0 -1
- package/dist/mjs/symbol.extensions.d.ts +0 -11
- package/dist/mjs/symbol.extensions.js +0 -732
- package/dist/mjs/symbol.extensions.js.map +0 -1
- package/dist/mjs/utils/copy.object.d.ts +0 -408
- package/dist/mjs/utils/copy.object.js +0 -702
- package/dist/mjs/utils/copy.object.js.map +0 -1
- package/dist/mjs/utils/descriptor.utils.d.ts +0 -298
- package/dist/mjs/utils/descriptor.utils.js +0 -875
- package/dist/mjs/utils/descriptor.utils.js.map +0 -1
- package/dist/mjs/utils/index.d.ts +0 -75
- package/dist/mjs/utils/index.js +0 -45
- package/dist/mjs/utils/index.js.map +0 -1
- package/dist/mjs/utils/stdout.d.ts +0 -742
- package/dist/mjs/utils/stdout.js +0 -1037
- package/dist/mjs/utils/stdout.js.map +0 -1
- package/dist/mjs/utils/toolkit.d.ts +0 -1898
- package/dist/mjs/utils/toolkit.js +0 -1373
- package/dist/mjs/utils/toolkit.js.map +0 -1
- package/dist/mjs/weakref.extensions.d.ts +0 -2
- package/dist/mjs/weakref.extensions.js +0 -16
- package/dist/mjs/weakref.extensions.js.map +0 -1
- package/jsdoc-config.json +0 -31
- package/tsconfig.base.json +0 -28
- package/tsconfig.cjs.json +0 -8
- package/tsconfig.esm.json +0 -8
- package/vitest.config.js +0 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/utils/index.js", "../../../src/utils/copy.object.js", "../../../src/utils/stdout.js", "../../../src/utils/toolkit.js", "../../../src/utils/descriptor.utils.js"],
|
|
4
|
+
"sourcesContent": ["export * from './copy.object.js'\nimport {\n COPropertyHandler,\n FlexiblyHiddenHandler,\n FlexiblyVisibleHandler,\n ImmutablyHiddenHandler,\n ImmutablyVisibleHandler,\n MutablyHiddenHandler,\n MutablyVisibleHandler,\n VisibilityKeys,\n VisibilityScopeHandler,\n\n copyObject,\n customCopyObject,\n makeTransducer,\n transduceFrom,\n transduceFromCOHandler,\n tryIgnore,\n\n kVisibilityKeys,\n} from './copy.object.js'\n\nexport * from './stdout.js'\nimport {\n StringConsole,\n StringConsoleExtension,\n StdoutGlobalPatches,\n\n captureStdout,\n} from './stdout.js'\n\nexport * from './toolkit.js'\nimport {\n as,\n has,\n is,\n si,\n\n createToolkit,\n} from './toolkit.js'\n\nexport * from './descriptor.utils.js'\nimport {\n accessor,\n data,\n describe,\n describeMany,\n extract,\n isDescriptor,\n redescribe,\n kAccessorDescriptorKeys,\n kDataDescriptorKeys,\n kDescriptorKeys\n} from './descriptor.utils.js'\n\nexport default {\n COPropertyHandler,\n FlexiblyHiddenHandler,\n FlexiblyVisibleHandler,\n ImmutablyHiddenHandler,\n ImmutablyVisibleHandler,\n MutablyHiddenHandler,\n MutablyVisibleHandler,\n StdoutGlobalPatches,\n StringConsole,\n VisibilityKeys,\n VisibilityScopeHandler,\n\n as,\n has,\n is,\n si,\n\n accessor,\n captureStdout,\n copyObject,\n createToolkit,\n customCopyObject,\n data,\n describe,\n describeMany,\n extract,\n isDescriptor,\n makeTransducer,\n redescribe,\n transduceFrom,\n transduceFromCOHandler,\n tryIgnore,\n\n kAccessorDescriptorKeys,\n kDataDescriptorKeys,\n kDescriptorKeys,\n kVisibilityKeys,\n}\n", "/**\n * Transforms an array into an object using a provided transform\n * function.\n *\n * @function transduceFrom\n * @param {Array} array - The array to transform.\n * @param {Function} transform - The function used to transform each\n * element of the array. It should return an object with 'key' and\n * 'value' properties.\n * @param {Object} [into={}] - The object to transform the array into.\n * @returns {Object} The transformed object.\n * @example\n * const array = [{ id: 1, name: 'John' }, { id: 2, name: 'Jane' }]\n * const transform = (element) => ({ key: element.id, value: element.name })\n * transduceFrom(array, transform)\n * // => { 1: 'John', 2: 'Jane' }\n */\nexport function tryIgnore(code) {\n try { return code() } catch(ignore) { return undefined }\n}\n\nexport function transduceFrom(array, transform, into = {}) {\n if (typeof transform !== 'function') {\n return into\n }\n\n return array.reduce((accumulator, element) => {\n const { key, value } = (transform?.(element) ?? {})\n if (key && value) {\n accumulator[key] = value\n }\n\n return accumulator\n }, into)\n}\n\n/**\n * Transforms a COHandler instance into an object with 'key' and 'value'\n * properties.\n *\n * @function transduceFromCOHandler\n * @param {COHandler} element - The COHandler instance to transform.\n * @returns {Object} An object with 'key' and 'value' properties, where\n * 'key' is the 'property' of the COHandler instance and 'value' is\n * the COHandler instance itself.\n * @example\n * const handler = new COHandler('foo')\n * transduceFromCOHandler(handler)\n * // => { key: 'foo', value: handler }\n */\nexport function transduceFromCOHandler(element) {\n const result = {}\n\n if (element instanceof COPropertyHandler) {\n result.key = element.property\n result.value = element\n }\n\n return result\n}\n\n/**\n * Creates a transducer function by partially applying the 'array' and\n * 'transform' arguments to the 'transduceFrom' function.\n *\n * @function makeTransducer\n * @param {Array} array - The array to transform.\n * @param {Function} transform - The function used to transform each\n * element of the array.\n * @returns {Function} A transducer function that takes an 'into' object\n * and returns the result of calling 'transduceFrom' with the provided\n * 'array', 'transform', and 'into' arguments.\n * @example\n * const array = [{ id: 1, name: 'John' }, { id: 2, name: 'Jane' }]\n * const transform = (element) => ({ key: element.id, value: element.name })\n * const transducer = makeTransducer(array, transform)\n * transducer({ 3: 'Jim' })\n * // => { 1: 'John', 2: 'Jane', 3: 'Jim' }\n */\nexport function makeTransducer(array, transform) {\n return transduceFrom.bind(null, array, transform)\n}\n\n/**\n * A class for handling property descriptors during object copying.\n * @class\n * @example\n * const handler = new COPropertyHandler('foo', (prop, descriptor) => {\n * descriptor.enumerable = false\n * return descriptor\n * })\n * handler.handle('foo', { value: 42, writable: true, enumerable: true })\n * // => { value: 42, writable: true, enumerable: false }\n */\nexport class COPropertyHandler {\n /**\n * The name of the property this handler is responsible for.\n * @type {string|undefined}\n */\n property = undefined;\n\n /**\n * The property handler. When provided and invoked, it will receive\n * a the property name of the value being handled, the current\n * descriptor to transform, and the object into which values are\n * currently being copied into.\n *\n * The result must be a COPropertyHandler response type, which can\n * be made with {@link COPropertyHandler.makeResponse} and which\n * can be validated with {@link COPropertyHandler.isResponse}.\n *\n * The handler should have the following parameters\n * - {string} property - The name of the property being handled.\n * - {Object} curDescriptor - The property descriptor to handle.\n * - {Object} destination - The destination object into which\n * properties are being copied.\n *\n * An should return\n * - {Object} a `COPropertyHandler.Response` type object which\n * can be made with {@link COPropertyHandler.makeResponse}.\n *\n * @type {function|undefined}\n */\n handler = undefined;\n\n /**\n * Creates a new COPropertyHandler instance.\n * @param {string} [property] - The name of the property to handle.\n * @param {function} [handler] - The function to handle the property\n * descriptor.\n */\n constructor(property, handler) {\n Object.assign(this, { property, handler })\n }\n\n /**\n * Handles a property descriptor using the registered handler function.\n * @param {string} property - The name of the property being handled.\n * @param {Object} descriptor - The property descriptor to handle.\n * @returns {Object} The resulting property descriptor after handling.\n */\n handle(property, descriptor, destination) {\n if (this.handler) {\n return COPropertyHandler.defaultHandle(\n property,\n descriptor,\n this.handler,\n )\n }\n\n return descriptor\n }\n\n /**\n * The default property descriptor handler.\n *\n * @param {string} property - The name of the property being handled.\n * @param {Object} curDescriptor - The property descriptor to handle.\n * @param {Object} destination - The destination object into which\n * properties are being copied.\n * @param {function} handler - The function to handle the property\n * descriptor.\n * @returns {Object} a `COPropertyHandler.Response` type object which\n * can be made with {@link COPropertyHandler.makeResponse}.\n */\n static defaultHandle(property, curDescriptor, destination, handler) {\n if (typeof handler === 'function') {\n try {\n const {\n descriptor,\n flow\n } = handler(property, curDescriptor, destination)\n return this.makeResponse(descriptor, flow)\n }\n catch (ignore) { }\n }\n\n return this.makeResponse(curDescriptor)\n }\n\n /**\n * Creates a COPropertyHandler response object.\n *\n * @param {Object} descriptor - The property descriptor.\n * @param {string} [flow=COPropertyHandler.kNoChange] - The flow control\n * directive. Must be one of the values from\n * {@link COPropertyHandler.flowTypes} if provided.\n * @returns {COPropertyHandler.Response} The response object.\n * @example\n * COPropertyHandler.makeResponse({ value: 42, writable: false })\n * // => {\n * // newDescriptor: { value: 42, writable: false },\n * // flow: 'nochange'\n * // }\n */\n static makeResponse(descriptor, flow) {\n return {\n newDescriptor: descriptor,\n flow: flow ?? this.kNoChange,\n get [Symbol.toStringTag]() { return 'COPropertyHandler.Response' }\n }\n }\n\n /**\n * Checks if a value is a valid COPropertyHandler response object.\n * @param {*} value - The value to check.\n * @returns {boolean} `true` if the value is a response object, `false`\n * otherwise.\n * @example\n * COPropertyHandler.isResponse({\n * newDescriptor: { value: 42 },\n * flow: 'nochange'\n * })\n * // => true\n */\n static isResponse(value) {\n return (\n value && typeof value === 'object' &&\n value[Symbol.toStringTag] === 'COPropertyHandler.Response'\n )\n }\n\n /**\n * The flow control directive indicating no change in flow.\n * @type {string}\n */\n static get kNoChange() { return 'nochange' }\n\n /**\n * The flow control directive indicating to continue the loop.\n * @type {string}\n */\n static get kContinue() { return 'continue' }\n\n /**\n * The flow control directive indicating to break the loop.\n * @type {string}\n */\n static get kBreak() { return 'break' }\n\n /**\n * An array of all valid flow control directive values.\n * @type {string[]}\n */\n static get flowTypes() {\n return [this.kNoChange, this.kContinue, this.kBreak]\n }\n\n /**\n * An object mapping flow control directive values to their\n * corresponding string representations.\n * @type {Object.<string, string>}\n */\n static get flowEnum() {\n return {\n [this.kNoChange]: this.kNoChange,\n [this.kContinue]: this.kContinue,\n [this.kBreak]: this.kBreak,\n }\n }\n}\n\n/**\n * Returns an object containing getter functions that return Symbol\n * values representing different visibility configurations for object\n * properties.\n *\n * @function\n * @name kVisibilityKeys\n * @returns {Object} An object with the following properties:\n * @property {symbol} mutablyHidden - Returns a Symbol representing a\n * property that is not enumerable but is configurable.\n * @property {symbol} mutablyVisible - Returns a Symbol representing a\n * property that is both enumerable and configurable.\n * @property {symbol} immutablyHidden - Returns a Symbol representing\n * a property that is neither enumerable nor configurable.\n * @property {symbol} immutablyVisible - Returns a Symbol representing\n * a property that is enumerable but not configurable.\n * @property {symbol} flexiblyHidden - Returns a Symbol representing a\n * property that is not enumerable, writable and not configurable.\n * @property {symbol} flexiblyVisible - Returns a Symbol representing\n * a property that is both enumerable and writable, but not\n * configurable.\n * @property {Generator} keys - Returns a generator that yields the\n * string keys of the visibility configurations.\n * @property {Generator} symbols - Returns a generator that yields the\n * Symbol values of the visibility configurations.\n * @property {Generator} entries - Returns a generator that yields\n * [key, Symbol] pairs for each visibility configuration.\n * @property {Generator} descriptors - Returns a generator that yields\n * [key, descriptor] pairs for each visibility configuration, where\n * descriptor is the parsed JSON representation of the Symbol's\n * description.\n * @property {Generator} [Symbol.iterator] - Returns the same generator\n * as the symbols property, allowing the object to be iterated over\n * directly to access the Symbol values.\n *\n * @example\n * const { mutablyHidden, mutablyVisible } = kVisibilityKeys()\n *\n * const obj = {\n * [mutablyHidden]: 'hidden value',\n * [mutablyVisible]: 'visible value',\n * }\n *\n * console.log(obj) // { [Symbol()]: 'visible value' }\n * console.log(obj[mutablyHidden]) // 'hidden value'\n * console.log(obj[mutablyVisible]) // 'visible value'\n *\n * @example\n * const visibilityKeys = kVisibilityKeys()\n *\n * for (const key of visibilityKeys.keys()) {\n * console.log(key)\n * }\n * // Output:\n * // 'mutablyHidden'\n * // 'mutablyVisible'\n * // 'immutablyHidden'\n * // 'immutablyVisible'\n * // 'flexiblyHidden'\n * // 'flexiblyVisible'\n *\n * @example\n * const visibilityKeys = kVisibilityKeys()\n *\n * for (const symbol of visibilityKeys) {\n * console.log(symbol)\n * }\n * // Output:\n * // Symbol({\"enumerable\":false,\"configurable\":true})\n * // Symbol({\"enumerable\":true,\"configurable\":true})\n * // Symbol({\"enumerable\":false,\"configurable\":false})\n * // Symbol({\"enumerable\":true,\"configurable\":false})\n * // Symbol({\"enumerable\":false,\"writable\":true})\n * // Symbol({\"enumerable\":true,\"writable\":true})\n */\nexport function kVisibilityKeys() {\n const keys = {\n get mutablyHidden() {\n return Symbol.for(JSON.stringify({\n enumerable: false,\n configurable: true,\n }))\n },\n\n get mutablyVisible() {\n return Symbol.for(JSON.stringify({\n enumerable: true,\n configurable: true,\n }))\n },\n\n get immutablyHidden() {\n return Symbol.for(JSON.stringify({\n enumerable: false,\n configurable: false,\n }))\n },\n\n get immutablyVisible() {\n return Symbol.for(JSON.stringify({\n enumerable: true,\n configurable: false,\n }))\n },\n\n get flexiblyHidden() {\n return Symbol.for(JSON.stringify({\n enumerable: false,\n configurable: false,\n writable: true,\n }))\n },\n\n get flexiblyVisible() {\n return Symbol.for(JSON.stringify({\n enumerable: true,\n configurable: false,\n writable: true,\n }))\n },\n }\n\n const enumerated = {\n mutablyHidden: keys.mutablyHidden,\n mutablyVisible: keys.mutablyVisible,\n immutablyHidden: keys.immutablyHidden,\n immutablyVisible: keys.immutablyVisible,\n flexiblyHidden: keys.flexiblyHidden,\n flexiblyVisible: keys.flexiblyVisible,\n }\n\n function *keyGenerator() {\n for (const key of Object.keys(enumerated)) { yield key }\n }\n\n function *symbolGenerator() {\n for (const value of Object.values(enumerated)) { yield value }\n }\n\n function *entryGenerator() {\n for (const entry of Object.entries(enumerated)) { yield entry }\n }\n\n function *descriptorGenertor() {\n for (const [key, value] of entryGenerator()) {\n yield [key, JSON.parse(value.description)]\n }\n }\n\n Object.defineProperties(keys, {\n enumeration: { get() { return enumerated }, enumerable: false },\n keys: { get() { return keyGenerator() }, enumerable: false },\n symbols: { get() { return symbolGenerator() }, enumerable: false},\n entries: { get() { return entryGenerator() }, enumerable: false},\n descriptors: { get() { return descriptorGenertor() }, enumerable: false },\n descriptorFor: {\n value(symbol) {\n try {\n return JSON.parse(symbol.description)\n }\n catch (ignored) {}\n return undefined\n },\n enumerable: false\n },\n [Symbol.iterator]: { get() { return symbolGenerator() } },\n })\n\n return keys\n}\n\n/**\n * An object containing Symbol values representing different visibility\n * configurations for object properties.\n *\n * @constant {Object} VisibilityKeys\n * @property {symbol} mutablyHidden - A Symbol representing a property\n * that is not enumerable but is configurable.\n * @property {symbol} mutablyVisible - A Symbol representing a property\n * that is both enumerable and configurable.\n * @property {symbol} immutablyHidden - A Symbol representing a property\n * that is neither enumerable nor configurable.\n * @property {symbol} immutablyVisible - A Symbol representing a property\n * that is enumerable but not configurable.\n * @property {symbol} flexiblyHidden - A Symbol representing a property\n * that is not enumerable, writable and not configurable.\n * @property {symbol} flexiblyVisible - A Symbol representing a property\n * that is both enumerable and writable, but not configurable.\n */\nexport const VisibilityKeys = kVisibilityKeys()\n\n/**\n * A class for handling property descriptors during object copying based\n * on a specified visibility key.\n *\n * @class VisibilityScopeHandler\n * @extends COPropertyHandler\n * @param {symbol} visibilityKey - The visibility key to use for handling\n * property descriptors.\n * @example\n * const handler = new VisibilityScopeHandler(VisibilityKeys.mutablyHidden)\n * handler.handle('foo', { value: 42, writable: true, enumerable: true })\n * // => { value: 42, writable: true, enumerable: false }\n */\nexport class VisibilityScopeHandler extends COPropertyHandler {\n overrides = undefined;\n\n /**\n * Creates a new VisibilityScopeHandler instance.\n *\n * @constructor\n * @param {symbol} visibilityKey - The visibility key to use for handling\n * property descriptors.\n */\n constructor(visibilityKey) {\n super(visibilityKey, (property, descriptor, dest, source) => {\n let data = descriptor?.value\n if (!descriptor || typeof descriptor.value !== 'object') {\n return COPropertyHandler.makeResponse(descriptor, 'nochange')\n }\n\n if (!data && (descriptor?.get || descriptor?.set)) {\n const newDescriptor = this.applyOverridesTo(descriptor)\n return COPropertyHandler.makeResponse(newDescriptor, 'nochange')\n }\n\n data = customCopyObject({deep: false}, {}, data ?? {})\n this.walkAndApply(data)\n descriptor.value = data\n\n return COPropertyHandler.makeResponse(descriptor, 'continue')\n })\n\n tryIgnore(() => this.overrides = JSON.parse(property.description))\n }\n\n applyOverridesTo(existingDescriptor, overwrite = false) {\n const allowed = ['value','get','set','writable','configurable','enumerable']\n const output = overwrite ? existingDescriptor : { ...existingDescriptor }\n for (let [key, value] of Object.entries(this.overrides ?? {})) {\n if (!~allowed.indexOf(key)) {\n continue\n }\n\n if (!(\n ['get','set'].some(k => k === key) &&\n ['undefined', 'function'].some(t => typeof value === t)\n )) {\n continue\n }\n\n if (!(\n ['enumerable','configurable','writable'].some(k => k === key) &&\n typeof value !== 'boolean'\n )) {\n value = !!value\n }\n\n delete output[key]\n output[key] = value\n }\n return output\n }\n\n walkAndApply(to) {\n Reflect.ownKeys(to).forEach(key => {\n tryIgnore(() => {\n let result = Object.getOwnPropertyDescriptor(to, key)\n this.applyOverridesTo(result, true)\n Object.defineProperty(to, key, result)\n })\n })\n }\n}\n\n/**\n * A handler for mutably visible properties during object copying.\n * @class\n * @extends VisibilityScopeHandler\n * @example\n * const handler = new MutablyVisibleHandler()\n * const sharedHandler = MutablyVisibleHandler.shared\n */\nexport class MutablyVisibleHandler extends VisibilityScopeHandler {\n constructor() { super(VisibilityKeys.mutablyVisible) }\n static get shared() {\n return this.#singleton ?? (this.#singleton = new this)\n }\n static #singleton\n}\n\n/**\n * A handler for mutably hidden properties during object copying.\n * @class\n * @extends VisibilityScopeHandler\n * @example\n * const handler = new MutablyHiddenHandler()\n * const sharedHandler = MutablyHiddenHandler.shared\n */\nexport class MutablyHiddenHandler extends VisibilityScopeHandler {\n constructor() { super(VisibilityKeys.mutablyHidden) }\n static get shared() {\n return this.#singleton ?? (this.#singleton = new this)\n }\n static #singleton\n}\n\n/**\n * A handler for immutably visible properties during object copying.\n * @class\n * @extends VisibilityScopeHandler\n * @example\n * const handler = new ImmutablyVisibleHandler()\n * const sharedHandler = ImmutablyVisibleHandler.shared\n */\nexport class ImmutablyVisibleHandler extends VisibilityScopeHandler {\n constructor() { super(VisibilityKeys.immutablyVisible) }\n static get shared() {\n return this.#singleton ?? (this.#singleton = new this)\n }\n static #singleton\n}\n\n/**\n * A handler for immutably hidden properties during object copying.\n * @class\n * @extends VisibilityScopeHandler\n * @example\n * const handler = new ImmutablyHiddenHandler()\n * const sharedHandler = ImmutablyHiddenHandler.shared\n */\nexport class ImmutablyHiddenHandler extends VisibilityScopeHandler {\n constructor() { super(VisibilityKeys.immutablyHidden) }\n static get shared() {\n return this.#singleton ?? (this.#singleton = new this)\n }\n static #singleton\n}\n\n/**\n * A handler for flexibly visible properties during object copying.\n * @class\n * @extends VisibilityScopeHandler\n * @example\n * const handler = new FlexiblyVisibleHandler()\n * const sharedHandler = FlexiblyVisibleHandler.shared\n */\nexport class FlexiblyVisibleHandler extends VisibilityScopeHandler {\n constructor() { super(VisibilityKeys.flexiblyVisible) }\n static get shared() {\n return this.#singleton ?? (this.#singleton = new this)\n }\n static #singleton\n}\n\n/**\n * A handler for flexibly hidden properties during object copying.\n * @class\n * @extends VisibilityScopeHandler\n * @example\n * const handler = new FlexiblyHiddenHandler()\n * const sharedHandler = FlexiblyHiddenHandler.shared\n */\nexport class FlexiblyHiddenHandler extends VisibilityScopeHandler {\n constructor() { super(VisibilityKeys.flexiblyHidden) }\n static get shared() {\n return this.#singleton ?? (this.#singleton = new this)\n }\n static #singleton\n}\n\nObject.defineProperties(COPropertyHandler, {\n MutablyHiddenHandler: { get() { return MutablyHiddenHandler.shared } },\n MutablyVisibleHandler: { get() { return MutablyVisibleHandler.shared } },\n ImmutablyHiddenHandler: { get() { return ImmutablyHiddenHandler.shared } },\n ImmutablyVisibleHandler: { get() { return ImmutablyVisibleHandler.shared } },\n FlexiblyHiddenHandler: { get() { return FlexiblyHiddenHandler.shared } },\n FlexiblyVisibleHandler: { get() { return FlexiblyVisibleHandler.shared } },\n handlers: {\n value: [\n MutablyHiddenHandler, MutablyVisibleHandler, ImmutablyHiddenHandler,\n ImmutablyVisibleHandler, FlexiblyHiddenHandler, FlexiblyVisibleHandler,\n ].map(klass => klass.shared),\n configurable: true,\n enumerable: true\n },\n})\n\n/**\n * Creates a deep or shallow copy of the provided source objects and merges\n * them into the destination object. The function uses a Set to keep track\n * of visited objects to avoid circular references.\n *\n * @function\n * @name copyObject\n * @param {boolean} deep - If true, performs a deep copy, otherwise performs\n * a shallow copy.\n * @param {object} destination - The object to which properties will be copied.\n * @param {...object} sources - The source object(s) from which properties\n * will be copied.\n * @returns {object} The destination object with the copied properties.\n *\n * @example\n* // Shallow copy\n* const obj1 = { a: 1, b: { c: 2 } };\n* const obj2 = { b: { d: 3 }, e: 4 };\n* const result = copyObject(false, obj1, obj2);\n* console.log(result); // Output: { a: 1, b: { d: 3 }, e: 4 }\n*\n* @example\n* // Deep copy\n* const obj1 = { a: 1, b: { c: 2 } };\n* const obj2 = { b: { d: 3 }, e: 4 };\n* const result = copyObject(true, obj1, obj2);\n* console.log(result); // Output: { a: 1, b: { c: 2, d: 3 }, e: 4 }\n*/\nexport function copyObject(deep, destination, ...sources) {\n const options = {\n deep: deep || false,\n propertyHandlers: COPropertyHandler?.handlers ?? [],\n }\n\n return customCopyObject(options, destination, ...sources)\n}\n\nexport function customCopyObject(_options, _destination, ..._sources) {\n const visited = new Set()\n const [options, destination, sources] = ccoParseArgs(\n _options, _destination, ..._sources\n )\n\n let { deep } = options\n\n for (const source of sources) {\n if (source === null || typeof source !== 'object' || visited.has(source)) {\n continue\n }\n\n visited.add(source)\n const keys = Reflect.ownKeys(source)\n for (let key of keys) {\n let descriptor\n\n try {\n descriptor = Object.getOwnPropertyDescriptor(source, key)\n } catch (err) {\n console.warn(`Failed to get descriptor for key \"${key}\": ${err}`)\n continue\n }\n\n const isDataDesc = Reflect.has(descriptor, 'value')\n const keyedValue = descriptor?.value\n\n const conditionsMet = [\n isDataDesc,\n keyedValue,\n typeof keyedValue === 'object',\n !visited.has(keyedValue)\n ].every(condition => condition)\n\n if (conditionsMet) {\n visited.add(keyedValue)\n\n const prototype = Object.getPrototypeOf(keyedValue)\n const descriptors = Object.getOwnPropertyDescriptors(keyedValue)\n const replacement = Object.create(prototype, descriptors)\n\n descriptor.value = deep\n ? customCopyObject(options, replacement, keyedValue)\n : replacement\n }\n\n try {\n Object.defineProperty(destination, key, descriptor)\n } catch (err) {\n console.error(`Failed to define property \"${key}\": ${err}`)\n }\n }\n}\n\n return destination\n}\n\nfunction ccoParseArgs(options, destination, ...sources) {\n // Parse options\n let { deep = true, propertyHandlers = [] } = options\n\n // Ensure boolean'ness\n deep = !!deep\n\n // Ensure propertyHandlers are converted for our ease of use\n // Transform 1: Ensure array of COPropertyHandlers at the\n // cost of potentially having none\n propertyHandlers = (Array.isArray(propertyHandlers)\n ? propertyHandlers\n : [propertyHandlers]\n ).filter(element => element instanceof COPropertyHandler)\n\n // Transform 2: Convert array of handlers into an object keyed\n // as { [handler.property]: handler }\n const transducer = makeTransducer(propertyHandlers, transduceFromCOHandler)\n propertyHandlers = transducer({})\n\n // Rebuild options in the case that we recurse\n options = { deep, propertyHandlers }\n\n // Ensure sources have only objects\n sources = sources.filter(source => source && typeof source === 'object')\n\n // Ensure the destination is not null\n if (!destination) {\n destination = {}\n }\n\n return [ options, destination, sources ]\n}\n\nexport default copyObject", "import { Extension, Patch } from '@nejs/extension'\n\n/**\n * Captures the output written to `process.stdout` during the execution of\n * a callback function. This function temporarily overrides the standard\n * output stream to capture any data written to it, allowing for inspection\n * or testing of console output.\n *\n * @param {Function|*} callback - The function to execute, during which\n * `process.stdout` is captured. If not a function, it will be treated\n * as the first argument to a console log.\n * @param {Array} [args=[]] - Arguments to pass to the callback function.\n * @param {Object} [thisArg=console] - The value of `this` provided for\n * the call to `callback`.\n * @returns {string} The captured output from `process.stdout`.\n *\n * @example\n * const output = captureStdout(() => {\n * console.log('Hello, World!')\n * })\n * console.log(output) // Outputs: 'Hello, World!'\n *\n * @description\n * This function is useful for testing or capturing console output without\n * displaying it in the terminal. It works by temporarily replacing\n * `process.stdout.write` with a custom function that appends output to a\n * string. After the callback is executed, the original `process.stdout.write`\n * is restored.\n */\nexport function captureStdout(callback, args = [], thisArg = console) {\n let captured = ''\n const originalWrite = process.stdout.write\n\n if (typeof callback !== 'function') {\n let newArgs = [callback]\n\n if (thisArg) {\n newArgs.push(thisArg)\n }\n\n newArgs = newArgs.concat(args)\n\n callback = function () {\n console.log(...newArgs)\n }\n\n thisArg = console\n args = []\n }\n\n process.stdout.write = (chunk, encoding, callback) => {\n captured += chunk\n }\n\n try {\n callback.apply(thisArg, args)\n } finally {\n process.stdout.write = originalWrite\n }\n\n return captured.substring(0, captured.length - 1)\n}\n\n/**\n * A class that simulates a console for capturing and manipulating console\n * output as strings. This class provides methods to log messages, format\n * them with colors, and store them in a buffer for later inspection or\n * manipulation.\n *\n * @example\n * const stringConsole = new StringConsole()\n * stringConsole.log('Hello, World!')\n * stringConsole.buffer // ['Hello, World!']\n *\n * @description\n * The StringConsole class is designed to capture console output without\n * displaying it in the terminal. It stores the output in a buffer, allowing\n * for easy retrieval and manipulation. This is particularly useful for\n * testing or when console output needs to be processed programmatically.\n */\nexport class StringConsole {\n /**\n * @type {Array}\n * @description\n * The buffer array is used to store captured console output. It is\n * initialized as an empty array and can be populated with strings\n * representing console messages. This buffer serves as a temporary\n * storage for output that can be manipulated or inspected later.\n *\n * @example\n * const console = new StringConsole()\n * console.buffer.push('Hello, World!')\n * console.buffer // ['Hello, World!']\n */\n buffer = [];\n\n /**\n * The last index of the buffer when capture began. This number should be\n * set to `NaN` when not in use.\n *\n * @type {number|NaN}\n */\n capturedAt = NaN\n\n /**\n * If this is `true`, all \"logged\" output will be captured in an ever\n * growing buffer.\n *\n * @type {boolean}\n * @see {@link StringConsole.buffer}\n */\n captureOutput = true;\n\n /**\n * @typedef {\n * Int8Array|Int16Array|Int32Array|Float32Array|Float64Array\n * } TypedArray\n */\n\n /**\n * @typedef {(\n * chunk: string|Buffer|TypedArray|DataView,\n * encoding: string|null,\n * callback: ()=>{}\n * )=>boolean} StringConsoleRecorder\n * @property {boolean} [Symbol.for('StringConsole.recorder')]\n */\n\n /**\n * The recorder function is what is subsituted for the `process.stdout.write`\n * function whenever we need to temporarily capture the output of data bound\n * for the bidirectional read-write stream, `stdout`.\n *\n * @type {StringConsoleRecorder}\n * @param {string|Buffer|TypedArray|DataView|any} chunk Optional data to\n * write. For streams not operating in object mode, chunk must be a\n * {@link String}, {@link Buffer}, {@link Int8Array}, {@link Int16Array},\n * {@link Int32Array}, {@link Float32Array}, {@link Float64Array} or\n * {@link DataView}. For object mode streams, chunk may be any JavaScript\n * value other than `null`.\n * @param {string|null} encoding the encoding, if chunk is a string.\n * Default: `'utf8'`\n * @param {Function} callback callback for when this chunk of data is\n * flushed.\n *\n * @returns {boolean} false if the stream wishes for the calling code to\n * wait for the 'drain' event to be emitted before continuing to write\n * additional data; otherwise true.\n */\n recorder = Object.defineProperty(\n function recorder(chunk, encoding, callback) { this.buffer.push(chunk) },\n Symbol.for(`StringConsole.recorder`),\n { value: true, configurable: true }\n );\n\n /**\n * Initializes a new instance of the StringConsole class.\n *\n * @param {string|string[]} [initialContents] - The initial contents to\n * populate the buffer. If an array is provided, it will be used directly\n * as the buffer. If a single string is provided, it will be converted\n * to a string and added to the buffer.\n *\n * @example\n * const console1 = new StringConsole('Hello')\n * console1.buffer // ['Hello']\n *\n * const console2 = new StringConsole(['Hello', 'World'])\n * console2.buffer // ['Hello', 'World']\n */\n constructor(captureOutput = true, initialContents = undefined) {\n this.recorder = this.recorder.bind(this)\n\n if (Array.isArray(initialContents))\n this.buffer = initialContents\n\n else if (initialContents)\n this.buffer.push(String(initialContents))\n }\n\n /**\n * Clears the buffer by removing all elements.\n *\n * This method utilizes the `splice` function to remove all elements\n * from the buffer array, effectively resetting it to an empty state.\n * This is useful when you want to discard all previously captured\n * console output and start fresh.\n *\n * @returns {StringConsole} `this` to allow for calling `clear()`\n * before immediately invoking a console method.\n *\n * @example\n * const console = new StringConsole(['Hello', 'World'])\n * console.clear()\n * console.buffer // []\n */\n clear() {\n this.buffer.splice(0, this.buffer.length)\n\n return this\n }\n\n\n /**\n * Checks if the console output is currently being captured.\n *\n * This method determines if the `process.stdout.write` function has been\n * overridden to capture console output by checking for the presence of\n * a specific symbol.\n *\n * @returns {boolean} True if capturing is active, false otherwise.\n *\n * @example\n * const stringConsole = new StringConsole()\n * stringConsole.startCapture()\n * console.log(stringConsole.isCapturing()) // Stores 'true' in the buffer\n */\n isCapturing() {\n return Reflect.has(\n process.stdout.write,\n Symbol.for('StringConsole.recorder')\n )\n }\n\n /**\n * Starts capturing console output.\n *\n * This method overrides the `process.stdout.write` function with a custom\n * recorder function to capture all console output.\n *\n * @returns {number} the last index of the buffer in its current state or\n * 0 if it is empty\n *\n * @example\n * const stringConsole = new StringConsole()\n * stringConsole.startCapture()\n * console.log('This will be stored in stringConsole.buffer')\n */\n startCapture() {\n if (this.captureOutput === false)\n this.buffer = []\n\n process.stdout.write = this.recorder\n process.stderr.write = this.recorder\n this.capturedAt = this.buffer.length ? this.buffer.length : 0\n\n return this.capturedAt\n }\n\n /**\n * An object containing two properties covering the captured content\n * while `process.stdout.write` was swapped. It should contain the\n * range of line indicies as well as the content as an array of strings\n *\n * @typedef {object} StringConsoleCapturedOutput\n * @property {number[]} range an array of two numbers, a starting index\n * and an ending index. This value will be [NaN,NaN] if this instance\n * has indicated that storing captured output is disabled.\n * @property {string[]} lines an array of strings of captured output\n * that occurred in between calls to {@link ~startCapture} and then\n * ending call to {@link ~stopCapture}\n */\n\n /**\n * Stops capturing console output.\n *\n * This method restores the original `process.stdout.write` function,\n * ceasing the capture of console output.\n *\n * @returns {StringConsoleCapturedOutput} the range of indices capturing\n * the lines of the buffer that have been added since capturing was\n * started.\n *\n * @example\n * const stringConsole = new StringConsole()\n * stringConsole.startCapture()\n * console.log('This will be stored in stringConsole.buffer')\n * stringConsole.stopCapture()\n * console.log('This will not be captured')\n */\n stopCapture() {\n const range = [this.capturedAt || 0, this.buffer.length - 1]\n const lines = this.buffer.slice(range[0], range[1] + 1)\n\n if (this.captureOutput === false)\n this.buffer = []\n\n process.stdout.write = StringConsole[Symbol.for('process.stdout.write')]\n process.stderr.write = StringConsole[Symbol.for('process.stderr.write')]\n this.capturedAt = NaN\n\n return { range, lines }\n }\n\n /**\n * Joins the StringConsole output as a single string. By default, each entry\n * captured so far is joined on a new line. Pass a different joiner such as\n * an empty string or a whitespace character, as examples, to change the\n * output string.\n *\n * @param {string} joinOn the string to join the output buffer on, defaults\n * to a new line character\n * @returns a single string of contatenated entries so far to this buffer.\n */\n toString(joinOn = '') {\n return this.buffer.join(joinOn)\n }\n\n /**\n * Captures formatted debug messages as though they'd been printed. The\n * resulting output that would have been printed is stored in the buffer\n * as well as being returned.\n *\n * This method formats the provided arguments with color coding specific\n * to the 'debug' level as though `console.debug` were used. The output\n * is captured and stored in the buffer for later inspection, but not\n * actually printed to the standard output.\n *\n * @param {any[]} args - The arguments to be log captured. These can be\n * of any type and will be formatted with color coding without being logged.\n *\n * @returns {string} The captured console output as a string.\n *\n * @example\n * const stringConsole = new StringConsole()\n * stringConsole.debug('[debug]', 'message')\n * stringConsole.buffer // Contains the captured messages so far as an array\n */\n debug(...args) {\n args = this.constructor.colorArgs('debug', args)\n\n this.startCapture()\n console.debug(...args)\n\n return this.stopCapture().lines.join('\\n')\n }\n\n /**\n * Captures formatted error messages as though they'd been printed. The\n * resulting output that would have been printed is stored in the buffer\n * as well as being returned.\n *\n * This method formats the provided arguments with color coding specific\n * to the 'error' level as though `console.error` were used. The output\n * is captured and stored in the buffer for later inspection, but not\n * actually printed to the standard output.\n *\n * @param {any[]} args - The arguments to be log captured. These can be\n * of any type and will be formatted with color coding without being logged.\n *\n * @returns {string} The captured console output as a string.\n *\n * @example\n * const stringConsole = new StringConsole()\n * stringConsole.error('[error]', 'message')\n * stringConsole.buffer // Contains the captured messages so far as an array\n */\n error(...args) {\n args = this.constructor.colorArgs('error', args)\n\n this.startCapture()\n console.error(...args)\n\n return this.stopCapture().lines.join('\\n')\n }\n\n /**\n * Groups console output under a specified group name and captures the\n * output. No content will actually be logged to the console, just\n * the output that normally would be is formatted in a string and returned\n * instead.\n *\n * This method allows you to format multiple messages under a single\n * group name. It captures the output of each invocation and stores it in\n * a buffer. The captured output is returned as a single string.\n *\n * @param {string} groupName - The name of the group under which the\n * messages will be logged.\n * @param {...Array} invocations - An array of invocations where each\n * invocation is an array. The first element is the log level (e.g.,\n * 'log', 'info'), and the remaining elements are the arguments to be\n * logged.\n *\n * @returns {string} The captured console output as a string.\n *\n * @example\n * const console = new StringConsole()\n * const output = console.group('MyGroup',\n * ['log', 'Hello'],\n * ['warn', 'Warning!']\n * )\n *\n * console.buffer // Contains the captured group output\n */\n group(groupName, ...invocations) {\n const commands = ['log', 'info', 'warn', 'error', 'debug', 'trace']\n const buffer = []\n\n invocations = invocations.filter(i => commands.includes(i?.[0]))\n\n if (groupName)\n groupName = this.constructor.style(groupName, ['underline', 'bold'])\n else\n groupName = this.constructor.style('grouped', ['underline', 'bold'])\n\n this.startCapture()\n console.group(groupName)\n\n for (const invocation of invocations) {\n if (!Array.isArray(invocation) || invocation.length < 2)\n continue\n\n const [level, ...args] = invocation\n console[level](...this.constructor.colorArgs(level, args))\n }\n\n console.groupEnd(groupName)\n\n return this.stopCapture().lines.join('')\n }\n\n /**\n * Captures formatted info messages as though they'd been printed. The\n * resulting output that would have been printed is stored in the buffer\n * as well as being returned.\n *\n * This method formats the provided arguments with color coding specific\n * to the 'info' level as though `console.info` were used. The output\n * is captured and stored in the buffer for later inspection, but not\n * actually printed to the standard output.\n *\n * @param {any[]} args - The arguments to be log captured. These can be\n * of any type and will be formatted with color coding without being logged.\n *\n * @returns {string} The captured console output as a string.\n *\n * @example\n * const stringConsole = new StringConsole()\n * stringConsole.info('[info]', 'message')\n * stringConsole.buffer // Contains the captured messages so far as an array\n */\n info(...args) {\n args = this.constructor.colorArgs('info', args)\n\n this.startCapture()\n console.info(...args)\n\n return this.stopCapture().lines.join('\\n')\n }\n\n /**\n * Captures formatted log messages as though they'd been printed. The\n * resulting output that would have been printed is stored in the buffer\n * as well as being returned.\n *\n * This method formats the provided arguments with color coding specific\n * to the 'log' level as though `console.log` were used. The output\n * is captured and stored in the buffer for later inspection, but not\n * actually printed to the standard output.\n *\n * @param {any[]} args - The arguments to be log captured. These can be\n * of any type and will be formatted with color coding without being logged.\n *\n * @returns {string} The captured console output as a string.\n *\n * @example\n * const stringConsole = new StringConsole()\n * stringConsole.log('[log]', 'message')\n * stringConsole.buffer // Contains the captured messages so far as an array\n */\n log(...args) {\n args = this.constructor.colorArgs('log', args)\n\n this.startCapture()\n console.log(...args)\n\n return this.stopCapture().lines.join('\\n')\n }\n\n /**\n * Captures formatted trace messages as though they'd been printed. The\n * resulting output that would have been printed is stored in the buffer\n * as well as being returned.\n *\n * This method formats the provided arguments with color coding specific\n * to the 'trace' level as though `console.trace` were used. The output\n * is captured and stored in the buffer for later inspection, but not\n * actually printed to the standard output.\n *\n * @param {any[]} args - The arguments to be log captured. These can be\n * of any type and will be formatted with color coding without being logged.\n *\n * @returns {string} The captured console output as a string.\n *\n * @example\n * const stringConsole = new StringConsole()\n * stringConsole.trace('[trace]', 'message')\n * stringConsole.buffer // Contains the captured messages so far as an array\n */\n trace(...args) {\n args = this.constructor.colorArgs('trace', args)\n\n this.startCapture()\n console.trace(...args)\n\n return this.stopCapture().lines.join('\\n')\n }\n\n /**\n * Captures formatted warn messages as though they'd been printed. The\n * resulting output that would have been printed is stored in the buffer\n * as well as being returned.\n *\n * This method formats the provided arguments with color coding specific\n * to the 'warn' level as though `console.warn` were used. The output\n * is captured and stored in the buffer for later inspection, but not\n * actually printed to the standard output.\n *\n * @param {any[]} args - The arguments to be log captured. These can be\n * of any type and will be formatted with color coding without being logged.\n *\n * @returns {string} The captured console output as a string.\n *\n * @example\n * const stringConsole = new StringConsole()\n * stringConsole.warn('[warn]', 'message')\n * stringConsole.buffer // Contains the captured messages so far as an array\n */\n warn(...args) {\n args = this.constructor.colorArgs('warn', args)\n\n this.startCapture()\n console.warn(...args)\n\n return this.stopCapture().lines.join('\\n')\n }\n\n /**\n * Captures a single line of text that would be logged to the console if\n * the console function of the same name were to be invoked. The string\n * is formatted according to the log colors, or any pre-existing colors as\n * those are untouched. After formatting, the string is returned.\n *\n * @param {...*} args the arguments to be logged. These can be of any\n * type and will be passed to the underlying console's method of the same\n * name.\n *\n * @returns {string}\n *\n * @example\n * const string = StringConsole.debug('[debug]: %o', someVariable)\n */\n static debug(...args) {\n return this.#console.clear().debug(...args)\n }\n\n /**\n * Captures a single line of text that would be logged to the console if\n * the console function of the same name were to be invoked. The string\n * is formatted according to the log colors, or any pre-existing colors as\n * those are untouched. After formatting, the string is returned.\n *\n * @param {...*} args the arguments to be logged. These can be of any\n * type and will be passed to the underlying console's method of the same\n * name.\n *\n * @returns {string}\n *\n * @example\n * const string = StringConsole.error('[error]: %o', someVariable)\n */\n static error(...args) {\n return this.#console.clear().error(...args)\n }\n\n /**\n * Groups console output under a specified group name and captures the\n * output. No content will actually be logged to the console, just\n * the output that normally would be is formatted in a string and returned\n * instead.\n *\n * This method allows you to format multiple messages under a single\n * group name. It captures the output of each invocation and stores it in\n * a buffer. The captured output is returned as a single string.\n *\n * @param {string} groupName - The name of the group under which the\n * messages will be logged.\n * @param {...Array} invocations - An array of invocations where each\n * invocation is an array. The first element is the log level (e.g.,\n * 'log', 'info'), and the remaining elements are the arguments to be\n * logged.\n *\n * @returns {string} The captured console output as a string.\n *\n * @example\n * const console = new StringConsole()\n * const output = console.group('MyGroup',\n * ['log', 'Hello'],\n * ['warn', 'Warning!']\n * )\n *\n * console.buffer // Contains the captured group output\n */\n static group(groupName, ...invocations) {\n return this.#console.clear().group(groupName, ...invocations)\n }\n\n /**\n * Captures a single line of text that would be logged to the console if\n * the console function of the same name were to be invoked. The string\n * is formatted according to the log colors, or any pre-existing colors as\n * those are untouched. After formatting, the string is returned.\n *\n * @param {...*} args the arguments to be logged. These can be of any\n * type and will be passed to the underlying console's method of the same\n * name.\n *\n * @returns {string}\n *\n * @example\n * const string = StringConsole.info('[info]: %o', someVariable)\n */\n static info(...args) {\n return this.#console.clear().info(...args)\n }\n\n /**\n * Captures a single line of text that would be logged to the console if\n * the console function of the same name were to be invoked. The string\n * is formatted according to the log colors, or any pre-existing colors as\n * those are untouched. After formatting, the string is returned.\n *\n * @param {...*} args the arguments to be logged. These can be of any\n * type and will be passed to the underlying console's method of the same\n * name.\n *\n * @returns {string}\n *\n * @example\n * const string = StringConsole.log('[log]: %o', someVariable)\n */\n static log(...args) {\n return this.#console.clear().log(...args)\n }\n\n /**\n * Captures a single line of text that would be logged to the console if\n * the console function of the same name were to be invoked. The string\n * is formatted according to the log colors, or any pre-existing colors as\n * those are untouched. After formatting, the string is returned.\n *\n * @param {...*} args the arguments to be logged. These can be of any\n * type and will be passed to the underlying console's method of the same\n * name.\n *\n * @returns {string}\n *\n * @example\n * const string = StringConsole.trace('[trace]: %o', someVariable)\n */\n static trace(...args) {\n return this.#console.clear().trace(...args)\n }\n\n /**\n * Captures a single line of text that would be logged to the console if\n * the console function of the same name were to be invoked. The string\n * is formatted according to the log colors, or any pre-existing colors as\n * those are untouched. After formatting, the string is returned.\n *\n * @param {...*} args the arguments to be logged. These can be of any\n * type and will be passed to the underlying console's method of the same\n * name.\n *\n * @returns {string}\n *\n * @example\n * const string = StringConsole.warn('[warn]: %o', someVariable)\n */\n static warn(...args) {\n return this.#console.clear().warn(...args)\n }\n\n /**\n * Internal instance of {@link StringConsole} used for static logging\n * methods.\n *\n * @type {StringConsole}\n */\n static #console = new StringConsole(false);\n\n /**\n * A static map defining color codes for console output. Each color is\n * associated with an array containing two numbers, which represent\n * the ANSI escape codes for styling text in the terminal.\n *\n * The first number in the array is the suffix code for the standard\n * color, while the second number suffix code to undo the color. These\n * codes are useless without the pen prefix code.\n *\n * @type {Map<string, number[]>}\n * @see {@link StringConsole.pens}\n *\n * @example\n * // Accessing the color codes for 'red'\n * const redCodes = StringConsole.colors.get('red')\n * const fgCodes = StringConsole.pens.get('foreground')\n * const prefix = `\\x1b[${fgCodes[0]}${redCodes[0]}m`\n * const suffix = `\\x1b[${fgCodes[1]}${redCodes[1]}m`\n * // Outputs: \"Text\" in red but \"!!\" in the default color\n * console.log(`${prefix}Text!!${suffix}`)\n *\n * @description\n * This map is used to apply color coding to console messages, enhancing\n * readability and providing visual cues for different log levels.\n */\n static colors = new Map([\n ['black', [0, 9]],\n ['red', [1, 9]],\n ['green', [2, 9]],\n ['yellow', [3, 9]],\n ['blue', [4, 9]],\n ['magenta', [5, 9]],\n ['cyan', [6, 9]],\n ['white', [7, 9]]\n ])\n\n /**\n * A static map defining the color schemes for different logging levels.\n * Each log level is associated with an array of color styles that are\n * applied to the console output for that level.\n *\n * The available log levels and their corresponding color styles are:\n * - 'log': White\n * - 'info': Cyan\n * - 'warn': Yellow\n * - 'error': Red\n * - 'trace': Magenta\n * - 'debug': Bold Yellow\n *\n * @type {Map<string, string[]>}\n *\n * @example\n * const logColor = StringConsole.levels.get('log') // ['white']\n * const errorColor = StringConsole.levels.get('error') // ['red']\n */\n static levels = Object.defineProperties(new Map([\n ['log', ['white']],\n ['info', ['cyan']],\n ['warn', ['yellow']],\n ['error', ['red']],\n ['trace', ['magenta']],\n ['debug', ['bold', 'yellow']]\n ]), {\n color: {\n value: function color(key) {\n for (const value of this.get(key)) {\n if (StringConsole.colors.has(value)) {\n return StringConsole.colors.get(value)\n }\n }\n\n return StringConsole.colors.get('white')\n },\n configurable: true,\n },\n\n styles: {\n value: function styles(key) {\n const styles = []\n\n for (const value of this.get(key)) {\n if (StringConsole.styles.has(value)) {\n styles.push(StringConsole.styles.get(value))\n }\n }\n\n return styles\n },\n configurable: true,\n },\n });\n\n /**\n * A static map defining the ANSI escape codes for different pen styles\n * used in console output. Each pen style is associated with an array\n * containing two numbers: the first for setting the style and the second\n * for resetting it.\n *\n * The available pen styles and their corresponding ANSI codes are:\n * - 'foreground': [3, 3] - Standard foreground color\n * - 'background': [4, 4] - Standard background color\n * - 'bright.foreground': [9, 3] - Bright foreground color\n * - 'bright.background': [10, 4] - Bright background color\n *\n * These are prefixes for both enabling and disabling. Normally a red color\n * is represented using SGR (Select Graphic Rendition) codes like \\x1b[31m\n * for the foreground and \\x1b[39m to return to normal color. So the 3\n * determines a foreground prefix for starting and stopping (the 3's in 31\n * and 39). Background prefixes are usually 4. These change for bright\n * colors which use 9 and 3, and 10 and 4, respectively.\n *\n * @type {Map<string, number[]>}\n *\n * @example\n * // [3, 3]\n * const foregroundPen = StringConsole.pens.get('foreground')\n *\n * // [10, 4]\n * const brightBackgroundPen = StringConsole.pens.get('bright.background')\n */\n static pens = new Map([\n ['foreground', [3, 3]],\n ['background', [4, 4]],\n ['bright.foreground', [9, 3]],\n ['bright.background', [10, 4]]\n ]);\n\n /**\n * A static map defining ANSI escape codes for various text styles used\n * in console output. Each style is associated with an array containing\n * two escape codes: one for enabling the style and one for disabling it.\n *\n * The available styles and their corresponding ANSI codes are:\n * - 'reset': Resets all styles to default.\n * - 'blink': Enables blinking text.\n * - 'bold': Makes text bold.\n * - 'conceal': Conceals text.\n * - 'dim': Dims the text.\n * - 'italics': Italicizes the text.\n * - 'negative': Inverts the foreground and background colors.\n * - 'strike': Strikes through the text.\n * - 'underline': Underlines the text.\n *\n * @type {Map<string, string[]>}\n *\n * @example\n * const boldStyle = StringConsole.styles.get('bold')\n * // ['\\x1b[1m', '\\x1b[22m']\n */\n static styles = new Map([\n ['reset', ['\\x1b[0m']],\n ['blink', ['\\x1b[5m', '\\x1b[25m']],\n ['bold', ['\\x1b[1m', '\\x1b[22m']],\n ['conceal', ['\\x1b[8m', '\\x1b[28m']],\n ['dim', ['\\x1b[2m', '\\x1b[22m']],\n ['italics', ['\\x1b[3m', '\\x1b[23m']],\n ['negative', ['\\x1b[7m', '\\x1b[27m']],\n ['strike', ['\\x1b[9m', '\\x1b[29m']],\n ['underline', ['\\x1b[4m', '\\x1b[24m']]\n ]);\n\n /**\n * Applies ANSI color codes to a given string based on specified options.\n * This method checks if the string already contains color codes or if\n * the input is not a string, in which case it returns the original input.\n * Otherwise, it formats the string with the specified color and pen\n * options.\n *\n * @param {string} string - The string to be colorized.\n * @param {Object} [options] - Configuration options for colorization.\n * @param {string} [options.level] - The log level determining\n * which colors to apply.\n * @param {number[]} [options.rgb8] a single color code where 0 - 7, for\n * the 'standard' colors specified by the SGR sequences 30 to 37; 8-15 are\n * high intensity or bright colors,\n * @param {number[]} [options.rgb24] An array of three values, ordered, red,\n * green and then blue. The values should range from 0 to 255.\n * @param {string|string[]} [options.styles] defaulting to an empty array, if\n * supplied with a single known style {@link ~styles}, or an array of them.\n * @param {string} [options.pen='foreground'] - The pen type for color\n * application, either 'foreground' or 'background'.\n * @param {Array} [options.buffer=[]] - An array to prepend to the\n * formatted string.\n * @param {Array} [options.before=[]] - An array of strings to prepend\n * before the main string.\n * @param {Array} [options.after=[]] - An array of strings to append\n * after the main string. 16 - 231, for the colors in the 6 \u00D7 6 \u00D7 6 cube\n * defined by 16 + 36 \u00D7 r + 6 \u00D7 g + b (0 \u2264 r, g, b \u2264 5); 232-255:\n * grayscale from dark to light in 24 steps.\n *\n * @returns {string} The colorized string with ANSI codes applied.\n *\n * @example\n * const coloredString = StringConsole.color('Hello', {\n * level: 'info',\n * pen: 'bright.foreground'\n * })\n * console.log(coloredString)\n */\n static color(string, options = {\n level: undefined,\n color: undefined,\n pen: 'foreground',\n rgb8: undefined,\n rgb24: [186, 186, 186],\n styles: [],\n buffer: [],\n before: [],\n after: [],\n }) {\n const { colors: Colors, styles: Styles, pens: Pens, levels: Levels } = this\n let useColors = undefined\n let useRGB = false\n let styles = []\n\n const pens = this.pens.get(options?.pen ?? 'foreground')\n const [p0, p1] = pens\n\n if (options?.styles) {\n if (Array.isArray(options.styles))\n styles = options.styles\n .filter(s => Styles.has(s))\n .map(s => Styles.get(s))\n else if (typeof options.styles === 'string' && Styles.has(options.styles))\n styles = Styles.get(options.styles)\n }\n\n if (options?.level && Levels.has(options.level)) {\n useColors = Levels.color(options.level)\n\n const addlStyles = Levels.styles(options.level)\n if (addlStyles.length)\n styles = styles.concat(addlStyles)\n }\n\n else if (options?.color && Colors.has(options.color))\n useColors = Colors.get(options.color)\n\n else if (options?.rgb24 && Array.isArray(options.rgb24)) {\n useColors = [`\\x1b[${p0}8;2;${options.rgb24.join(';')};m`, `\\x1b[${p1}9m`]\n useRGB = true\n }\n\n else if (options?.rgb8 && typeof options.rgb8 === 'number' ) {\n useColors = [`\\x1b[${p0}8;5;${options.rgb8}m`, `\\x1b[${p1}9m`]\n useRGB = true\n }\n\n else useColors = [9,9]\n\n const [c0, c1] = (useRGB\n ? useColors\n : useColors?.map((c,i) => `\\x1b[${pens[i]}${c}m`) ?? [`\\x1b[39;49m`]\n )\n\n if (this.hasColor(string)) return string\n if (typeof string !== 'string') return string\n if (string instanceof String) (string = String(string))\n if (!useColors) return string\n\n if (options?.buffer && !Array.isArray(options.buffer))\n options.buffer = [String(options.buffer)]\n\n if (options?.before && !Array.isArray(options.before))\n options.before = [String(options.before)]\n\n if (options?.after && !Array.isArray(options.after))\n options.after = [String(options.after)]\n\n const buffer = [].concat(options?.buffer ?? [])\n const before = [].concat(options?.before ?? [])\n const after = [].concat(options?.after ?? [])\n\n if (c0)\n before.push(c0)\n\n if (c1)\n after.push(c1)\n\n for (const style of styles) {\n if (style?.[0])\n before.push(style[0])\n\n if (style?.[1])\n after.push(style[1])\n }\n\n return [...buffer, before.join(''), string, after.join('')].join('')\n }\n\n /**\n * Applies color formatting to each argument based on the specified log level.\n *\n * This method processes an array of arguments, applying color formatting\n * to each one according to the provided log level. The color formatting\n * is determined by the `color` method, which uses the log level to\n * select the appropriate color scheme.\n *\n * @param {string} level - The log level that determines the color scheme\n * to be applied. Common levels include 'log', 'info', 'warn', 'error',\n * etc.\n * @param {Array} args - An array of arguments to be formatted. Each\n * argument will be processed individually to apply the color formatting.\n *\n * @returns {Array} A new array containing the formatted arguments with\n * color applied.\n *\n * @example\n * const formattedArgs = StringConsole.colorArgs(\n * 'info',\n * ['Message 1', 'Message 2']\n * )\n * // formattedArgs will contain the messages with 'info' level\n * // color formatting\n */\n static colorArgs(level, args) {\n const newArgs = []\n\n if (args === null || args === undefined || !Array.isArray(args))\n return args\n\n for (const arg of args) {\n newArgs.push(this.color(arg, { level }))\n }\n\n return newArgs\n }\n\n /**\n * Determines if a given string contains ANSI color codes.\n *\n * This method checks for the presence of ANSI escape codes in the\n * provided string, which are used for color formatting in terminal\n * outputs. The presence of these codes indicates that the string\n * has color formatting applied.\n *\n * @param {string} string - The string to be checked for ANSI color codes.\n *\n * @returns {boolean} Returns true if the string contains ANSI color codes,\n * otherwise false.\n *\n * @example\n * const hasColor = StringConsole.hasColor('\\x1b[31mRed Text\\x1b[0m')\n * // hasColor will be true\n *\n * const noColor = StringConsole.hasColor('Plain Text')\n * // noColor will be false\n */\n static hasColor(string) {\n return string.includes('\\x1b[')\n }\n\n /**\n * Applies a series of styles to a given string using ANSI escape codes.\n *\n * This method takes a string and an array of style names or style arrays,\n * and applies the corresponding ANSI escape codes to the string. The\n * styles are defined in the `styles` map, which associates style names\n * with their respective ANSI codes.\n *\n * @param {string} string - The string to which styles will be applied.\n * @param {string|string[]} styles - A style name or an array of style\n * names/arrays to be applied. Each style can be a string that matches\n * a key in the `styles` map or an array containing ANSI codes.\n *\n * @returns {string} The styled string with ANSI escape codes applied.\n *\n * @example\n * const styledText = StringConsole.style('Hello', ['bold', 'underline'])\n * // styledText will have 'Hello' with bold and underline styles\n */\n static style(string, styles) {\n const before = []\n const after = []\n const buffer = []\n\n if (typeof styles === 'string' && this.styles.has(styles)) {\n styles = [styles]\n }\n\n for (const style of styles) {\n let group = []\n\n if (this.styles.has(style))\n group = this.styles.get(style)\n\n else if (Array.isArray(style) && style.length >= 1)\n group = style\n\n if (group?.[0])\n before.push(group?.[0])\n\n if (group?.[1])\n after.push(group?.[1])\n }\n\n return [before.join(''), string, after.join('')].join('')\n }\n\n /* Since this class captures the swaps the process.stdout.write function,\n * in to and out of place repeatedly, we want to avoid any possible issues\n * where this conflict could be problematic. To this end, we capture the\n * global process.stdout.write function as a copy when this class is defined\n * but before it is used.\n *\n * If no other code modifies the `writer` property, this is created as a\n * non-enumerable alias to the [Symbol.for('process.stdout.write')] symbol\n * the actual function is stored in.\n */\n static {\n Object.defineProperties(StringConsole, {\n [Symbol.for('process.stdout.write')]: {\n value: Object.defineProperties(process.stdout.write, {\n [Symbol.for('original')]: {value: true, configurable: true },\n isOriginal: { get() { return true }, configurable: true },\n }),\n configurable: true,\n },\n\n [Symbol.for('process.stderr.write')]: {\n value: Object.defineProperties(process.stderr.write, {\n [Symbol.for('original')]: {value: true, configurable: true },\n isOriginal: { get() { return true }, configurable: true },\n }),\n configurable: true,\n },\n })\n\n if (!Reflect.has(StringConsole, 'writer')) {\n Object.defineProperties(StringConsole, {\n writer: {\n value: StringConsole[Symbol.for('process.stdout.write')],\n configurable: true,\n },\n\n errorWriter: {\n value: StringConsole[Symbol.for('process.stderr.write')],\n configurable: true,\n },\n })\n }\n }\n}\n\nexport const SC = StringConsole\nexport const StringConsoleExtension = new Extension(StringConsole)\nexport const StdoutGlobalPatches = new Patch(globalThis, {\n [Patch.kMutablyHidden]: {\n captureStdout,\n }\n})\n\nexport default {\n SC: StringConsole,\n StringConsole,\n StringConsoleExtension,\n StdoutGlobalPatches,\n\n captureStdout,\n}", "const map = new Map([\n ['object', Object], [Object, 'object'], ['Object', Object],\n ['number', Number], [Number, 'number'], ['Number', Number],\n ['string', String], [String, 'string'], ['String', String],\n ['function', Function], [Function, 'function'], ['Function', Function],\n ['boolean', Boolean], [Boolean, 'boolean'], ['Boolean', Boolean],\n ['bigint', BigInt], [BigInt, 'bigint'], ['BigInt', BigInt],\n ['symbol', Symbol], [Symbol, 'symbol'], ['Symbol', Symbol],\n ['undefined', undefined], [undefined, 'undefined'],\n ['null', null], [null, 'null'],\n])\n\n/**\n * Utility functions to check the type and properties of a value.\n */\nexport const is = {\n /**\n * Checks if a value matches a specified type or class.\n *\n * This function determines if the provided value matches the specified\n * type or class. It supports both primitive types and class constructors.\n *\n * @param {*} value - The value to check.\n * @param {*} typeOrClass - The type or class to compare against.\n * @returns {boolean} True if the value matches the type or class,\n * false otherwise.\n *\n * @example\n * // Returns true\n * is.a(42, 'number')\n *\n * @example\n * // Returns true\n * is.a(new Date(), Date)\n *\n * @example\n * // Returns false\n * is.a('string', Number)\n */\n a(value, typeOrClass) {\n const valueType = typeof value\n const valueTag = this.object(value) && value[Symbol.toStringTag]\n\n if (value === typeOrClass)\n return true\n\n if (this.function(typeOrClass)) {\n const typeTag = this.object(typeOrClass) && typeOrClass[Symbol.toStringTag]\n\n if (valueTag && valueTag === typeOrClass.name)\n return true\n\n if (typeOrClass?.prototype && value instanceof typeOrClass)\n return true\n\n return map.get(valueType) === typeOrClass\n }\n\n else if (map.get(valueType)?.name === typeOrClass)\n return true\n\n else if (valueType === typeOrClass || valueTag === typeOrClass)\n return true\n\n return false\n },\n\n /**\n * Check if a value is an accessor descriptor.\n *\n * An accessor descriptor is an object that describes the configuration of a\n * property on an object, specifically focusing on the 'get' and 'set'\n * attributes. Computed accessor descriptors are invalid if they also have\n * a `value` and/or `writable` property.\n *\n * @param value The value to check.\n * @returns True if the value is an accessor descriptor, false otherwise.\n *\n * @example\n * // Returns true\n * is.accessorDescriptor({ get: () => 42, set: () => {} })\n *\n * // Returns false\n * is.accessorDescriptor({ value: 42, writable: true })\n */\n accessorDescriptor(value) {\n return !!(\n this.descriptor(value) &&\n (value?.get || value?.set) &&\n value?.writable === undefined &&\n value?.value === undefined\n )\n },\n\n /**\n * Check if a value is an array.\n *\n * @param value The value to check.\n * @returns True if the value is an array, false otherwise.\n *\n * @example\n * is.array([1, 2, 3]) // true\n * is.array('string') // false\n */\n array(value) {\n return Array.isArray(value)\n },\n\n /**\n * Check if a value is a bigint.\n *\n * @param value The value to check.\n * @returns True if the value is a bigint, false otherwise.\n *\n * @example\n * is.bigint(123n) // true\n * is.bigint(123) // false\n */\n bigint(value) {\n return typeof value === \"bigint\" || value instanceof globalThis?.BigInt\n },\n\n /**\n * Checks if a value is strictly a boolean (true or false).\n *\n * This method verifies if the provided value is either `true` or `false`.\n *\n * @param {*} value - The value to check.\n * @returns {boolean} True if the value is a boolean, false otherwise.\n *\n * @example\n * is.boolean(true) // true\n * is.boolean(false) // true\n * is.boolean(1) // false\n * is.boolean(\"true\") // false\n */\n boolean(value) {\n return [true, false].some(bool => bool === value)\n },\n\n /**\n * Check if an object is callable. This function is more or less a\n * synonym or alias for `is.function()`.\n *\n * @param object The object to check.\n * @returns True if the object is callable, false otherwise.\n *\n * @note if you wish to know if a descriptor has a callable `value`,\n * `get`, or `set` function, use `is.callableDescriptor` instead.\n *\n * @example\n * is.callable(function() {}) // true\n */\n callable(object) {\n return this.function(object)\n },\n\n /**\n * Check if an object is a callable descriptor. It looks to see if the\n * object represents a descriptor that is callable by checking object\n * properties named `value`, `get`, and `set`. If any of the three\n * yields a function type, true is returned.\n *\n * @param object The object to check.\n * @returns True if the object is a callable descriptor, false otherwise.\n *\n * @example\n * is.callableDescriptor({ get: function() {} }) // true\n * is.callableDescriptor(123) // false\n *\n * // Note the differences between these\n * const object = { get name() { return \"Brie\"; } }\n * const descriptor = Object.getOwnPropertyDescriptor(object, 'name')\n * is.callableDescriptor(object) // false\n * is.callableDescriptor(descriptor) // true\n */\n callableDescriptor(object) {\n const { value, get, set } = this.shiny(object) ? object : {}\n return [value, get, set].some((val) => this.function(val))\n },\n\n /**\n * Check if a value is a data property descriptor.\n *\n * A data descriptor is an object that describes the configuration of a\n * property on an object, specifically focusing on the 'value' and\n * 'writable' attributes. The descriptor is invalid if it contains\n * the accessor descriptors `get` or `set`.\n *\n * @param value The value to check.\n * @returns True if the value is a data descriptor, false otherwise.\n *\n * @example\n * // Returns true\n * is.dataDescriptor({ value: 42, writable: true })\n *\n * // Returns false\n * is.dataDescriptor({ get: () => 42, set: () => {} })\n */\n dataDescriptor(value) {\n return !!(\n this.descriptor(value) &&\n (value?.value !== undefined || value?.writable !== undefined) &&\n value?.get === undefined &&\n value?.set === undefined\n )\n },\n\n /**\n * Check if a value is a property descriptor.\n *\n * A property descriptor is an object that describes the configuration of a\n * property on an object. This function checks if the provided value is an\n * object and contains any of the standard property descriptor keys.\n *\n * @param value The value to check.\n * @returns True if the value is a property descriptor, false otherwise.\n *\n * @example\n * is.descriptor({ configurable: true, enumerable: false }) // true\n * is.descriptor({ get: () => {}, set: () => {} }) // true\n * is.descriptor({}) // false\n */\n descriptor(value) {\n if (!is.object(value)) {\n return false\n }\n\n const _has = (key) => Reflect.has(value, key)\n const hasBase = [\"configurable\", \"enumerable\"].some((key) => _has(key))\n const hasData = [\"value\", \"writable\"].some((key) => _has(key))\n const hasAccess = [\"get\", \"set\"].some((key) => _has(key))\n return hasBase || hasData || hasAccess\n },\n\n /**\n * Checks if a value is strictly false.\n *\n * This method verifies if the provided value is strictly `false`.\n *\n * @param {*} value - The value to check.\n * @returns {boolean} True if the value is strictly false, false otherwise.\n *\n * @example\n * is.false(false) // true\n * is.false(true) // false\n * is.false(0) // false\n */\n false(value) {\n return value === false\n },\n\n /**\n * Checks if a value is falsy.\n *\n * This method converts the provided value to a boolean and returns\n * `true` if the value is falsy (i.e., false, 0, \"\", null, undefined,\n * or NaN).\n *\n * @param {*} value - The value to check.\n * @returns {boolean} True if the value is falsy, false otherwise.\n *\n * @example\n * is.falsy(0) // true\n * is.falsy(\"\") // true\n * is.falsy(1) // false\n * is.falsy(\"hello\") // false\n */\n falsy(value) {\n return !!!value\n },\n\n /**\n * Alias for the `falsy` method.\n *\n * This method is an alias for `is.falsy` and performs the same check.\n *\n * @param {*} value - The value to check.\n * @returns {boolean} True if the value is falsy, false otherwise.\n *\n * @example\n * is.falsey(0) // true\n * is.falsey(\"\") // true\n * is.falsey(1) // false\n * is.falsey(\"hello\") // false\n */\n falsey(value) {\n return this.falsy(value)\n },\n\n /**\n * Check if a value is a function.\n *\n * @param value The value to check.\n * @returns True if the value is a function, false otherwise.\n *\n * @example\n * is.function(function() {}) // true\n * is.function(123) // false\n */\n function(value) {\n return typeof value === \"function\" || value instanceof Function\n },\n\n /**\n * Check if a value is iterable. Depending on the environment, JavaScript\n * will permit `'string'[Symbol.iterator]()` whereas in some places, you\n * will need to wrap string in an object first. Since other JSVM provided\n * environments may or may not be leniant with this, we play it safe by\n * implicitly object converting values before checking for the symbol. If\n * a value is already an object, it will simply be passed through.\n *\n * @param value The value to check.\n * @returns True if the value is iterable, false otherwise.\n *\n * @example\n * is.iterable([1, 2, 3]) // true\n * is.iterable('string') // true\n * is.iterable(123) // false\n */\n iterable(value) {\n const object = Object(value)\n return object && Reflect.has(object, Symbol.iterator)\n },\n\n /**\n * Check if a value is null or undefined.\n *\n * @param value The value to check.\n * @returns True if the value is null or undefined, false otherwise.\n *\n * @example\n * is.nullish(null) // true\n * is.nullish(undefined) // true\n * is.nullish('value') // false\n */\n nullish(value) {\n return value === null || value === undefined\n },\n\n /**\n * Check if a value is a number.\n *\n * @param value The value to check.\n * @returns True if the value is a number, false otherwise.\n *\n * @example\n * is.number(123) // true\n * is.number('123') // false\n */\n number(value) {\n return typeof value === \"number\" || value instanceof Number\n },\n\n /**\n * Check if a value is an object.\n *\n * @param value The value to check.\n * @returns True if the value is an object, false otherwise.\n *\n * @example\n * is.object({}) // true\n * is.object(null) // false\n */\n object(value) {\n return !!(value && typeof value === \"object\")\n },\n\n /**\n * The {@link Object#entries} function returns the properties of a given\n * value as an array of arrays where each element of the inner arrays is\n * a valid object key (so one of {@link String}, {@link Number}, or\n * {@link Symbol}) and the second element is the value of the pair which\n * can be any type.\n *\n * This function vets this criteria and would return true for each entry\n * in the returned outer array of a call to {@link Object#entries}.\n *\n * @param {any} value the value to test\n * @returns {boolean} true if the value is a valid object entry in the\n * form of `[key, value]`.\n */\n objectEntry(value) {\n if (!(\n // Must be an array\n Array.isArray(value) &&\n\n // Must have only two elements\n value.length == 2 &&\n\n // Must have its first element be string|number|symbol\n (this.string(value[0]) || this.number(value[0]) || this.symbol(value[0]))\n )) {\n return false\n }\n\n return true\n },\n\n /**\n * Check if a value is a valid object key. Valid object keys are strings,\n * numbers, or symbols \u2014 the same types accepted as property keys in\n * JavaScript objects.\n *\n * @param {*} value - The value to check.\n * @returns {boolean} True if the value is a string, number, or symbol,\n * false otherwise.\n *\n * @example\n * is.objectKey('name') // true\n * is.objectKey(0) // true\n * is.objectKey(Symbol('id')) // true\n * is.objectKey({}) // false\n * is.objectKey(null) // false\n */\n objectKey(value) {\n return this.string(value) || this.number(value) || this.symbol(value)\n },\n\n /**\n * Check if a value is a primitive type.\n *\n * This function determines if the provided value is one of the JavaScript\n * primitive types: string, number, boolean, bigint, or symbol.\n *\n * @param value The value to check.\n * @returns True if the value is a primitive type, false otherwise.\n *\n * @example\n * // Returns true\n * is.primitive('hello')\n *\n * // Returns true\n * is.primitive(123)\n *\n * // Returns true\n * is.primitive(true)\n *\n * // Returns true\n * is.primitive(123n)\n *\n * // Returns true\n * is.primitive(Symbol('symbol'))\n *\n * // Returns false\n * is.primitive({})\n *\n * // Returns false\n * is.primitive([])\n */\n primitive(value) {\n if (this.nullish(value))\n return true\n\n return [\"string\", \"number\", \"boolean\", \"bigint\", \"symbol\"].some(\n (type) => typeof value === type\n )\n },\n\n /**\n * The use of `typeof` is not a safe guarantor when it comes to Reflect\n * supported values. Any non-null value that returns a `typeof` either\n * `object` or `function` should suffice. Note that arrays return 'object'\n * when run through `typeof`. Shiny is clearly a reference to something\n * reflective and is much shorter to type. Also, Mal says shiny. :)\n *\n * @param value The value to check.\n * @returns True if the value is an object or a function, false otherwise.\n *\n * @example\n * is.shiny({}) // true\n * is.shiny(function() {}) // true\n * is.shiny(123) // false\n */\n shiny(value) {\n return !!(this.object(value) || this.function(value))\n },\n\n /**\n * Check if a value is a string.\n *\n * @param value The value to check.\n * @returns True if the value is a string, false otherwise.\n *\n * @example\n * is.string('hello') // true\n * is.string(123) // false\n */\n string(value) {\n return typeof value === \"string\" || value instanceof String\n },\n\n /**\n * Checks if a value is a symbol.\n *\n * This function determines whether the provided value is of type\n * 'symbol' or an instance of the Symbol object.\n *\n * @param value - The value to check.\n * @returns True if the value is a symbol, false otherwise.\n *\n * @example\n * is.symbol(Symbol('foo')) // Returns true\n * is.symbol('foo') // Returns false\n */\n symbol(value) {\n return typeof value === \"symbol\" || value instanceof Symbol\n },\n\n /**\n * Checks if a value is strictly true.\n *\n * This method verifies if the provided value is strictly `true`.\n *\n * @param {*} value - The value to check.\n * @returns {boolean} True if the value is strictly true, false otherwise.\n *\n * @example\n * is.true(true) // true\n * is.true(false) // false\n * is.true(1) // false\n */\n true(value) {\n return value === true\n },\n\n /**\n * Checks if a value is truthy.\n *\n * This method converts the provided value to a boolean and returns\n * `true` if the value is truthy (i.e., not false, 0, \"\", null, undefined,\n * or NaN).\n *\n * @param {*} value - The value to check.\n * @returns {boolean} True if the value is truthy, false otherwise.\n *\n * @example\n * is.truthy(1) // true\n * is.truthy(\"hello\") // true\n * is.truthy(0) // false\n * is.truthy(\"\") // false\n */\n truthy(value) {\n return !!value\n },\n}\n\nexport const si = {\n /**\n * Inline if-then-else based on whether value matches a specified type or\n * class. Delegates the condition check to {@link is#a}.\n *\n * @param {*} value - The value to check.\n * @param {*} typeOrClass - The type or class to compare against.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value matches typeOrClass.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value does not match typeOrClass.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.a(42, 'number', 'yes', 'no') // 'yes'\n * si.a('str', Number, 'yes', 'no') // 'no'\n * si.a(42, 'number', () => 'computed', 'no') // 'computed'\n */\n a(value, typeOrClass, thenValue, elseValue) {\n return ifThenElse(is.a(value, typeOrClass), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is an accessor descriptor.\n * Delegates the condition check to {@link is#accessorDescriptor}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is an accessor descriptor.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not an accessor descriptor.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.accessorDescriptor({ get: () => 42 }, 'yes', 'no') // 'yes'\n * si.accessorDescriptor({ value: 42 }, 'yes', 'no') // 'no'\n * si.accessorDescriptor({ get: () => 42 }, () => 'computed', 'no') // 'computed'\n */\n accessorDescriptor(value, thenValue, elseValue) {\n return ifThenElse(is.accessorDescriptor(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is an array.\n * Delegates the condition check to {@link is#array}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is an array.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not an array.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.array([1, 2, 3], 'yes', 'no') // 'yes'\n * si.array('string', 'yes', 'no') // 'no'\n * si.array([1, 2, 3], () => 'computed', 'no') // 'computed'\n */\n array(value, thenValue, elseValue) {\n return ifThenElse(is.array(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is a bigint.\n * Delegates the condition check to {@link is#bigint}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is a bigint.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not a bigint.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.bigint(123n, 'yes', 'no') // 'yes'\n * si.bigint(123, 'yes', 'no') // 'no'\n * si.bigint(123n, () => 'computed', 'no') // 'computed'\n */\n bigint(value, thenValue, elseValue) {\n return ifThenElse(is.bigint(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is a boolean.\n * Delegates the condition check to {@link is#boolean}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is a boolean.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not a boolean.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.boolean(true, 'yes', 'no') // 'yes'\n * si.boolean(1, 'yes', 'no') // 'no'\n * si.boolean(false, () => 'computed', 'no') // 'computed'\n */\n boolean(value, thenValue, elseValue) {\n return ifThenElse(is.boolean(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether object is callable.\n * Delegates the condition check to {@link is#callable}.\n *\n * @param {*} object - The object to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if object is callable.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if object is not callable.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.callable(function() {}, 'yes', 'no') // 'yes'\n * si.callable(123, 'yes', 'no') // 'no'\n * si.callable(function() {}, () => 'computed', 'no') // 'computed'\n */\n callable(object, thenValue, elseValue) {\n return ifThenElse(is.callable(object), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether object is a callable descriptor.\n * Delegates the condition check to {@link is#callableDescriptor}.\n *\n * @param {*} object - The object to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if object is a callable descriptor.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if object is not a callable descriptor.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.callableDescriptor({ get: function() {} }, 'yes', 'no') // 'yes'\n * si.callableDescriptor(123, 'yes', 'no') // 'no'\n * si.callableDescriptor({ get: function() {} }, () => 'computed', 'no') // 'computed'\n */\n callableDescriptor(object, thenValue, elseValue) {\n return ifThenElse(is.callableDescriptor(object), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is a data property descriptor.\n * Delegates the condition check to {@link is#dataDescriptor}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is a data descriptor.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not a data descriptor.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.dataDescriptor({ value: 42, writable: true }, 'yes', 'no') // 'yes'\n * si.dataDescriptor({ get: () => 42 }, 'yes', 'no') // 'no'\n * si.dataDescriptor({ value: 42 }, () => 'computed', 'no') // 'computed'\n */\n dataDescriptor(value, thenValue, elseValue) {\n return ifThenElse(is.dataDescriptor(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is a property descriptor.\n * Delegates the condition check to {@link is#descriptor}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is a property descriptor.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not a property descriptor.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.descriptor({ configurable: true }, 'yes', 'no') // 'yes'\n * si.descriptor({}, 'yes', 'no') // 'no'\n * si.descriptor({ get: () => {} }, () => 'computed', 'no') // 'computed'\n */\n descriptor(value, thenValue, elseValue) {\n return ifThenElse(is.descriptor(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is strictly false.\n * Delegates the condition check to {@link is#false}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is strictly false.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not strictly false.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.false(false, 'yes', 'no') // 'yes'\n * si.false(0, 'yes', 'no') // 'no'\n * si.false(false, () => 'computed', 'no') // 'computed'\n */\n false(value, thenValue, elseValue) {\n return ifThenElse(is.false(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is falsy.\n * Delegates the condition check to {@link is#falsy}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is falsy.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not falsy.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.falsy(0, 'yes', 'no') // 'yes'\n * si.falsy(1, 'yes', 'no') // 'no'\n * si.falsy('', () => 'computed', 'no') // 'computed'\n */\n falsy(value, thenValue, elseValue) {\n return ifThenElse(is.falsy(value), thenValue, elseValue)\n },\n\n /**\n * Alias for {@link si#falsy}. Inline if-then-else based on whether value\n * is falsy. Delegates the condition check to {@link is#falsey}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is falsy.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not falsy.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.falsey(0, 'yes', 'no') // 'yes'\n * si.falsey(1, 'yes', 'no') // 'no'\n * si.falsey('', () => 'computed', 'no') // 'computed'\n */\n falsey(value, thenValue, elseValue) {\n return ifThenElse(is.falsey(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is a function.\n * Delegates the condition check to {@link is#function}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is a function.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not a function.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.function(function() {}, 'yes', 'no') // 'yes'\n * si.function(123, 'yes', 'no') // 'no'\n * si.function(function() {}, () => 'computed', 'no') // 'computed'\n */\n function(value, thenValue, elseValue) {\n return ifThenElse(is.function(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is iterable.\n * Delegates the condition check to {@link is#iterable}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is iterable.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not iterable.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.iterable([1, 2, 3], 'yes', 'no') // 'yes'\n * si.iterable(123, 'yes', 'no') // 'no'\n * si.iterable('string', () => 'computed', 'no') // 'computed'\n */\n iterable(value, thenValue, elseValue) {\n return ifThenElse(is.iterable(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is null or undefined.\n * Delegates the condition check to {@link is#nullish}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is nullish.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not nullish.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.nullish(null, 'yes', 'no') // 'yes'\n * si.nullish('value', 'yes', 'no') // 'no'\n * si.nullish(undefined, () => 'computed', 'no') // 'computed'\n */\n nullish(value, thenValue, elseValue) {\n return ifThenElse(is.nullish(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is a number.\n * Delegates the condition check to {@link is#number}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is a number.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not a number.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.number(123, 'yes', 'no') // 'yes'\n * si.number('123', 'yes', 'no') // 'no'\n * si.number(123, () => 'computed', 'no') // 'computed'\n */\n number(value, thenValue, elseValue) {\n return ifThenElse(is.number(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is an object.\n * Delegates the condition check to {@link is#object}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is an object.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not an object.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.object({}, 'yes', 'no') // 'yes'\n * si.object(null, 'yes', 'no') // 'no'\n * si.object({}, () => 'computed', 'no') // 'computed'\n */\n object(value, thenValue, elseValue) {\n return ifThenElse(is.object(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is a valid object entry.\n * Delegates the condition check to {@link is#objectEntry}.\n *\n * @param {any} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is a valid object entry.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not a valid object entry.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.objectEntry(['key', 42], 'yes', 'no') // 'yes'\n * si.objectEntry([1, 2, 3], 'yes', 'no') // 'no'\n * si.objectEntry(['key', 42], () => 'computed', 'no') // 'computed'\n */\n objectEntry(value, thenValue, elseValue) {\n return ifThenElse(is.objectEntry(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is a valid object key.\n * Delegates the condition check to {@link is#objectKey}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is a valid object key.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not a valid object key.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.objectKey('name', 'yes', 'no') // 'yes'\n * si.objectKey({}, 'yes', 'no') // 'no'\n * si.objectKey(Symbol('id'), () => 'computed', 'no') // 'computed'\n */\n objectKey(value, thenValue, elseValue) {\n return ifThenElse(is.objectKey(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is a primitive type.\n * Delegates the condition check to {@link is#primitive}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is a primitive.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not a primitive.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.primitive('hello', 'yes', 'no') // 'yes'\n * si.primitive({}, 'yes', 'no') // 'no'\n * si.primitive(123, () => 'computed', 'no') // 'computed'\n */\n primitive(value, thenValue, elseValue) {\n return ifThenElse(is.primitive(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is shiny (object or function).\n * Delegates the condition check to {@link is#shiny}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is shiny.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not shiny.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.shiny({}, 'yes', 'no') // 'yes'\n * si.shiny(123, 'yes', 'no') // 'no'\n * si.shiny(function() {}, () => 'computed', 'no') // 'computed'\n */\n shiny(value, thenValue, elseValue) {\n return ifThenElse(is.shiny(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is a string.\n * Delegates the condition check to {@link is#string}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is a string.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not a string.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.string('hello', 'yes', 'no') // 'yes'\n * si.string(123, 'yes', 'no') // 'no'\n * si.string('hello', () => 'computed', 'no') // 'computed'\n */\n string(value, thenValue, elseValue) {\n return ifThenElse(is.string(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is a symbol.\n * Delegates the condition check to {@link is#symbol}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is a symbol.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not a symbol.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.symbol(Symbol('foo'), 'yes', 'no') // 'yes'\n * si.symbol('foo', 'yes', 'no') // 'no'\n * si.symbol(Symbol('foo'), () => 'computed', 'no') // 'computed'\n */\n symbol(value, thenValue, elseValue) {\n return ifThenElse(is.symbol(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else using an arbitrary condition. If condition is a\n * function, it is called and its result is used as the condition; otherwise\n * the condition value is evaluated directly.\n *\n * @param {function|*} condition - The condition to evaluate. If a function,\n * it is called and its return value is used as the condition.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if the condition is truthy.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if the condition is falsy.\n * @returns {*} The result of thenValue if the condition is truthy,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.then(true, 'yes', 'no') // 'yes'\n * si.then(false, 'yes', 'no') // 'no'\n * si.then(() => true, 'yes', 'no') // 'yes'\n * si.then(() => false, () => 'computed', 'no') // 'no'\n */\n then(condition, thenValue, elseValue) {\n return ifThenElse(\n is.function(condition) ? condition() : condition,\n thenValue,\n elseValue\n )\n },\n\n /**\n * Inline if-then-else based on whether value is strictly true.\n * Delegates the condition check to {@link is#true}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is strictly true.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not strictly true.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.true(true, 'yes', 'no') // 'yes'\n * si.true(1, 'yes', 'no') // 'no'\n * si.true(true, () => 'computed', 'no') // 'computed'\n */\n true(value, thenValue, elseValue) {\n return ifThenElse(is.true(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is truthy.\n * Delegates the condition check to {@link is#truthy}.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is truthy.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not truthy.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.truthy(1, 'yes', 'no') // 'yes'\n * si.truthy(0, 'yes', 'no') // 'no'\n * si.truthy(\"hello\", () => 'computed', 'no') // 'computed'\n */\n truthy(value, thenValue, elseValue) {\n return ifThenElse(is.truthy(value), thenValue, elseValue)\n },\n\n /**\n * Inline if-then-else based on whether value is undefined.\n * Delegates the condition check to {@link is#a} with type 'undefined'.\n *\n * @param {*} value - The value to check.\n * @param {function|*} thenValue - Returned (or called and its result\n * returned) if value is undefined.\n * @param {function|*} elseValue - Returned (or called and its result\n * returned) if value is not undefined.\n * @returns {*} The result of thenValue if the condition is true,\n * elseValue otherwise. If thenValue or elseValue is a function,\n * its return value is used instead.\n *\n * @example\n * si.undefined(undefined, 'yes', 'no') // 'yes'\n * si.undefined('value', 'yes', 'no') // 'no'\n * si.undefined(undefined, () => 'computed', 'no') // 'computed'\n */\n undefined(value, thenValue, elseValue) {\n return ifThenElse(is.a(value, 'undefined'), thenValue, elseValue)\n }\n}\n\n/**\n * Checks if an object contains a specific key.\n *\n * This function determines if the provided object contains the specified key.\n * It supports various types of objects including Map, Set, WeakMap, and\n * WeakSet. For other objects, it uses the Reflect API to check for the key.\n *\n * @param object The object to check.\n * @param key The key to look for in the object.\n * @returns True if the object contains the key, false otherwise.\n *\n * @example\n * // Returns true\n * has(new Map([['key', 'value']]), 'key')\n *\n * @example\n * // Returns false\n * has({}, 'key')\n */\nexport const has = function has(object, key) {\n if ([Map, Set, WeakMap, WeakSet].some((i) => object instanceof i)) {\n return object.has(key)\n }\n\n return is.shiny(object) && Reflect.has(object, key)\n}\n\nObject.assign(has, {\n /**\n * Checks if an object contains all specified keys.\n *\n * This function determines if the provided object contains all the keys\n * specified in the keys array. It supports various types of objects\n * including Map, Set, WeakMap, and WeakSet. For other objects, it uses\n * the Reflect API to check for the keys.\n *\n * @param object The object to check.\n * @param keys The array of keys to look for in the object.\n * @returns True if the object contains all the keys, false otherwise.\n *\n * @example\n * // Returns true\n * has.all(new Map([\n * ['key1', 'value1'], ['key2', 'value2']\n * ]), ['key1', 'key2'])\n *\n * @example\n * // Returns false\n * has.all({}, ['key1', 'key2'])\n */\n all(object, keys) {\n if (!is.shiny(object) || !is.array(keys) || !keys.length) {\n return false\n }\n\n return keys.every((key) => has(object, key))\n },\n\n /**\n * Checks if an object contains at least one of the specified keys.\n *\n * This function determines if the provided object contains at least one\n * of the keys specified in the keys array. It supports various types of\n * objects including Map, Set, WeakMap, and WeakSet. For other objects,\n * it uses the Reflect API to check for the keys.\n *\n * @param object The object to check.\n * @param keys The array of keys to look for in the object.\n * @returns True if the object contains at least one of the keys, false\n * otherwise.\n *\n * @example\n * // Returns true\n * has.some(new Map([['key1', 'value1'], ['key2', 'value2']]), ['key1'])\n *\n * @example\n * // Returns false\n * has.some({}, ['key1', 'key2'])\n */\n some(object, keys) {\n if (!is.shiny(object) || !is.array(keys) || !keys.length) {\n return false\n }\n\n return keys.some((key) => has(object, key))\n },\n\n /**\n * Checks if an object has a 'prototype' property.\n *\n * This function is one way to determine if a supplied function is a big\n * arrow function or not. Regular functions and class functions, both\n * static and instance level, all have prototypes. Only big arrow functions\n * do not.\n *\n * @param {Object} object - The object to check.\n * @returns {boolean} True if the object has a 'prototype' property,\n * false otherwise.\n *\n * @example\n * // Returns true\n * has.prototype(function() {})\n *\n * @example\n * // Returns false\n * has.prototype(() => {})\n * has.prototype(5)\n * has.prototype(true)\n */\n prototype(object) {\n // Shiny objects work with calls to Reflect.has\n return is.shiny(object) && has(object, 'prototype')\n },\n\n /**\n * Checks if an object has a custom string tag.\n *\n * This method determines if the object has a Symbol.toStringTag property,\n * which is used to customize the behavior of Object.prototype.toString().\n *\n * @param object - The object to check.\n * @returns True if the object has a custom string tag, false otherwise.\n *\n * @example\n * const obj = { [Symbol.toStringTag]: 'CustomObject' }\n * has.stringTag(obj) // Returns true\n */\n stringTag(object) {\n return is.object(object) && has(object, Symbol.toStringTag)\n },\n\n /**\n * Checks if an object has a custom toPrimitive method.\n *\n * This method determines if the object has a Symbol.toPrimitive property,\n * which is used to convert an object to a primitive value.\n *\n * @param object - The object to check.\n * @returns True if the object has a custom toPrimitive method,\n * false otherwise.\n *\n * @example\n * const obj = { [Symbol.toPrimitive]: () => 42 }\n * has.toPrimitive(obj) // Returns true\n */\n toPrimitive(object) {\n return is.object(object) && has(object, Symbol.toPrimitive)\n },\n\n /**\n * Checks if an object has a custom valueOf method.\n *\n * This method determines if the object has a valueOf property that is a\n * function, which is used to convert an object to a primitive value.\n *\n * @param object - The object to check.\n * @returns True if the object has a custom valueOf method, false otherwise.\n *\n * @example\n * const obj = { valueOf: () => 42 }\n * has.valueOfFn(obj) // Returns true\n */\n valueOfFn(object) {\n return (\n is.object(object) && Object.hasOwn(object, \"valueOf\") && is.function(object.valueOf)\n )\n },\n})\n\nexport const as = {\n /**\n * Converts a value to an array if it is iterable.\n *\n * @param value The value to convert.\n * @returns The converted array if the value is iterable, otherwise undefined.\n *\n * @example\n * // Returns [1, 2, 3]\n * as.array([1, 2, 3])\n *\n * @example\n * // Returns ['s', 't', 'r', 'i', 'n', 'g']\n * as.array('string')\n *\n * @example\n * // Returns undefined\n * as.array(123)\n */\n array(value) {\n return (is.iterable(value) && Array.from(value)) || undefined\n },\n\n /**\n * Converts a value to an object. If the supplied value is a primitive\n * value, in many cases, this will convert it to an object instance of\n * that type. Numbers, strings, symbols, and big integers, all have\n * object instance variants. Wrapping them in a call to `Object()` will\n * convert the primitive into this instance variant.\n *\n * @param value The value to convert.\n * @returns The converted object.\n *\n * @example\n * // Returns { key: 'value' }\n * as.object({ key: 'value' })\n *\n * @example\n * // String instance as oppposed to primitive string\n * typeof as.object('string') // 'object'\n * as.object('string') instanceof String // true\n * 'string' instanceof String // false\n *\n * @example\n * // Returns {}\n * as.object(null)\n */\n object(value) {\n return Object(value)\n },\n\n /**\n * Converts a given value to a string. This function handles various types\n * of values, including null, undefined, objects with custom\n * [Symbol.toPrimitive] methods, and objects with toString or valueOf\n * methods.\n *\n * @param value The value to convert to a string.\n * @param use Optional configuration object:\n * - description: If true, returns the description of a Symbol.\n * - stringTag: If true, returns the [Symbol.toStringTag] value if present.\n * @returns The string representation of the value.\n *\n * @example\n * // Returns 'null'\n * as.string(null)\n *\n * @example\n * // Returns '123'\n * as.string(123)\n *\n * @example\n * // Returns 'custom'\n * const obj = {\n * [Symbol.toPrimitive](hint) {\n * if (hint === 'string') return 'custom'\n * return null\n * }\n * }\n * as.string(obj)\n *\n * @example\n * // Returns 'mySymbol'\n * as.string(Symbol('mySymbol'), { description: true })\n *\n * @example\n * // Returns 'Array'\n * as.string([], { stringTag: true })\n */\n string(\n value,\n use = {\n description: false,\n stringTag: false,\n }\n ) {\n // Check if the value is null or undefined directly\n if (value === null || value === undefined) {\n return String(value)\n }\n\n if (is.symbol(value) && use?.description) {\n return value.description\n }\n\n if (has.stringTag(value) && use?.stringTag) {\n return value[Symbol.toStringTag]\n }\n\n // Check if the value has a [Symbol.toPrimitive] method\n if (is.function(value?.[Symbol.toPrimitive])) {\n const primitiveValue = value[Symbol.toPrimitive](\"string\")\n if (is.string(primitiveValue)) {\n return primitiveValue\n }\n }\n\n // Check if the value has a valueOf method\n if (is.function(value?.valueOf)) {\n const valueOfValue = value.valueOf()\n if (is.string(valueOfValue)) {\n return valueOfValue\n }\n // If valueOf returns a primitive other than string, convert it to string\n if (!is.object(valueOfValue)) {\n return String(valueOfValue)\n }\n }\n\n // Check if the value has a toString method\n if (is.function(value?.toString)) {\n const stringValue = value.toString()\n if (is.string(stringValue)) {\n return stringValue\n }\n }\n\n // Fallback to String() function\n return String(value)\n },\n\n /**\n * Converts a given value to a string representing an integer.\n *\n * This method first converts the value to a number string and then extracts\n * the integer part by splitting the string at the decimal point.\n *\n * @param value The value to convert to an integer string.\n * @returns The integer part of the value as a string.\n *\n * @example\n * // Returns '123'\n * as.integerString(123.456)\n *\n * @example\n * // Returns '0'\n * as.integerString('0.789')\n */\n integerString(value) {\n return this.numberString(value).split(\".\")[0]\n },\n\n /**\n * Converts a given value to a string representing a number.\n *\n * This method first converts the value to a string, trims any whitespace,\n * and removes any non-numeric characters except for '.', 'e', 'E', '+',\n * and '-'. It then uses a regular expression to match a floating-point\n * number, allowing an optional leading '+' or '-' sign, digits before\n * and after a single decimal point.\n *\n * @param value The value to convert to a number string.\n * @returns The sanitized number string or an empty string if no valid\n * float was found.\n *\n * @example\n * // Returns '123.456'\n * as.numberString(' 123.456abc ')\n *\n * @example\n * // Returns '-0.789'\n * as.numberString('-0.789xyz')\n */\n numberString(value) {\n // Trim the input string\n const string = this.string(value)\n .trim()\n .replace(/[^0-9.eE+-]/g, \"\")\n // Use a regular expression to match a floating-point number\n // Allow an optional leading '+' or '-' sign, digits before and after a\n // single decimal point\n const sanitizedStr = string.match(/^[-+]?\\d*\\.?\\d+([eE][-+]?\\d+)?/)\n\n // Return the sanitized string or an empty string if no valid float\n // was found\n return sanitizedStr ? sanitizedStr[0] : \"\"\n },\n\n /**\n * Converts a given value to a number.\n *\n * This method uses the `numberString` method to sanitize the input value\n * and then converts it to a number.\n *\n * @param value The value to convert to a number.\n * @returns The numeric representation of the value.\n *\n * @example\n * // Returns 123.456\n * as.number('123.456abc')\n *\n * @example\n * // Returns -0.789\n * as.number('-0.789xyz')\n */\n number(value) {\n return Number(this.numberString(value))\n },\n\n /**\n * Converts a given value to a bigint.\n *\n * This method uses the `integerString` method to sanitize the input value\n * and then converts it to a bigint.\n *\n * @param value The value to convert to a bigint.\n * @returns The bigint representation of the value.\n *\n * @example\n * // Returns 123n\n * as.bigint('123.456abc')\n *\n * @example\n * // Returns 0n\n * as.bigint('0.789xyz')\n */\n bigint(value) {\n const BigInt = globalThis?.BigInt\n return BigInt(this.integerString(value))\n },\n\n /**\n * Converts a given value to a boolean.\n *\n * This method takes a value, converts it to a string, and then checks\n * if it matches common representations of boolean values. It returns\n * `true` for \"1\", \"yes\", and \"true\" (case insensitive), and `false`\n * for \"0\", \"no\", and \"false\" (case insensitive). For any other values,\n * it returns the boolean representation of the value.\n *\n * @param {*} value - The value to convert to a boolean.\n * @returns {boolean} The boolean representation of the value.\n *\n * @example\n * // Returns true\n * as.boolean(\"yes\")\n *\n * @example\n * // Returns false\n * as.boolean(\"no\")\n *\n * @example\n * // Returns true\n * as.boolean(1)\n *\n * @example\n * // Returns false\n * as.boolean(0)\n *\n * @example\n * // Returns true\n * as.boolean(\"true\")\n *\n * @example\n * // Returns false\n * as.boolean(\"false\")\n *\n * @example\n * // Returns true\n * as.boolean({})\n *\n * @example\n * // Returns false\n * as.boolean(null)\n */\n boolean(value) {\n switch (String(value).toLowerCase()) {\n case \"1\":\n case \"yes\":\n case \"true\":\n return true\n\n case \"0\":\n case \"no\":\n case \"false\":\n return false\n\n default:\n return Boolean(value)\n }\n },\n}\n\nexport function createToolkit() {\n return { si, is, has, as }\n}\n\nexport default {\n as,\n has,\n is,\n si,\n\n createToolkit,\n}\n\nfunction ifThenElse(condition, thenCase, elseCase) {\n if (typeof thenCase === 'undefined' && typeof elseCase === 'undefined')\n return !!condition\n\n if (typeof thenCase === 'undefined')\n thenCase = condition\n\n if (condition) {\n if (is.function(thenCase))\n return thenCase()\n else\n return thenCase\n }\n else {\n if (is.function(elseCase))\n return elseCase()\n else\n return elseCase\n }\n}\n", "/** @typedef {string|symbol|number} PropertyKey */\n\n/**\n * The `IsDescriptorStats` block contains all the information used to make\n * a determination as to whether a given value is a an instance of the type\n * {@link PropertyDescriptor} or at least compatible to used as one.\n *\n * @typedef {Object} IsDescriptorStats\n * @property {number} confidence this is going to be a number from 0.0-1.0\n * indicating the confidence ratio that the object supplied to `isDescriptor`\n * is actually a valid `PropertyDescriptor` object. If the number is greater\n * than 0 but less than 1.0, it likely indicates that the object can be used\n * as a `PropertyDescriptor` but one or more factors gives it less than 100%\n * confidence that being such is the objects intended purpose (e.g. it could\n * be that there are more properties than a descriptor might have or that\n * it is missing crucial properties such as `value`, `get` or `set`)\n * @property {boolean} isAccessor true if the object is functional as an\n * accessor descriptor; false otherwise\n * @property {boolean} isData true if the object is functional as a data\n * descriptor; false otherwise\n * @property {boolean} isValid true if the object is technically a valid\n * `PropertyDescriptor` object or compatible as one.\n * @property {boolean} hasBaseDescriptorKeys true if the object has either\n * `configurable` or `enumerable` property keys and both are `undefined` or\n * of type `boolean`.\n * @property {boolean} hasAccessorKeys true if the object has either `get`\n * or `set` property keys and both are either `undefined` or of type\n * `function`\n * @property {boolean} hasDataKeys true if the object has either `value` or\n * `writable` property keys and if `writable` is present, then it is of type\n * `boolean`\n */\n\n/**\n * The response from a call to {@link DescriptorUtils.isDescriptor} can\n * be either a {@link boolean} or a {@link IsDescriptorStats} object.\n *\n * @typedef {IsDescriptorStats | boolean} IsDescriptorResponse\n */\n\n/**\n * A set of utility functions work with {@link PropertyDescriptor} objects.\n * The creation of property descriptors can be large in boiler plate so\n * these tools can reduce the boiler plate and increase readability.\n *\n * @name DescriptorUtils\n * @typedef {DescriptorUtils}\n */\nexport const DescriptorUtils = {\n /**\n * Creates an accessor descriptor object\n *\n * This function has multiple possible overloads\n *\n * ```markdown\n * _**zeroFn** is a function that takes no parameters_\n * _**oneFn** is a function that takes a single parameter_\n * _**oneOrNone** is a either a function that takes a single parameter or nullish_\n * _**nonFn** is any value that is not a function_\n * _**nullish** is either null or undefined_\n * _**...** means configurable?, enumerable?, storage?, key? liaison? as\n * subsequent following parameters in that order_\n *\n * **accessor()**\n * creates a storage backed accessor that is both read and write.\n * The storage object will be a provided empty object with the key\n * being 'value'. Configurable and enumerable flags will be set to\n * `true`.\n *\n * **accessor(options)**\n * this single argument variant of accessor() consists of a single\n * options object. If neither `get` nor `set` are provided, a\n * storage backed read-write accessor with undefined as the initial\n * value will be constructed.\n *\n * **accessor(nonFn)**\n * **accessor(any, true, options?)**\n * **accessor(any, true, ...)**\n * supplying only a non-function only parameter or any value and the\n * value `true` as the second parameter, you will get a read-write\n * accessor stored in the default or specified storage. The resultant\n * initial value will be whatever is provided as the first parameter.\n * See options to customize `configurable`, `enumerable`, `storage`,\n * `key` and the `liaison` factory function.\n *\n * **accessor(any, false, options?)**\n * **accessor(any, false, ...)**\n * supplying only a non-function only parameter or any value and the\n * value `false` as the second parameter, you will get a read-only\n * getter stored in the default or specified storage. The resultant\n * value will be whatever is provided as the first parameter.\n * See options to customize `configurable`, `enumerable`, `storage`,\n * `key` and the `liaison` factory function.\n *\n * **accessor(zeroFn)**\n * **accessor(zeroFn, nullish, options?)**\n * **accessor(zeroFn, nullish, ...)**\n * creates a generic read-only accessor with the first no-argument\n * function parameter being the getter and either null or undefined\n * for the setter. Either an options object or the manually ordered\n * parameters can optionally follow if a nullish value for setter\n * is provided.\n *\n * **accessor(zeroFn, oneOrNone, options?)**\n * **accessor(zeroFn, oneOrNone, ...)**\n * creates a generic read-write accessor with the first no-argument\n * function parameter being the getter and the second single-argument\n * function parameter being the setter. Either an options object or\n * the manually ordered parameters can optionally follow.\n *\n * **accessor(oneFn, oneFn, options?)**\n * **accessor(oneFn, oneFn, ...)**\n * this special variant of the accessor() invocation, allows a single\n * argument getter and setter factory to be supplied. These will\n * automatically be invoked with the specified or default storage\n * object. The result of the getter factory should be a no argument\n * function. And the result of the setter factory should be a single\n * argument function. The options for `liaison` and `key` will be\n * ignored and should be handled specifically in the factory\n * functions to suit your own use case.\n * ```\n *\n * Options are an object oriented way of supplying the alternate\n * flags to the data descriptor. They are\n *\n * \u2022 `get` - only referenced when an options object is the only parameter\n * \u2022 `set` - only referenced when an options object is the only parameter\n * \u2022 `configurable` - if true, the descriptor of the object that this\n * accessor descriptor represents can be redefined at later time by\n * subsequent calls to {@link Object.defineProperty} or\n * {@link Object.defineProperties}\n * \u2022 `enumerable` - if true, enumeration over the object this\n * descriptor is applied to, will show the property\n * represented by this descriptor. See the associated MDN\n * page regarding this {@link PropertyDescriptor} if you\n * want to know more.\n * \u2022 `storage` - an object, usually {@link Object} or {@link Map} or\n * nullish if unused\n * \u2022 `key` - a {@link PropertyKey} of your choosing or the default\n * string `\"value\"`\n * \u2022 `bind` - true if you wish to have the `storage` object bound as\n * the `thisObj` for both the `get` and `set` functions when\n * storage is used. **note* this will not work if you supply a\n * big arrow function for the accessor function in question. This\n * defaults to `false`.\n * \u2022 `liaison` - an optional factory function that must return an\n * object with two properties. The first is a `get()` function that\n * returns a value and the second is a `set(value)` function that\n * stores a value. The factory function receives `storage` and\n * `key`, in that order. The default uses {@link Map.get} and\n * {@link Map.set} if the storage is an instance of {@link Map}.\n * Otherwise, the typical `object[key]` format is used if the\n * storage object is an instanceof {@link Object}\n *\n * @param {(object|any)?} value the JavaScript value representing\n * this descriptor's value or an options object if it is the\n * only parameter.\n * @param {(object|boolean)?} optionsOrConfigurable true or false if\n * you wish the `configurable` flag to be set. Optionally supply an\n * object with one of the supported options to configure the run\n * of the function.\n * @param {boolean?} enumerable true or false if you wish to\n * configure the `.enumerable` property of the descriptor\n * @param {object?} storage an object upon which data storage should\n * be written to and read from. Defaults to an empty {@link Object}\n * when storage is needed and not supplied via this parameter or\n * an options object.\n * @param {PropertyKey?} key the key used to store content on the\n * storage object.\n * @param {(object, PropertyKey) => { get: ()=>any, set: (v)=>void}} liaison\n * an optional function that, given a storage object and property key,\n * returns an object with a no argument `get()` function that returns\n * the value on the storage object with a given key and a single argument\n * `set(value)` function that stores a new value using the property key\n * on the supplied storage object. This exists because access to a\n * {@link Map} and {@link Object} values are handled differently. If you\n * need support for some other class than `Map` or `Object` then you\n * should provide a liaison function to define access.\n *\n * @returns {PropertyDescriptor}\n *\n * @see {@link PropertyDescriptor}\n * @note More info on this can be found at the\n * [MDN Object.defineProperty/ies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty)\n * page\n *\n * @type {Function & { keys: string[] }}\n */\n get accessor() {\n function accessor(\n get,\n set,\n optionsOrConfigurable = true,\n enumerable = true,\n storage,\n key = 'value',\n liaison\n ) {\n const count = arguments.length\n const storageKeys = ['storage', 'key', 'liaison', 'initial', 'bind']\n const optionKeys = [\n // accessor functions\n 'get', 'set',\n\n // descriptor flags\n 'configurable', 'enumerable',\n\n // storage configuration keys\n ...storageKeys\n ]\n const has = (object, key) => isObject(object) && Reflect.has(object, key)\n const isOpts = object => optionKeys.some(key => has(object, key))\n\n let configurable = !!optionsOrConfigurable\n let initial = undefined\n let bind = false\n let options = {}\n\n if (count === 1 && isObject(get) && hasSome(get, ...optionKeys)) {\n options = { ...get };\n ({ get, set } = get);\n }\n\n if (isObject(optionsOrConfigurable) || isObject(set)) {\n options = isObject(set) && count === 2\n ? { ...set }\n : { ...optionsOrConfigurable };\n\n ({ configurable, enumerable, storage, key, bind, initial } = options)\n }\n\n liaison = options?.liaison ?? liaison ?? ((storage, key) => ({\n get() {\n if (storage instanceof Map)\n return storage.get(key)\n else if (isObject(storage))\n return storage[key]\n },\n set(value) {\n if (storage instanceof Map)\n storage.set(key, value)\n else if (isObject(storage))\n storage[key] = value\n }\n }))\n\n configurable = configurable ?? true\n enumerable = enumerable ?? true\n key = key ?? 'value'\n bind = bind ?? false\n\n const nullish = (value) => value === null || value === undefined\n const nonFn = (value) => !nullish(value) && typeof value !== 'function'\n const yesFn = (value) => typeof value === 'function'\n const zeroFn = (value) => (yesFn(value) && value.length === 0)\n const oneFn = (value) => (yesFn(value) && value.length === 1)\n const isTrue = (value) => value === true\n const isFalse = (value) => value === false\n const addRefs = (fn, value) => Object.defineProperties(fn, {\n storage: { value, configurable: true, enumerable: false },\n key: { value: key, configurable: true, enumerable: false },\n })\n\n if (count === 0 || (!get && !set)) {\n storage = { [key]: initial }\n const _ = liaison(storage, key)\n\n get = addRefs(function() { return _.get() }, storage)\n set = addRefs(function(value) { _.set(value) }, storage)\n\n return { get, set, configurable, enumerable }\n }\n\n if (count === 1 && oneFn(get)) {\n set = false\n }\n\n if ((count === 1 && nonFn(get)) || (isTrue(set) || isFalse(set))) {\n const skipSet = isFalse(set)\n\n if (!storage || !(storage instanceof Map) || !isObject(storage)) {\n storage = {}\n }\n\n const _ = liaison(storage, key)\n _.set(get)\n\n let _get = function() { return _.get() }\n let _set = function(value) { _.set(value) }\n\n if (bind) {\n _get = _get.bind(storage)\n _set = _set.bind(storage)\n }\n\n get = addRefs(_get, storage)\n set = addRefs(_set, storage)\n\n if (skipSet) {\n set = undefined\n }\n\n return {get, set, configurable, enumerable}\n }\n\n if ((zeroFn(get) && !set) || (zeroFn(get) && oneFn(set))) {\n const descriptor = { get, set, configurable, enumerable }\n\n if (isObject(options) && Reflect.has(options, 'initial'))\n descriptor.set(initial)\n\n return descriptor\n }\n\n if (oneFn(get) && oneFn(set)) {\n storage = storage || { }\n\n let _get = get(storage)\n let _set = set(storage)\n\n if (bind) {\n _get = _get.bind(storage)\n _set = _set.bind(storage)\n }\n\n return {\n get: addRefs(_get, storage),\n set: addRefs(_set, storage),\n configurable,\n enumerable,\n }\n }\n\n return { get, set, configurable, enumerable }\n }\n\n Object.defineProperty(accessor, 'keys', {\n get() { return Object.defineProperties(\n ['get', 'set', 'configurable', 'enumerable'],\n {\n from: {\n value: function extractKeysFrom(object) {\n const response = {\n get: undefined,\n set: undefined,\n configurable: undefined,\n enumerable: undefined,\n }\n\n if (!object || !(object instanceof Object))\n return response\n\n for (const key of DescriptorUtils.accessor.keys) {\n if (Reflect.has(object, key))\n response[key] = object[key]\n }\n },\n writable: false,\n configurable: false,\n enumerable: false\n }\n }\n ) },\n configurable: true,\n enumerable: false,\n })\n\n return accessor\n },\n\n /**\n * Creates a data descriptor object\n *\n * This function has multiple possible overloads\n *\n * ```markdown\n * **data()**\n * creates a data descriptor with a value of `undefined` that\n * is writable, configurable and enumerable.\n *\n * **data(options)**\n * if the only parameter is an object and that object contains\n * at least a `.value` property, this funtion will return a\n * data descriptor with the associated values. This variant\n * is useful if you want to extract the normal data descriptor\n * properties: value, writable, configurable and/or enumerable\n * from an object that has properties with these names, in\n * addition to other properties or functions. Note that if you\n * wish for the value of the descriptor to be an object that\n * also contains a `.value` property, use `data({value: obj})`\n * instead.\n *\n * **data(value)**\n * **data(value, options?)**\n * creates a data descriptor from the supplied `value`,\n * optionally augmented by additional `options`. The defaults\n * for this writable, configurable and enumerable values set\n * to `true`\n *\n * **data(value, writable?, configurable?, enumerable?)**\n * if writable, configurable or enumerable or true or false\n * then this function creates a data descriptor with those\n * flags and the supplied value (there's no real reason to\n * invoke this function if you're supplying all four values)\n * ```\n *\n * Options are an object oriented way of supplying the alternate\n * flags to the data descriptor. They are\n *\n * \u2022 `value` - only referenced when an options object is the\n * only parameter\n * \u2022 `writable` - true if the value represented by this data\n * descriptor can be reassigned a new value.\n * \u2022 `configurable` - if true, the descriptor of the object\n * that this data descriptor represents can be redefined at\n * later time by subsequent calls to `Object.defineProperty`\n * or `Object.defineProperties`. If `.configurable` is true\n * this can be done even if `.writable` is set to false\n * \u2022 `enumerable` - if true, enumeration over the object this\n * descriptor is applied to, will show the property\n * represented by this descriptor. See the associated MDN\n * page regarding this `PropertyDescriptor` if you want to\n * know more.\n *\n * @param {(object|any)?} value the JavaScript value representing\n * this descriptor's value or an options object if it is the\n * only parameter.\n * @param {(object|boolean)?} optionsOrWritable true or false if\n * you wish the writable flag to be set. Optionally supply an\n * object with one of the supported options to configure the run\n * of the function.\n * @param {boolean?} configurable true or false if you wish to\n * configure the `.configurable` property of the descriptor\n * @param {boolean?} enumerable true or false if you wish to\n * configure the `.enumerable` property of the descriptor\n * @returns {PropertyDescriptor}\n *\n * @note More info on this can be found at the\n * [MDN Object.defineProperty/ies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty)\n * page\n *\n * @type {Function & { keys: string[] }}\n */\n get data() {\n function data(value, optionsOrWritable, configurable, enumerable) {\n const count = arguments.length\n let valueIsDescriptor = false\n\n if (count === 0) {\n return {\n value: undefined,\n writable: true,\n configurable: true,\n enumerable: true\n }\n }\n\n if (count === 1) {\n const stats = DescriptorUtils.isDescriptor(value, true)\n if (stats.isValid && stats.isData) {\n valueIsDescriptor = true\n }\n }\n\n let writable = optionsOrWritable === undefined\n ? true\n : !!optionsOrWritable;\n\n let options = typeof optionsOrWritable === 'boolean'\n ? {}\n : Object(optionsOrWritable);\n\n configurable = configurable === undefined ? true : !!configurable\n enumerable = enumerable === undefined ? true : !!enumerable\n\n if (valueIsDescriptor && !(options?.allowDescriptorValue)) {\n options = {\n writable: value?.writable ?? true,\n configurable: value?.configurable ?? true,\n enumerable: value?.enumerable ?? true,\n };\n value = value?.value\n }\n\n if (options) {\n ({writable, configurable, enumerable} = {\n ...{writable, configurable, enumerable},\n ...options\n })\n }\n\n return { value, writable, configurable, enumerable }\n }\n\n Object.defineProperty(data, 'keys', {\n value: Object.defineProperties(\n ['value', 'writable', 'configurable', 'enumerable'],\n {\n from: {\n value: function extractKeysFrom(object) {\n const response = {\n value: undefined,\n writable: undefined,\n configurable: undefined,\n enumerable: undefined,\n }\n\n if (!object || !(object instanceof Object))\n return response\n\n for (const key of DescriptorUtils.data.keys) {\n if (Reflect.has(object, key))\n response[key] = object[key]\n }\n },\n writable: false,\n configurable: false,\n enumerable: false,\n }\n }\n ),\n writable: false,\n configurable: true,\n enumerable: false\n })\n\n return data\n },\n\n describe(object, key, value, detectDescriptorValues = true) {\n const { isAccessor, isData, data } = DescriptorUtils\n\n if (!(object && object instanceof Object))\n return undefined\n\n if (!(['string', 'number', 'symbol'].includes(typeof key)))\n return undefined\n\n if (detectDescriptorValues && isAccessor(value) || isData(value)) {\n return Object.defineProperty(object, key, value)\n }\n else {\n return Object.defineProperty(object, key, data(value))\n }\n },\n\n describeMany(object, keyValues, detectDescriptorValues = true) {\n const { isAccessor, isData, isDescriptor, data, describe } = DescriptorUtils\n const isKey = k => ['string', 'number', 'symbol'].includes(typeof k)\n\n let map = undefined\n\n if (Array.isArray(keyValues)) {\n map = new Map(keyValues.filter(keyValue => {\n return typeof keyValue === 'function' && keyValue.length === 2\n }))\n }\n else if (keyValues instanceof Map) {\n map = keyValues\n }\n else if (keyValues instanceof Object) {\n const descriptors = Object.getOwnPropertyDescriptors(keyValues)\n map = new Object.entries(descriptors)\n }\n else {\n return []\n }\n\n for (const [key, value] of map) {\n if (detectDescriptorValues) {\n if (isDescriptor(key)) {\n\n }\n }\n }\n\n const accessorBase = { enumerable: true, configurable: true }\n const dataBase = { writable: true, ...accessorBase }\n const extractBase = descriptor => {\n if (isAccessor(descriptor)) {\n const { configurable, enumerable } = descriptor\n return { configurable, enumerable }\n }\n else if (isData(descriptor)) {\n const { writable, configurable, enumerable } = descriptor\n return { writable, configurable, enumerable }\n }\n return undefined\n }\n\n // convert all map entries to\n // [baseDescriptor, {key: value, key: value, ...}]\n // unless detectDescriptorValues == false in which case\n // [dataBase, { key: value, key: value, etc... }]\n // ... dropping all non-isKey(key) values\n\n for (const [key, value] of map.entries()) {\n const descriptor = (detectDescriptorValues && isDescriptor(value)\n ? value\n : data(value, dataBase)\n )\n\n }\n\n },\n\n extract(\n fromObject,\n keysToExtract,\n defaultIfMissing = undefined,\n extractDescriptors = false\n ) {\n const { data } = DescriptorUtils\n const output = { }\n\n if (!fromObject || typeof fromObject !== 'object')\n return output\n\n if (!Array.isArray(keysToExtract))\n keysToExtract = [keysToExtract]\n\n for (const key of keysToExtract) {\n let descriptor = Object.getOwnPropertyDescriptor(fromObject, key)\n\n if (!descriptor)\n descriptor = data(defaultIfMissing)\n\n if (extractDescriptors)\n descriptor.value = data(descriptor, { allowDescriptorValue: true })\n\n Object.defineProperty(output, key, descriptor)\n }\n\n return output\n },\n\n /**\n * Determines if a given value is an accessor descriptor.\n *\n * An accessor descriptor is a property descriptor that defines\n * getter and/or setter functions for a property. This function\n * checks the validity of the descriptor and whether it qualifies\n * as an accessor.\n *\n * @param {Object} value - The descriptor object to evaluate.\n * @param {boolean} [strict=true] - If true, performs a strict\n * validation of the descriptor.\n * @returns {boolean} Returns true if the descriptor is valid and\n * is an accessor descriptor, otherwise false.\n *\n * @example\n * // Example usage:\n * const descriptor = { get: () => 42, set: (val) => {} }\n * const result = DescriptorUtils.isAccessor(descriptor)\n * console.log(result) // Outputs: true\n */\n isAccessor(value, strict = true) {\n const stats = DescriptorUtils.isDescriptor(value, true, strict)\n return stats.isValid && stats.isAccessor\n },\n\n /**\n * Checks if a given value is a data descriptor.\n *\n * A data descriptor is a property descriptor that defines a value\n * and optionally a writable attribute for a property. This function\n * evaluates the descriptor's validity and whether it qualifies as\n * a data descriptor.\n *\n * @param {Object} value - The descriptor object to evaluate.\n * @param {boolean} [strict=true] - If true, performs a strict\n * validation of the descriptor.\n * @returns {boolean} Returns true if the descriptor is valid and\n * is a data descriptor, otherwise false.\n *\n * @example\n * // Example usage:\n * const descriptor = { value: 42, writable: true }\n * const result = DescriptorUtils.isData(descriptor)\n * console.log(result) // Outputs: true\n */\n isData(value, strict = true) {\n const stats = DescriptorUtils.isDescriptor(value, true, strict)\n return stats.isValid && stats.isData\n },\n\n /**\n * A function that, given a value that might be a `PropertyDescriptor`,\n * calculates a deterministic probability that the supplied value is\n * an object that either is a `PropertyDescriptor` or that can function\n * as one.\n *\n * @param {unknown} value a JavaScript value that might be a\n * `PropertyDescriptor` type.\n * @param {boolean?} returnStats if this value is true, instead of returning\n * a determined boolean value indicating the supplied value might be a\n * `PropertyDescriptor`, an object containing the determined flags and score\n * the led to the determination instead is returned.\n * @param {boolean?} strict if this value is `true`, which is the default,\n * then the function will not allow descriptor compatible objects, rather it\n * will only return true if the object has keys that belong in a descriptor\n * and do not form an invalid combination.\n * @returns {IsDescriptorResponse} if `returnStats` is `true`\n * an object of type {@link IsDescriptorStats} is returned. This object\n * will have a lot of {@link Boolean} flags pertaining to the `true`/`false`\n * evaluation. If `returnStats` is `false`, then a boolean value denoting\n * whether or not the value is a {@link PropertyDescriptor} is returned\n * instead. This is effectively the same as the `isValid` parameter from the\n * stats block.\n */\n isDescriptor(value, returnStats = false, strict = true) {\n const areBools = (...props) => props.flat().every(\n prop => boolTypes.includes(typeof value[prop])\n );\n\n const areFuncs = (...props) => props.flat().every(\n prop => funcTypes.includes(typeof value[prop])\n );\n\n const hasKeyFn = (property) => Reflect.has(value, property)\n const isOfType = (type) => (element) => typeof element === type\n\n const baseProps = [ 'configurable', 'enumerable' ]\n const dataProps = [ 'value', 'writable' ]\n const accessorProps = [ 'get', 'set' ]\n const anyDescProps = [ ...baseProps, ...dataProps, ...accessorProps ]\n const boolTypes = [ 'undefined', 'boolean' ]\n const funcTypes = [ 'undefined', 'function' ]\n const stats = {\n confidence: 0,\n hasAccessorKeys: false,\n hasBaseDescriptorKeys: false,\n hasDataKeys: false,\n isAccessor: false,\n isData: false,\n isValid: false,\n isBase: false,\n }\n\n if (!value || typeof value !== 'object' || !(value instanceof Object))\n return returnStats ? stats : false;\n\n let score = 0\n\n if (value && typeof value === 'object') {\n const objKeys = Reflect.ownKeys(value)\n const nonDescKeys = objKeys.filter(k => !(anyDescProps.includes(k)))\n\n if (strict && nonDescKeys.length)\n return false\n\n if (objKeys.length <= 4)\n score++\n\n stats.hasAccessorKeys =\n accessorProps.some(hasKeyFn) && areFuncs(accessorProps)\n\n stats.hasDataKeys =\n dataProps.some(hasKeyFn) && areBools('writable')\n\n stats.hasBaseDescriptorKeys =\n baseProps.some(hasKeyFn) && areBools(baseProps)\n\n if (stats.hasBaseDescriptorKeys)\n score++\n\n if (stats.hasAccessorKeys || stats.hasDataKeys)\n score++\n\n if (score > 0)\n stats.isValid = true\n\n if (score > 0 && stats.hasAccessorKeys)\n stats.isAccessor = true\n\n if (score > 0 && stats.hasDataKeys)\n stats.isData = true\n\n if (stats.isValid && !(['get','set','value'].some(hasKeyFn)))\n stats.isBase = true\n\n if (stats.isValid && stats.isData && Reflect.has(value, 'value'))\n score++\n\n else if (stats.isValid && stats.isAccessor) {\n if ([value?.get, value?.set].some(isOfType('function')))\n score++\n }\n\n if (stats.hasAccessorKeys && stats.hasDataKeys) {\n score = 0\n stats.isValid = false\n }\n\n stats.confidence = parseFloat(score / 4.0)\n }\n\n if (returnStats)\n return stats\n\n return score >= 0.0\n ? true\n : false;\n },\n\n /**\n * Redefines a property on an object with new descriptors and options.\n * This function allows renaming, aliasing, and redefining property\n * descriptors such as configurable, enumerable, writable, get, and set.\n *\n * @param {Object} object - The target object whose property is to be\n * redefined.\n * @param {string|symbol} key - The key of the property to redefine.\n * @param {Object} as - An object containing new property descriptors.\n * @param {Object} [options] - Optional settings for renaming and aliasing.\n * @param {string|symbol} [options.rename] - New key name for the property.\n * @param {Array<string|symbol>} [options.alsoAs] - Additional aliases for\n * the property.\n * @param {Object} [options.moveTo] optionally move the descriptor from this\n * object to another.\n * @returns {any} the result of `object[key]` in its final state\n *\n * @example\n * const obj = { a: 1 }\n * redescribe(obj, 'a', { writable: false }, { rename: 'b', alsoAs: ['c'] })\n * console.log(obj.b) // Outputs: 1\n * console.log(obj.c) // Outputs: 1\n */\n redescribe(object, key, as, options) {\n const { isAccessor, isData } = DescriptorUtils\n\n const ifThen = (condition, fn, ...args) => condition && fn(...args)\n const isBool = value => typeof value === 'boolean' || value instanceof Boolean\n const isFunction = value => typeof value === 'function'\n const isObject = value => value && value instanceof Object\n const isDefined = (value, key) => isObject(value) && Reflect.has(value, key)\n const isObjectKey = v => ['string', 'number', 'symbol'].includes(typeof v)\n const define = (key, values) => Object.defineProperty(object, key, values)\n const assign = (object, ...values) => Object.assign(object, ...values)\n\n const isAnObject = isObject(object)\n let asIsObject = isObject(as)\n const descriptor = isAnObject && Object.getOwnPropertyDescriptor(object, key)\n const aliases = []\n\n if (descriptor && !asIsObject) {\n asIsObject = true\n as = {}\n }\n\n if (isObject(options)) {\n if (isDefined(options, 'rename')) {\n const successfulDelete = delete object[key]\n\n if (successfulDelete)\n key = options.rename\n }\n\n if (isDefined(options, 'alsoAs')) {\n if (Array.isArray(options.alsoAs)) {\n for (const value of options.alsoAs.filter(v => isObjectKey(v)))\n aliases.push(value)\n }\n else if (isObjectKey(options.alsoAs)) {\n aliases.push(options.alsoAs)\n }\n }\n\n if (isDefined(options, 'moveTo')) {\n ifThen(isObject(options.moveTo), () => (object = options.moveTo))\n }\n }\n\n if (isAnObject && asIsObject) {\n let { configurable, enumerable, writable, get, set, value } = as\n\n if (isAccessor(descriptor)) {\n ifThen(isFunction(get), () => assign(descriptor, { get }))\n ifThen(isFunction(set), () => assign(descriptor, { set }))\n }\n\n ifThen(isBool(writable) && isData(descriptor), () => {\n assign(descriptor, {\n writable,\n value: isDefined(as, 'value')\n ? value\n : descriptor.value,\n })\n })\n\n ifThen(isBool(configurable), () => assign(descriptor, { configurable }))\n ifThen(isBool(enumerable), () => assign(descriptor, { enumerable }))\n\n define(key, descriptor)\n\n for (const alias of aliases) {\n define(alias, descriptor)\n }\n\n return object[key]\n }\n },\n\n /**\n * Retrieves the keys associated with accessor descriptors.\n *\n * Accessor descriptors are property descriptors that define\n * getter and/or setter functions for a property.\n *\n * @type {string[]}\n *\n * @example\n * // Example usage:\n * const keys = DescriptorUtils.kAccessorDescriptorKeys\n * console.log(keys) // Output: ['get', 'set']\n */\n get kAccessorDescriptorKeys() {\n return ['get', 'set']\n },\n\n /**\n * Retrieves the keys associated with data descriptors.\n *\n * Data descriptors are property descriptors that define a value\n * and optionally a writable attribute for a property.\n *\n * @type {string[]}\n *\n * @example\n * // Example usage:\n * const keys = DescriptorUtils.kDataDescriptorKeys\n * console.log(keys) // Output: ['value', 'writable']\n */\n get kDataDescriptorKeys() {\n return ['value', 'writable']\n },\n\n /**\n * Retrieves the keys associated with shared descriptors.\n *\n * Shared descriptors are property descriptors that define\n * common attributes for a property, such as whether the\n * property is configurable or enumerable.\n *\n * @type {string[]}\n *\n * @example\n * // Example usage:\n * const keys = DescriptorUtils.kSharedDescriptorKeys\n * console.log(keys) // Output: ['configurable', 'enumerable']\n */\n get kSharedDescriptorKeys() {\n return ['configurable', 'enumerable']\n },\n\n /**\n * Retrieves all descriptor keys, combining accessor, data, and shared\n * descriptor keys.\n *\n * This getter method aggregates keys from accessor descriptors,\n * data descriptors, and shared descriptors into a single array.\n * This can be useful when you need to validate or inspect all\n * possible descriptor keys.\n *\n * @type {string[]}\n *\n * @example\n * // Example usage:\n * const allKeys = DescriptorUtils.kDescriptorKeys\n * console.log(allKeys)\n * // Output: [\n * // 'get', 'set', 'value', 'writable', 'configurable', 'enumerable'\n * // ]\n */\n get kDescriptorKeys() {\n return [\n ...(this.kAccessorDescriptorKeys),\n ...(this.kDataDescriptorKeys),\n ...(this.kSharedDescriptorKeys),\n ]\n }\n}\n\n// Destructure the functions individually...\nconst {\n accessor, data, describe, describeMany, extract, isDescriptor,\n isAccessor, isData, redescribe,\n} = DescriptorUtils\n\n// ...also destructure the constants individually....\nconst {\n kAccessorDescriptorKeys,\n kDataDescriptorKeys,\n kDescriptorKeys,\n kSharedDescriptorKeys\n} = DescriptorUtils\n\n// ... so they can also be individually exported.\nexport {\n accessor,\n data,\n describe,\n describeMany,\n extract,\n isAccessor,\n isData,\n isDescriptor,\n redescribe,\n\n kAccessorDescriptorKeys,\n kDataDescriptorKeys,\n kDescriptorKeys,\n kSharedDescriptorKeys\n}\n\n// Provide default exports as well\nexport default {\n DescriptorUtils,\n\n accessor,\n data,\n describe,\n describeMany,\n extract,\n isAccessor,\n isData,\n isDescriptor,\n redescribe,\n\n kAccessorDescriptorKeys,\n kDataDescriptorKeys,\n kDescriptorKeys,\n kSharedDescriptorKeys\n}\n\n// ---- non-exported helper functions ----\n\nfunction isObject(o) { return o && typeof o === 'object' }\nfunction hasSome(object, ...keys) { return hasQuantity('some', object, keys) }\nfunction hasQuantity(quantityFn, object, keys) {\n return isObject(object) && (keys.flat(Infinity)\n .map(key => Reflect.has(object, key))\n [quantityFn](has => has)\n )\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiBO,SAAS,UAAU,MAAM;AAC9B,MAAI;AAAE,WA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CAAC,EACnC,UAAU,EAAE,CAAAG,SAAOA,IAAG;AAE3B;;;AJ79BA,IAAO,gBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
+
"names": ["property", "data", "callback", "styles", "has", "BigInt", "accessor", "has", "key", "storage", "data", "isAccessor", "isData", "isDescriptor", "describe", "map", "property", "as", "isObject", "object", "has"]
|
|
7
|
+
}
|