🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@zeeko/power-accessor

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zeeko/power-accessor

## Installation

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

power-accessor

Installation

npm i @zeeko/power-accessor

Usage

import { Accessor, Matcher } from '@zeeko/power-accessor';

const obj = {
  a: {
    bob: { c: 1 },
    alice: { c: 2 },
    cindy: { c: 3 },
    bill: { c: 4 },
  },
};

const accessor = new Accessor(
  'a',
  Matcher.when((key) => key.startsWith('b')),
  'c',
);
const values = accessor.get(obj);
console.log(values); // [1, 4]
accessor.set(obj, 5);
const updatedValues = accessor.get(obj);
console.log(updatedValues); // [5, 5]

Building

Run nx build power-accessor to build the library.

FAQs

Package last updated on 10 Mar 2023

Did you know?

Socket

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