New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-red-viseo-helper

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-viseo-helper - npm Package Compare versions

Comparing version 0.1.19 to 0.1.20

.npmignore

0

CODE_OF_CONDUCT.md

@@ -0,0 +0,0 @@ # Contributor Covenant Code of Conduct

@@ -0,0 +0,0 @@ # Contributing to the Project

@@ -49,5 +49,18 @@ 'use strict';

const RXP_JSFIELD = /[a-zA-Z0-9\._]/
const getByStringFast = exports.getByStringFast = (obj, str, def) => {
if (!str) return def;
try {
let tmp = obj;
for (let field of str.split('.')){
if (tmp[field] === undefined) { return def; }
tmp = tmp[field]
}
return tmp;
} catch (err) { return def; }
}
const getByString = exports.getByString = (obj, str, def) => {
if (!str) return def;
if (RXP_JSFIELD.test(str)) { return getByStringFast(obj, str, def); }
let ctxt = { "data": obj , "value": undefined };

@@ -63,4 +76,27 @@ const context = new vm.createContext(ctxt);

const setByStringFast = exports.setByStringFast = (obj, str, value, error) => {
if (!str) return def;
try {
let fields = str.split('.');
let tmp = obj;
for (let i = 0 ; i < fields.length ; i++){
let field = fields[i];
if (i === (fields.length-1)){
tmp[field] = value;
return;
}
if (tmp[field] === undefined) {
return; // Should we create the object instead ?
}
tmp = tmp[field]
}
} catch (ex){
if (error) error(ex)
else console.log(ex)
}
}
const setByString = exports.setByString = (obj, str, value, error) => {
if (!str) return;
if (RXP_JSFIELD.test(str)) { return setByStringFast(obj, str, value, error); }
let ctxt = { "data": obj, "value" : value };

@@ -67,0 +103,0 @@ const context = new vm.createContext(ctxt);

@@ -0,0 +0,0 @@ const extend = require('extend');

2

package.json
{
"name" : "node-red-viseo-helper",
"version" : "0.1.19",
"version" : "0.1.20",
"description" : "Utility libarary for Node-RED",

@@ -5,0 +5,0 @@ "dependencies" : { },

@@ -0,0 +0,0 @@ # Node-RED

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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