{"_id":"@art-suite/art-core-arrays","_rev":"5-8e2776be456b6f24160b5fa5a4f97a4f","name":"@art-suite/art-core-arrays","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@art-suite/art-core-arrays","version":"0.1.0","author":{"name":"Shane Brinkman-Davis Delamore"},"license":"ISC","_id":"@art-suite/art-core-arrays@0.1.0","maintainers":[{"name":"shanebdavis","email":"shanebdavis@gmail.com"}],"homepage":"https://github.com/art-suite/art-suite-foundations","bugs":{"url":"https://github.com/art-suite/art-suite-foundations/issues"},"dist":{"shasum":"5fb5c4e07244ef4b7eaaf064ba99cf9d18d963d6","tarball":"https://registry.npmjs.org/@art-suite/art-core-arrays/-/art-core-arrays-0.1.0.tgz","fileCount":33,"integrity":"sha512-zGCAmfZ/P+KpL/bIN+75zLpWIuTIzRPaVVi35JsUwjPFi1vd99a7O+MtCVClkCPAxnaBFj4yXnyg/qZXRFB8Pw==","signatures":[{"sig":"MEQCID+IyS5aZUC+AaTEZVGVsOQ9M9G2ruGkQ8GuwsYTHrOcAiAB7z+pfl+tGvc0Onv8/J3l1G97+n2bQDRbMasw7I18rw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54456},"jest":{"verbose":true,"testEnvironment":"node","collectCoverageFrom":["build/**/*.js","!build/test/**/*.js"],"testPathIgnorePatterns":["/node_modules/","<rootDir>/test"],"coveragePathIgnorePatterns":["/index.js$","/namespace.js$"]},"main":"./build","watch":{"build":{"quiet":false,"patterns":["source"],"extensions":["caf","coffee"]}},"exports":{".":{"import":"./index.mjs","require":"./build/index.js"}},"gitHead":"c6420897fc5e0c6e6d2704f4de06f7a1c1bfdb49","scripts":{"nn":"nn build/* ","test":"jest","build":"rsync -av --exclude='*.caf' --exclude='*.coffee' ./source/ ./build/\ncoffee -m --output build --compile source &\nCOFFEE_PID=$!\ncaf -m -c source -o build --require coffee-script/register&\nCAF_PID=$!\nwait $COFFEE_PID || exit 1\nwait $CAF_PID || exit 1\nnpm run nn","clean":"rm -rf build/*","test-watch":"jest --watch","build-clean":"# BUILD CLEAN START\n#   - building into: build-temp\n#\nrm -rf ./__build-old__\nrsync -av --exclude='*.caf' --exclude='*.coffee' ./source/ ./build-temp/\ncoffee -m --output build-temp --compile source &\nCOFFEE_PID=$!\ncaf -m -c source -o build-temp --require coffee-script/register&\nCAF_PID=$!\nwait $COFFEE_PID || exit 1\nwait $CAF_PID || exit 1\nnpm run nn\n\nnn build-temp/*\n\n# BUILD CLEAN FINIALIZING\n#  - replace old build in:   build\n#  - with new build from:    build-temp\n#\nmv build __build-old__\nmv build-temp build\nrm -rf ./__build-old__","build-watch":"nodemon -e js,ts,jsx,tsx,caf,coffee,json -w \"source/**\" -x npm run build"},"_npmUser":{"name":"shanebdavis","email":"shanebdavis@gmail.com"},"repository":{"url":"git+https://github.com/art-suite/art-suite-foundations.git","type":"git"},"_npmVersion":"10.9.0","description":"The Standard Library for JavaScript that aught to be.","directories":{},"_nodeVersion":"22.12.0","dependencies":{"caffeine-script-runtime":"^1.14.0","@art-suite/art-core-math":"^0.1.0","@art-suite/art-core-types":"^0.2.0","neptune-namespaces-runtime":"^3.2.14"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^7.2.0","art-testbench":"^3.2.17","art-build-configurator":"^1.30.4","@art-suite/standard-package-builder":"^1.2.7"},"_npmOperationalInternal":{"tmp":"tmp/art-core-arrays_0.1.0_1746722628668_0.11893283362345697","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@art-suite/art-core-arrays","version":"0.1.1","author":{"name":"Shane Brinkman-Davis Delamore"},"license":"ISC","_id":"@art-suite/art-core-arrays@0.1.1","maintainers":[{"name":"shanebdavis","email":"shanebdavis@gmail.com"}],"homepage":"https://github.com/art-suite/art-suite-foundations","bugs":{"url":"https://github.com/art-suite/art-suite-foundations/issues"},"dist":{"shasum":"b7305548ff483dce107fcae5f7f87d9f05383c6d","tarball":"https://registry.npmjs.org/@art-suite/art-core-arrays/-/art-core-arrays-0.1.1.tgz","fileCount":33,"integrity":"sha512-axFbx3lVH4t9UKY0EqHevu/3Qck37unQZuGDJNJpSJr7wf4eFlZIZyXyw+BD9QMYlI4BtzMG+qwTP8hK65TwYA==","signatures":[{"sig":"MEYCIQDE1vEKFDWRriDkL0q2fUiNuPjF+xSdYOYmLbmBQT2skwIhAP6n28VFBqW58dBhpQ8qexl3tETW4pQoGkGgDMEpTkbb","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54091},"jest":{"verbose":true,"testEnvironment":"node","collectCoverageFrom":["build/**/*.js","!build/test/**/*.js"],"testPathIgnorePatterns":["/node_modules/","<rootDir>/test"],"coveragePathIgnorePatterns":["/index.js$","/namespace.js$"]},"main":"./build","watch":{"build":{"quiet":false,"patterns":["source"],"extensions":["caf","coffee"]}},"exports":{".":{"import":"./index.mjs","require":"./build/index.js"}},"gitHead":"bedd81435373af9778e14146163a6077d4fdcc81","scripts":{"nn":"nn build/* ","test":"jest","build":"rsync -av --exclude='*.caf' ./source/ ./build/\ncaf -m -c source -o build\nnpm run nn","clean":"rm -rf build/*","test-watch":"jest --watch","build-clean":"# BUILD CLEAN START\n#   - building into: build-temp\n#\nrm -rf ./__build-old__\nrsync -av --exclude='*.caf' ./source/ ./build-temp/\ncaf -m -c source -o build-temp\nnpm run nn\n\nnn build-temp/*\n\n# BUILD CLEAN FINIALIZING\n#  - replace old build in:   build\n#  - with new build from:    build-temp\n#\nmv build __build-old__\nmv build-temp build\nrm -rf ./__build-old__","build-watch":"nodemon -e js,ts,jsx,tsx,caf,coffee,json -w \"source/**\" -x npm run build"},"_npmUser":{"name":"shanebdavis","email":"shanebdavis@gmail.com"},"repository":{"url":"git+https://github.com/art-suite/art-suite-foundations.git","type":"git"},"_npmVersion":"10.9.0","description":"The Standard Library for JavaScript that aught to be.","directories":{},"_nodeVersion":"22.12.0","dependencies":{"caffeine-script-runtime":"^1.14.0","@art-suite/art-core-math":"^0.1.1","@art-suite/art-core-types":"^0.2.2","neptune-namespaces-runtime":"^3.2.14"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^7.2.0","art-testbench":"^3.2.17","art-build-configurator":"^1.30.4","@art-suite/standard-package-builder":"^1.2.7"},"_npmOperationalInternal":{"tmp":"tmp/art-core-arrays_0.1.1_1746783864085_0.16274742925425612","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@art-suite/art-core-arrays","version":"0.1.2","author":{"name":"Shane Brinkman-Davis Delamore"},"license":"ISC","_id":"@art-suite/art-core-arrays@0.1.2","maintainers":[{"name":"shanebdavis","email":"shanebdavis@gmail.com"}],"homepage":"https://github.com/art-suite/art-suite-foundations","bugs":{"url":"https://github.com/art-suite/art-suite-foundations/issues"},"dist":{"shasum":"9e1ee8cdaba88abb2e2f09cc25fbf468a4e47fa8","tarball":"https://registry.npmjs.org/@art-suite/art-core-arrays/-/art-core-arrays-0.1.2.tgz","fileCount":33,"integrity":"sha512-lKx0WBntk2c1zTBSRUcj7/jdRir1iwH54ElzekDXXCqaJblAY6UWkpuLsXALcyyPbpIpbG6p586V+rNgG/IzjA==","signatures":[{"sig":"MEQCIHMuNMeX59nYZtT0qXvCdFePgXX9pYdhnotjVb6jIHowAiBz6U6OAyjcJ+5NmpWZrnU3jcWZuhkrI//Nmd3/O8od4A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54091},"jest":{"verbose":true,"testEnvironment":"node","collectCoverageFrom":["build/**/*.js","!build/test/**/*.js"],"testPathIgnorePatterns":["/node_modules/","<rootDir>/test"],"coveragePathIgnorePatterns":["/index.js$","/namespace.js$"]},"main":"./build","watch":{"build":{"quiet":false,"patterns":["source"],"extensions":["caf","coffee"]}},"exports":{".":{"import":"./index.mjs","require":"./build/index.js"}},"gitHead":"a94165479e2a1bce1798e54eabcb679c47599240","scripts":{"nn":"nn build/* ","test":"jest","build":"rsync -av --exclude='*.caf' ./source/ ./build/\ncaf -m -c source -o build\nnpm run nn","clean":"rm -rf build/*","test-watch":"jest --watch","build-clean":"# BUILD CLEAN START\n#   - building into: build-temp\n#\nrm -rf ./__build-old__\nrsync -av --exclude='*.caf' ./source/ ./build-temp/\ncaf -m -c source -o build-temp\nnpm run nn\n\nnn build-temp/*\n\n# BUILD CLEAN FINIALIZING\n#  - replace old build in:   build\n#  - with new build from:    build-temp\n#\nmv build __build-old__\nmv build-temp build\nrm -rf ./__build-old__","build-watch":"nodemon -e js,ts,jsx,tsx,caf,coffee,json -w \"source/**\" -x npm run build"},"_npmUser":{"name":"shanebdavis","email":"shanebdavis@gmail.com"},"repository":{"url":"git+https://github.com/art-suite/art-suite-foundations.git","type":"git"},"_npmVersion":"10.9.0","description":"The Standard Library for JavaScript that aught to be.","directories":{},"_nodeVersion":"22.12.0","dependencies":{"caffeine-script-runtime":"^1.14.0","@art-suite/art-core-math":"^0.1.1","@art-suite/art-core-types":"^0.3.0","neptune-namespaces-runtime":"^3.2.14"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^7.2.0","art-testbench":"^3.2.17","art-build-configurator":"^1.30.4","@art-suite/standard-package-builder":"^1.2.7"},"_npmOperationalInternal":{"tmp":"tmp/art-core-arrays_0.1.2_1746786914054_0.8146165707709965","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@art-suite/art-core-arrays","version":"0.1.3","author":{"name":"Shane Brinkman-Davis Delamore"},"license":"ISC","_id":"@art-suite/art-core-arrays@0.1.3","maintainers":[{"name":"shanebdavis","email":"shanebdavis@gmail.com"}],"homepage":"https://github.com/art-suite/art-suite-foundations","bugs":{"url":"https://github.com/art-suite/art-suite-foundations/issues"},"dist":{"shasum":"c02c07afe21540016852e8a50e7c6fe54f501c39","tarball":"https://registry.npmjs.org/@art-suite/art-core-arrays/-/art-core-arrays-0.1.3.tgz","fileCount":33,"integrity":"sha512-P+wQZNx4sWrR0JTVL+LqrSKKEegtYKkvWZI42bpyzwHBAH3tHI0zlg7PqlezyGk4M4P5R3gfpz+o4k/0fUAbyg==","signatures":[{"sig":"MEUCIQC+J95084jyU4qbQcdAgAESVoL7kJmqdCxzOxexyn2P6gIgPGwitOyFSCZl4kXRb7Z8w662yX2Fmh23t+njNz2pNGc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54160},"jest":{"verbose":true,"testEnvironment":"node","collectCoverageFrom":["build/**/*.js","!build/test/**/*.js"],"testPathIgnorePatterns":["/node_modules/","<rootDir>/test"],"coveragePathIgnorePatterns":["/index.js$","/namespace.js$"]},"main":"./build","watch":{"build":{"quiet":false,"patterns":["source"],"extensions":["caf","coffee"]}},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./build/index.js"}},"gitHead":"a94165479e2a1bce1798e54eabcb679c47599240","scripts":{"nn":"nn build/* ","test":"jest","build":"rsync -av --exclude='*.caf' ./source/ ./build/\ncaf -m -c source -o build\nnpm run nn","clean":"rm -rf build/*","test-watch":"jest --watch","build-clean":"# BUILD CLEAN START\n#   - building into: build-temp\n#\nrm -rf ./__build-old__\nrsync -av --exclude='*.caf' ./source/ ./build-temp/\ncaf -m -c source -o build-temp\nnpm run nn\n\nnn build-temp/*\n\n# BUILD CLEAN FINIALIZING\n#  - replace old build in:   build\n#  - with new build from:    build-temp\n#\nmv build __build-old__\nmv build-temp build\nrm -rf ./__build-old__","build-watch":"nodemon -e js,ts,jsx,tsx,caf,coffee,json -w \"source/**\" -x npm run build"},"_npmUser":{"name":"shanebdavis","email":"shanebdavis@gmail.com"},"repository":{"url":"git+https://github.com/art-suite/art-suite-foundations.git","type":"git"},"_npmVersion":"10.9.0","description":"The Standard Library for JavaScript that aught to be.","directories":{},"_nodeVersion":"22.12.0","dependencies":{"caffeine-script-runtime":"^1.14.0","@art-suite/art-core-math":"^0.1.3","@art-suite/art-core-types":"^0.3.2","neptune-namespaces-runtime":"^3.2.14"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^7.2.0","art-testbench":"^3.2.17","art-build-configurator":"^1.30.4","@art-suite/standard-package-builder":"^1.2.7"},"_npmOperationalInternal":{"tmp":"tmp/art-core-arrays_0.1.3_1746787421922_0.7333277318270408","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"author":{"name":"Shane Brinkman-Davis Delamore"},"bugs":{"url":"https://github.com/art-suite/art-suite-foundations/issues"},"dependencies":{"@art-suite/art-core-math":"^0.1.4","@art-suite/art-core-types":"^0.3.3","caffeine-script-runtime":"^1.14.0","neptune-namespaces-runtime":"^3.2.15"},"description":"The Standard Library for JavaScript that aught to be.","devDependencies":{"@art-suite/standard-package-builder":"^1.2.8","art-build-configurator":"^1.30.5","art-testbench":"^3.2.18","mocha":"^7.2.0"},"exports":{".":{"import":"./index.mjs","require":"./build/index.js"}},"homepage":"https://github.com/art-suite/art-suite-foundations","jest":{"collectCoverageFrom":["build/**/*.js","!build/test/**/*.js"],"coveragePathIgnorePatterns":["/index.js$","/namespace.js$"],"testEnvironment":"node","testPathIgnorePatterns":["/node_modules/","<rootDir>/test"],"verbose":true},"license":"ISC","main":"./build","name":"@art-suite/art-core-arrays","repository":{"type":"git","url":"git+https://github.com/art-suite/art-suite-foundations.git"},"scripts":{"build":"rsync -av --exclude='*.caf' --exclude='*.coffee' ./source/ ./build/\ncoffee -m --output build --compile source &\nCOFFEE_PID=$!\ncaf -m -c source -o build --require coffee-script/register&\nCAF_PID=$!\nwait $COFFEE_PID || exit 1\nwait $CAF_PID || exit 1\nnpm run nn","build-clean":"# BUILD CLEAN START\n#   - building into: build-temp\n#\nrm -rf ./__build-old__\nrsync -av --exclude='*.caf' --exclude='*.coffee' ./source/ ./build-temp/\ncoffee -m --output build-temp --compile source &\nCOFFEE_PID=$!\ncaf -m -c source -o build-temp --require coffee-script/register&\nCAF_PID=$!\nwait $COFFEE_PID || exit 1\nwait $CAF_PID || exit 1\nnpm run nn\n\nnn build-temp/*\n\n# BUILD CLEAN FINIALIZING\n#  - replace old build in:   build\n#  - with new build from:    build-temp\n#\nmv build __build-old__\nmv build-temp build\nrm -rf ./__build-old__","build-watch":"nodemon -e js,ts,jsx,tsx,caf,coffee,json -w \"source/**\" -x npm run build","clean":"rm -rf build/*","nn":"nn build/* ","test":"jest","test-watch":"jest --watch"},"version":"0.1.4","watch":{"build":{"extensions":["caf","coffee"],"patterns":["source"],"quiet":false}},"gitHead":"3140bf828cabdf379d7c25fc877c26c1608c2409","_id":"@art-suite/art-core-arrays@0.1.4","_nodeVersion":"24.10.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-8YCDHJhJCX2vQXfWKGt/HBZ/l6ylFoOiOdIjt7hVhClKNbZW8/aBmZDhR+KpWFqv9oGdBeD57b/eocu4syGTPQ==","shasum":"c36809c1e48ec2792d8fffe44497316806e37274","tarball":"https://registry.npmjs.org/@art-suite/art-core-arrays/-/art-core-arrays-0.1.4.tgz","fileCount":33,"unpackedSize":54494,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCJLTYGbmOsLSIoCxei/4Rt5YsgZT8cq0kbfXxZDkLARAIhAKkTUALcjhgBLwDulVoEz17atNQGfT4Tr9XyoV8pgdYD"}]},"_npmUser":{"name":"shanebdavis","email":"shanebdavis@gmail.com"},"directories":{},"maintainers":[{"name":"shanebdavis","email":"shanebdavis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/art-core-arrays_0.1.4_1762507676252_0.8524015133309544"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-08T16:43:48.571Z","modified":"2025-11-07T09:27:56.677Z","0.1.0":"2025-05-08T16:43:48.872Z","0.1.1":"2025-05-09T09:44:24.262Z","0.1.2":"2025-05-09T10:35:14.247Z","0.1.3":"2025-05-09T10:43:42.114Z","0.1.4":"2025-11-07T09:27:56.434Z"},"bugs":{"url":"https://github.com/art-suite/art-suite-foundations/issues"},"author":{"name":"Shane Brinkman-Davis Delamore"},"license":"ISC","homepage":"https://github.com/art-suite/art-suite-foundations","repository":{"type":"git","url":"git+https://github.com/art-suite/art-suite-foundations.git"},"description":"The Standard Library for JavaScript that aught to be.","maintainers":[{"name":"shanebdavis","email":"shanebdavis@gmail.com"}],"readme":"# @art-suite/art-core-arrays\n\nA high-performance utility library for working with arrays in a pure-functional way.\n\n## Features\n\n- Powerful operations for working with sparse arrays and nested arrays\n- Pure functional approach - most operations return new arrays rather than modifying existing ones\n- Optimized for performance while maintaining clean semantics\n- TypeScript definitions for complete type safety\n\n## Installation\n\n```bash\nnpm install @art-suite/art-core-arrays\n```\n\n## API Overview\n\n### Types\n\nThe library provides several useful TypeScript types:\n\n- `SparseArray<T>` - Arrays that may contain null/undefined values\n- `NestedArray<T>` - Arrays that may contain other arrays recursively\n- `SparseNestedArray<T>` - Recursive arrays that may contain null/undefined values\n\n### Array Transformation\n\n#### Filtering and Flattening\n\n```typescript\n// Remove null/undefined or items that don't pass the tester\ncompact<T>(inputArray: SparseArray<T>, keepTester?: (value: T) => boolean): T[]\n\n// Flatten nested arrays into a single-level array\nflatten<T>(...args: NestedArray<T>[]): T[]\n\n// Flatten nested arrays and remove null/undefined values\ncompactFlatten<T>(inputArray: SparseNestedArrayOrSingleton<T>): T[]\n\n// Flatten multiple arrays and remove null/undefined values\ncompactFlattenAll<T>(...args: SparseNestedArray<T>[]): T[]\n\n// Custom filtering while flattening\ncustomCompactFlatten<T>(inputArray: SparseNestedArray<T>, customKeepTester: (value: T) => boolean): T[]\n```\n\n#### Non-Mutating Operations (Pure Functional)\n\nThese functions create new arrays without modifying the original:\n\n```typescript\n// Add an element to the end of an array\narrayWith<T>(inputArray: T[] | null | undefined, value: T): T[]\n\n// Get part of an array before an index\narrayWithLeftOfIndex<T>(inputArray: T[] | null | undefined, index: number): T[]\n\n// Get part of an array after an index\narrayWithRightOfIndex<T>(inputArray: T[] | null | undefined, index: number): T[]\n\n// Get part of an array before a value\narrayWithLeftOf<T>(inputArray: T[], value: T): T[]\n\n// Get part of an array after a value\narrayWithRightOf<T>(inputArray: T[], value: T): T[]\n\n// Create a shuffled copy of an array\narrayWithRandomSort<T>(inputArray: T[] | null | undefined): T[]\n\n// Insert an item at a specific index\narrayWithInsertedAt<T>(inputArray: T[], index: number, item: T): T[]\n\n// Create a sorted copy\narrayWithSort<T>(inputArray?: T[], sortFunction?: (a: T, b: T) => number): T[]\n\n// Remove element(s) at an index\narrayWithout<T>(inputArray: T[] | null | undefined, index?: number, amount?: number): T[]\n\n// Remove a specific value\narrayWithoutValue<T>(inputArray: T[] | null | undefined, value: T): T[]\n\n// Remove the last element(s)\narrayWithoutLast<T>(inputArray: T[] | null | undefined, amount?: number): T[]\n\n// Add a value if it doesn't already exist\narrayWithExactlyOne<T>(inputArray: T[] | null | undefined, value: T): T[]\n\n// Move an element by index\narrayWithElementMoved<T>(inputArray: T[], fromIndex: number, toIndex: number): T[]\n\n// Move an element by value\narrayWithElementValueMoved<T>(inputArray: T[], value: T, toIndex: number): T[]\n\n// Replace an element at an index\narrayWithElementReplaced<T>(inputArray: T[], value: T, index: number): T[]\n\n// Truncate array and add a value\ntruncatedArrayWith<T>(inputArray: T[] | null | undefined, length: number, value: T): T[]\n\n// Create array with only unique values\narrayWithUniqueValues<T>(sortedArray: T[], eqF?: (a: T, b: T) => boolean): T[]\n```\n\n#### Mutating Operations\n\nThese functions modify the original array:\n\n```typescript\n// Remove and return the last element\npop<T>(inputArray: T[] | null | undefined): T | undefined\n\n// Add element to the end\npush<T>(inputArray: T[] | null | undefined, element: T): T[]\n\n// Insert an item at an index\ninsertIntoArray<T>(inputArray: T[], index: number, item: T): T[]\n\n// Move an element from one position to another\nmoveArrayElement<T>(inputArray: T[], fromIndex: number, toIndex: number): T[]\n\n// Remove elements at an index\nremove<T>(inputArray: T[], index: number, amount?: number): T[]\n\n// Remove the first matching value\nremoveFirstMatch<T>(inputArray: T[], toMatchValue: T): T[]\n\n// Randomly reorder array elements\nshuffleArray<T>(inputArray: T[]): T[]\n\n// Stable sort (maintains order of equal elements)\nstableSort<T>(inputArray: T[], compareFunction?: (a: T, b: T) => number): T[]\n```\n\n### Array Inspection\n\n```typescript\n// Get the last element (or at offset from end) without modifying\npeek<T>(inputArray: T[] | null | undefined, offset?: number): T | undefined\n\n// Find index of element or array length if not found\ngetIndexOfOrLength<T>(inputArray: T[], value: T): number\n\n// Find the smallest element according to compare function\nfindSortedFirst<T>(inputArray: T[] | null | undefined, compareFunction?: (a: T, b: T) => number): T | undefined\n```\n\n### Iteration\n\n```typescript\n// Recursively iterate over nested arrays\ndeepArrayEach<T>(inputArray: NestedArray<T>[], f: (value: T) => void): NestedArray<T>[]\n```\n\n### Utilities\n\n```typescript\n// Create a predicate function that returns true if not null/undefined\nkeepUnlessNullOrUndefined<T>(a: T): boolean\n\n// Create array from strings, splitting on whitespace\nw<T>(...args: SparseNestedArray<string | T>): (string | T)[]\n```\n\n## Examples\n\n```typescript\nimport {\n  compact,\n  compactFlatten,\n  arrayWith,\n  arrayWithout,\n  w,\n} from \"@art-suite/art-core-arrays\";\n\n// Remove null/undefined values\ncompact([1, null, 2, undefined, 3]); // [1, 2, 3]\n\n// Custom filtering\ncompact([1, 2, 3, 4, 5], (x) => x % 2 === 0); // [2, 4]\n\n// Flatten nested arrays and remove null/undefined\ncompactFlatten([1, [2, null], [[3, undefined], 4]]); // [1, 2, 3, 4]\n\n// Add element to array without mutation\nconst originalArray = [1, 2, 3];\nconst newArray = arrayWith(originalArray, 4); // [1, 2, 3, 4]\n// originalArray is still [1, 2, 3]\n\n// Remove element from array without mutation\narrayWithout([1, 2, 3, 4], 1); // [1, 3, 4]\n\n// String to array utility\nw(\"hello world\"); // [\"hello\", \"world\"]\nw(\"one\", \"two three\"); // [\"one\", \"two\", \"three\"]\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}