Git Product home page Git Product logo

set-in's Introduction

set-in

set value of nested associative structure given array of keys

inspired by clojure.core/assoc-in.

npm install --save set-in

example

var setIn = require('set-in')
var obj = { foo: { bar: 'baz' } }

obj = setIn(obj, ['foo', 'bar'], 'newValue')
// obj === { foo: { bar: 'newValue' } }

obj = setIn(obj, ['foo', 'newKey'], 'cool')
// obj === { foo: { bar: 'newValue', newKey: 'cool' } }

obj = { foo: ['bar', 'baz'] }

obj = setIn(obj, ['foo', '-'], 'newValue')
// obj === { foo: ['bar', 'baz', 'newValue'] }

usage

setIn = require('set-in')

obj = setIn(obj, path, value)

license

The Apache License

Copyright © 2016 Michael Williams

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

set-in's People

Contributors

ahdinosaur avatar erik-krogh avatar

Stargazers

Roman avatar Michael Heuberger avatar Efra Espada avatar Alexei Zaviruha avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

mipsum erik-krogh

set-in's Issues

同学,您这个项目引入了197个开源组件,存在10个漏洞,辛苦升级一下

检测到 ahdinosaur/set-in 一共引入了197个开源组件,存在10个漏洞

漏洞标题:lodash 安全漏洞
缺陷组件:[email protected]
漏洞编号:CVE-2019-10744
漏洞描述:lodash是一款开源的JavaScript实用程序库。
lodash 4.17.12之前版本中存在安全漏洞。攻击者可借助defaultsDeep参数利用该漏洞添加或修改Object.prototype的对象。
国家漏洞库信息:https://www.cnvd.org.cn/flaw/show/CNVD-2019-25451
影响范围:(∞, 4.17.12)
最小修复版本:4.17.12
缺陷组件引入路径:[email protected]>[email protected]>[email protected]>[email protected]>[email protected]
[email protected]>[email protected]>[email protected]>[email protected]>[email protected]>[email protected]

另外还有10个漏洞,详细报告:https://mofeisec.com/jr?p=aec607

get-in?

Great library, very useful. Would be good to have a similar get-in fn ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.