Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hey-utils

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hey-utils - npm Package Compare versions

Comparing version 0.0.12 to 0.0.13

2

package.json
{
"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 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc