Comparing version 0.0.12 to 0.0.13
{ | ||
"name": "hey-utils", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "js-utils, js, util", | ||
@@ -5,0 +5,0 @@ "main": "build/utils.js", |
@@ -43,17 +43,17 @@ # hey-utils | ||
### valueForKeypath | ||
### getKeyValue | ||
获取深度path的对象值 | ||
```js | ||
utils.valueForKeypath({id:{v:'a'},b:2},"id.v"); | ||
utils.getKeyValue({id:{v:'a'},b:2},"id.v"); | ||
//'a' | ||
utils.valueForKeypath({id:{v:['a','b']},b:2},"id.v[1]"); | ||
utils.getKeyValue({id:{v:['a','b']},b:2},"id.v[1]"); | ||
//'b' | ||
``` | ||
### setValueForKeypath | ||
### setKeyValue | ||
对深度path的对象赋值 | ||
```js | ||
utils.setValueForKeypath({id:{v:1},b:2}, 'id.v', 2); | ||
utils.setKeyValue({id:{v:1},b:2}, 'id.v', 2); | ||
//{id:{v:2},b:2} | ||
utils.setValueForKeypath({id:{v:['a','b']},b:2}, "id.v[1]", 'c'); | ||
utils.setKeyValue({id:{v:['a','b']},b:2}, "id.v[1]", 'c'); | ||
//{id:{v:['a','c']},b:2} | ||
@@ -60,0 +60,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46041