Skip to main content
Home

Built and signed on GitHub Actions

A small collection of extra methods for arrays that we mostly needed from LoDash and Underscore that we didn't want to carry the weight of those installs.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
5 months ago (1.2.0)

Array Helper

A small collection of extra methods for arrays that we mostly needed from LoDash and Underscore that we didn't want to carry the weight of those installs.

Methods

orderBy

Take in an array of keys and orders and re-order the entire array based on that input.

import { orderBy } from "@withonevision/array-helpers";
const array = [{ key1: "Hello" }, { key1: "Goodbye" }];
orderBy(array, ["key1"], ["asc"]);
// [{key1: "Goodbye"}, {key1: "Hello"}]

uniqBy

Return the unique values in an array based off of a key.

const array = [{ key1: "Hello" }, { key1: "Goodbye" }, { key1: "Hello" }];
uniqBy(array, "key1");
// [{key1: "Hello"}, {key1: "Goodbye"}]

For a full list of functions, see the jsr.io documentation

Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@withonevision/array-helper

Import symbol

import * as array_helper from "@withonevision/array-helper";
or

Import directly with a jsr specifier

import * as array_helper from "jsr:@withonevision/array-helper";

Add Package

pnpm i jsr:@withonevision/array-helper
or (using pnpm 10.8 or older)
pnpm dlx jsr add @withonevision/array-helper

Import symbol

import * as array_helper from "@withonevision/array-helper";

Add Package

yarn add jsr:@withonevision/array-helper
or (using Yarn 4.8 or older)
yarn dlx jsr add @withonevision/array-helper

Import symbol

import * as array_helper from "@withonevision/array-helper";

Add Package

npx jsr add @withonevision/array-helper

Import symbol

import * as array_helper from "@withonevision/array-helper";

Add Package

bunx jsr add @withonevision/array-helper

Import symbol

import * as array_helper from "@withonevision/array-helper";