GitShow/sindresorhus/dot-prop
sindresorhus

dot-prop

Get, set, or delete a property from a nested object using a dot path

by sindresorhus
Star on GitHubForknpm

JavaScript

868 stars122 forks25 contributorsQuiet · 9mo agoSince 2015MIT

Meet the team

See all 25 on GitHub →
sindresorhus
sindresorhus75 contributions
Richienb
Richienb14 contributions
stevemao
stevemao8 contributions
AuthorProxy
AuthorProxy2 contributions
bendrucker
bendrucker2 contributions
LinusU
LinusU2 contributions
SamVerschueren
SamVerschueren2 contributions
floatdrop
floatdrop2 contributions

Recent PRs & issues

Quiet · 4 discussions · Last activity 9mo ago
See all on GitHub →
deathlynocturnal
SetProperty does a replace.OpenIssue

Is there a way to make it so can merge, rather than replace?

deathlynocturnal · 6d ago
DrJume
`getProperty` with empty path does not return root objectOpenIssue

When accessing a object using with an empty array, it currently returns the fallback value. This came to me as a surprise, isn't an empty string a zero nested path to the root object? https://github.com/sindresorhus/dot-prop/blob/8e81843270e42051ea8fda6035de1d638856fad5/index.js#L274-L277 Changing this would probably be a breaking change, but I think it would be more consistent.

DrJume · 6mo ago

Recent fixes

View closed PRs →
Richienb
Add viewsMergedPR

concept art Fixes #103

Richienb · 7mo ago
lumpkingod95-netizen
Rename project from 'dot-prop' to 'dotprop'MergedPR
lumpkingod95-netizen · 8mo ago
gmaclennan
Add array filter syntax supportMergedPR

I understand that this is an edge-case and I can imagine that you would not want to add support for this, however I am sharing since we needed this code for our use-case. We can use this from our fork, but if this is helpful for others then you're free to use it here. This adds support for a new syntax for accessing specific array properties for arrays of objects, by filtering on a specific item property e.g. to access the first array item where . only JSON primitive types (string, number, boolean, null) setProperty only updates existing items, doesn't create new ones

gmaclennan · 9mo ago
Structured data for AI agents

Repository: sindresorhus/dot-prop. Description: Get, set, or delete a property from a nested object using a dot path Stars: 868, Forks: 122. Primary language: JavaScript. License: MIT. Open PRs: 0, open issues: 4. Last activity: 9mo ago. Top contributors: sindresorhus, Richienb, stevemao, AuthorProxy, bendrucker, LinusU, SamVerschueren, floatdrop, kphrx, stroncium and others.

·@ofershap

Replace github.com with gitshow.dev