Socket
Socket
Sign inDemoInstall

dotaccess

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dotaccess - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

19

lib/dotaccess.js
module.exports.set = set
module.exports.unset = unset
module.exports.get = get

@@ -9,3 +10,3 @@

function set(obj, key, value, overwrite) {
function lookup(obj, key) {
key = parts(key)

@@ -19,5 +20,19 @@ var lastKey = key.pop()

}
if (overwrite || !(lastKey in obj)) obj[lastKey] = value
return [obj, lastKey];
}
function set(obj, key, value, overwrite) {
var objectAndKey = lookup(obj, key)
, obj = objectAndKey[0]
, key = objectAndKey[1];
if (overwrite || !(key in obj)) obj[key] = value
}
function unset(obj, key) {
var objectAndKey = lookup(obj, key)
, obj = objectAndKey[0]
, key = objectAndKey[1];
return delete obj[key];
}
function get(obj, key, def) {

@@ -24,0 +39,0 @@ key = parts(key)

2

package.json
{
"name": "dotaccess",
"description": "A library to access objects using dot notation strings.",
"version": "1.0.4",
"version": "1.0.5",
"homepage": "https://github.com/daaku/nodejs-dotaccess",

@@ -6,0 +6,0 @@ "author": "Naitik Shah <n@daaku.org>",

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