Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@types/object-path
Advanced tools
@types/object-path provides TypeScript type definitions for the object-path library, which allows for easy manipulation and access of deep properties within JavaScript objects.
Get a value at a given path
This feature allows you to retrieve the value at a specified path within an object. If the path does not exist, it returns undefined.
const objectPath = require('object-path');
const obj = { a: { b: { c: 42 } } };
const value = objectPath.get(obj, 'a.b.c');
console.log(value); // 42
Set a value at a given path
This feature allows you to set a value at a specified path within an object. If the path does not exist, it will be created.
const objectPath = require('object-path');
const obj = { a: { b: { } } };
objectPath.set(obj, 'a.b.c', 42);
console.log(obj); // { a: { b: { c: 42 } } }
Delete a value at a given path
This feature allows you to delete the value at a specified path within an object. If the path does not exist, the object remains unchanged.
const objectPath = require('object-path');
const obj = { a: { b: { c: 42 } } };
objectPath.del(obj, 'a.b.c');
console.log(obj); // { a: { b: { } } }
Check if a path exists
This feature allows you to check if a specified path exists within an object. It returns true if the path exists, otherwise false.
const objectPath = require('object-path');
const obj = { a: { b: { c: 42 } } };
const exists = objectPath.has(obj, 'a.b.c');
console.log(exists); // true
Lodash is a popular utility library that provides a wide range of functions for manipulating arrays, objects, and other data types. It includes similar functionalities for deep property access and manipulation, such as _.get, _.set, and _.has. Compared to object-path, Lodash offers a broader set of utilities beyond just object manipulation.
dot-prop is a small utility for accessing and manipulating object properties using dot notation. It provides similar functionalities to object-path, such as get, set, delete, and has methods. dot-prop is lightweight and focused specifically on property access and manipulation, making it a good alternative for those who need a minimalistic solution.
Deepdash is an extension for Lodash that adds deep traversal and manipulation capabilities. It provides similar functionalities to object-path, such as deep get, set, and delete operations. Deepdash is useful for those who are already using Lodash and need additional deep manipulation features.
npm install --save @types/object-path
This package contains type definitions for objectPath v0.9.x (https://github.com/mariocasciaro/object-path).
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/object-path
Additional Details
These definitions were written by Paulo Cesar https://github.com/pocesar/.
FAQs
TypeScript definitions for object-path
The npm package @types/object-path receives a total of 210,425 weekly downloads. As such, @types/object-path popularity was classified as popular.
We found that @types/object-path demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.