2.0.0 • Published 7 hours ago

property-helpers v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 hours ago

Property Helpers

Simple helper functions for working with properties

GitHub npm

Support Server


Description

Property Helpers is a collection of helper functions for working with properties in objects and arrays.

Features

  • Written in TypeScript
  • Offers CommonJS, ESM, and UMD bundles
  • Fully tested
  • Extremely fast

Installation

# npm
npm install property-helpers
# yarn
yarn add property-helpers

Documentation

deleteProperty

A helper function to delete a property from an object or array at a path.

export function deleteProperty<T>(input: unknown, path: string[]): T;

getProperty

A helper function to get a property from an object or array at a path.

export function getProperty<T>(input: unknown, path: string[]): T | typeof PROPERTY_NOT_FOUND;

hasProperty

A helper function to check if an object or array has a property at a path.

export function hasProperty(input: unknown, path: string[]): boolean;

setProperty

A helper function to set a property on an object or array at a path.

export function setProperty<T>(input: unknown, path: string[], value: unknown): T;

2.0.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago