Socket
Socket
Sign inDemoInstall

@jasonsbarr/dict

Package Overview
Dependencies
3
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @jasonsbarr/dict

Functions that treat plain JS objects like iterable, immutable dictionaries


Version published
Maintainers
1
Install size
203 kB
Created

Readme

Source

@jasonsbarr/dict

A collection of functions that treat Plain Old JavaScript Objects as iterable, keyed collections (a.k.a. Dictionaries).

Note that returned objects will have a null prototype. This is to give you the greatest flexibility with your allowable keys.

Basic Usage

Import and use only the functions you need:

import { filter } from "@jasonsbarr/dict/lib/filter";
import { endsWith } from "@jasonsbarr/functional-core/lib/string/endsWith";

const contacts = {
  john: "john.doe@gmail.com",
  jimmy: "jimmy@yahoo.com",
  jane: "jane-the-awesome@gmail.com",
  jeremy: "jeremy@msn.com",
};

const gmailContacts = filter(
  (contact) => endsWith("@gmail.com", contact),
  contacts
);

Documentation

Documentation

Keywords

FAQs

Last updated on 02 Aug 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc