1.3.3 • Published 8 months ago

@vill-v/path-prop v1.3.3

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@vill-v/path-prop

neta了崩坏3 往世乐土的英杰维尔薇

npm version npm downloads bundle size license

一个基于路径字符串对对象进行操作的工具

安装

# ✨ Auto-detect
npx nypm install @vill-v/path-prop

# npm
npm install @vill-v/path-prop

# yarn
yarn add @vill-v/path-prop

# pnpm
pnpm install @vill-v/path-prop

# bun
bun install @vill-v/path-prop

# deno
deno install @vill-v/path-prop

说明

只是个人项目,整体较为随便,作为开发途中的经验总结,如有相似的需求,推荐copy或阅读源码,不建议将该包在实际项目中使用

如有幸被实际使用在项目内,不胜荣幸

const obj = {test: [{test1: 'test2'}]}

getByPath(obj, 'test[0].test1')
// -> test2

const obj1 = {test: [{test1: 'test2'}]}

setByPath(obj1, 'test[0].test1', 'test3')
// obj -> {test: [{test1: 'test3'}]}

const obj2 = {test: [{test1: 'test2'}]}

delByPath(obj2, 'test[0]')

// obj -> {test: []}

const obj3 = {test: [{test1: 'test2'}]}

hasByPath(obj3, 'test[0].test1')
// -> true

Published under the MIT license. Made by @Colourlessglow and community 💛


🤖 auto updated with automd

1.3.3

8 months ago

1.3.2

9 months ago

1.3.1

1 year ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.3.0

2 years ago

1.2.2

2 years ago

1.2.0

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.0.0

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.9

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.0

3 years ago

0.0.18

3 years ago

0.0.17

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago