node-red-contrib-agilite
Advanced tools
Comparing version 5.4.1 to 5.4.2
@@ -10,31 +10,6 @@ module.exports = function (RED) { | ||
this.fieldType = config.fieldType || "msg"; | ||
//require type-detect module | ||
const typeDetect = require('type-detect'); | ||
returnTypeOf = (input) => { | ||
let stringConstructor = "test".constructor; | ||
let arrayConstructor = [].constructor; | ||
let objectConstructor = {}.constructor; | ||
let booleanConstructor = true.constructor; | ||
let integerConstructor = (123).constructor; | ||
let result = null; | ||
if (input === undefined) { | ||
result = "undefined"; | ||
} else if (input === null) { | ||
result = null; | ||
} else if (input.constructor === stringConstructor) { | ||
result = "String"; | ||
} else if (input.constructor === arrayConstructor) { | ||
result = "Array"; | ||
} else if (input.constructor === objectConstructor) { | ||
result = "Object"; | ||
} else if (input.constructor === booleanConstructor) { | ||
result = "Boolean"; | ||
} else if (input.constructor === integerConstructor) { | ||
result = "Number"; | ||
} | ||
return result; | ||
}; | ||
this.on('input', function (msg) { | ||
@@ -57,3 +32,3 @@ var serverConfig = RED.nodes.getNode(config.server); | ||
//Check if there's valid data to pass | ||
if (returnTypeOf(msg.payload) !== "Object") | ||
if (typeDetect(msg.payload) !== "Object") | ||
msg.payload = {}; | ||
@@ -60,0 +35,0 @@ |
@@ -11,30 +11,4 @@ module.exports = function (RED) { | ||
returnTypeOf = (input) => { | ||
let stringConstructor = "test".constructor; | ||
let arrayConstructor = [].constructor; | ||
let objectConstructor = {}.constructor; | ||
let booleanConstructor = true.constructor; | ||
let integerConstructor = (123).constructor; | ||
const typeDetect = require("type-detect"); | ||
let result = null; | ||
if (input === undefined) { | ||
result = "undefined"; | ||
} else if (input === null) { | ||
result = null; | ||
} else if (input.constructor === stringConstructor) { | ||
result = "String"; | ||
} else if (input.constructor === arrayConstructor) { | ||
result = "Array"; | ||
} else if (input.constructor === objectConstructor) { | ||
result = "Object"; | ||
} else if (input.constructor === booleanConstructor) { | ||
result = "Boolean"; | ||
} else if (input.constructor === integerConstructor) { | ||
result = "Number"; | ||
} | ||
return result; | ||
}; | ||
this.on('input', function (msg) { | ||
@@ -53,3 +27,3 @@ var serverConfig = RED.nodes.getNode(config.server); | ||
//Check if there's valid data to pass | ||
if (returnTypeOf(msg.payload) !== "Object") | ||
if (typeDetect(msg.payload) !== "Object") | ||
msg.payload = {}; | ||
@@ -56,0 +30,0 @@ |
@@ -11,30 +11,4 @@ module.exports = function (RED) { | ||
returnTypeOf = (input) => { | ||
let stringConstructor = "test".constructor; | ||
let arrayConstructor = [].constructor; | ||
let objectConstructor = {}.constructor; | ||
let booleanConstructor = true.constructor; | ||
let integerConstructor = (123).constructor; | ||
let result = null; | ||
if (input === undefined) { | ||
result = "undefined"; | ||
} else if (input === null) { | ||
result = null; | ||
} else if (input.constructor === stringConstructor) { | ||
result = "String"; | ||
} else if (input.constructor === arrayConstructor) { | ||
result = "Array"; | ||
} else if (input.constructor === objectConstructor) { | ||
result = "Object"; | ||
} else if (input.constructor === booleanConstructor) { | ||
result = "Boolean"; | ||
} else if (input.constructor === integerConstructor) { | ||
result = "Number"; | ||
} | ||
return result; | ||
}; | ||
const typeDetect = require("type-detect"); | ||
this.on('input', function (msg) { | ||
@@ -52,3 +26,3 @@ var serverConfig = RED.nodes.getNode(config.server); | ||
//Check if there's valid data to pass | ||
if (returnTypeOf(msg.payload) !== "Object") | ||
if (typeDetect(msg.payload) !== "Object") | ||
msg.payload = {}; | ||
@@ -55,0 +29,0 @@ |
@@ -11,30 +11,4 @@ module.exports = function (RED) { | ||
returnTypeOf = (input) => { | ||
let stringConstructor = "test".constructor; | ||
let arrayConstructor = [].constructor; | ||
let objectConstructor = {}.constructor; | ||
let booleanConstructor = true.constructor; | ||
let integerConstructor = (123).constructor; | ||
const typeDetect = require("type-detect"); | ||
let result = null; | ||
if (input === undefined) { | ||
result = "undefined"; | ||
} else if (input === null) { | ||
result = null; | ||
} else if (input.constructor === stringConstructor) { | ||
result = "String"; | ||
} else if (input.constructor === arrayConstructor) { | ||
result = "Array"; | ||
} else if (input.constructor === objectConstructor) { | ||
result = "Object"; | ||
} else if (input.constructor === booleanConstructor) { | ||
result = "Boolean"; | ||
} else if (input.constructor === integerConstructor) { | ||
result = "Number"; | ||
} | ||
return result; | ||
}; | ||
this.on('input', function (msg) { | ||
@@ -54,3 +28,3 @@ var serverConfig = RED.nodes.getNode(config.server); | ||
//Check if there's valid data to pass | ||
if (returnTypeOf(msg.payload) !== "Object") | ||
if (typeDetect(msg.payload) !== "Object") | ||
msg.payload = {}; | ||
@@ -57,0 +31,0 @@ |
@@ -11,30 +11,4 @@ module.exports = function (RED) { | ||
returnTypeOf = (input) => { | ||
let stringConstructor = "test".constructor; | ||
let arrayConstructor = [].constructor; | ||
let objectConstructor = {}.constructor; | ||
let booleanConstructor = true.constructor; | ||
let integerConstructor = (123).constructor; | ||
const typeDetect = require("type-detect"); | ||
let result = null; | ||
if (input === undefined) { | ||
result = "undefined"; | ||
} else if (input === null) { | ||
result = null; | ||
} else if (input.constructor === stringConstructor) { | ||
result = "String"; | ||
} else if (input.constructor === arrayConstructor) { | ||
result = "Array"; | ||
} else if (input.constructor === objectConstructor) { | ||
result = "Object"; | ||
} else if (input.constructor === booleanConstructor) { | ||
result = "Boolean"; | ||
} else if (input.constructor === integerConstructor) { | ||
result = "Number"; | ||
} | ||
return result; | ||
}; | ||
this.on('input', function (msg) { | ||
@@ -58,3 +32,3 @@ var serverConfig = RED.nodes.getNode(config.server); | ||
//Check if there's valid data to pass | ||
if (returnTypeOf(msg.payload) !== "Object") | ||
if (typeDetect(msg.payload) !== "Object") | ||
msg.payload = {}; | ||
@@ -61,0 +35,0 @@ |
@@ -11,30 +11,4 @@ module.exports = function (RED) { | ||
returnTypeOf = (input) => { | ||
let stringConstructor = "test".constructor; | ||
let arrayConstructor = [].constructor; | ||
let objectConstructor = {}.constructor; | ||
let booleanConstructor = true.constructor; | ||
let integerConstructor = (123).constructor; | ||
const typeDetect = require("type-detect"); | ||
let result = null; | ||
if (input === undefined) { | ||
result = "undefined"; | ||
} else if (input === null) { | ||
result = null; | ||
} else if (input.constructor === stringConstructor) { | ||
result = "String"; | ||
} else if (input.constructor === arrayConstructor) { | ||
result = "Array"; | ||
} else if (input.constructor === objectConstructor) { | ||
result = "Object"; | ||
} else if (input.constructor === booleanConstructor) { | ||
result = "Boolean"; | ||
} else if (input.constructor === integerConstructor) { | ||
result = "Number"; | ||
} | ||
return result; | ||
}; | ||
this.on('input', function (msg) { | ||
@@ -51,3 +25,3 @@ var serverConfig = RED.nodes.getNode(config.server); | ||
//Check if there's valid data to pass | ||
if (returnTypeOf(msg.payload) !== "Object") | ||
if (typeDetect(msg.payload) !== "Object") | ||
msg.payload = {}; | ||
@@ -54,0 +28,0 @@ |
@@ -11,30 +11,4 @@ module.exports = function (RED) { | ||
returnTypeOf = (input) => { | ||
let stringConstructor = "test".constructor; | ||
let arrayConstructor = [].constructor; | ||
let objectConstructor = {}.constructor; | ||
let booleanConstructor = true.constructor; | ||
let integerConstructor = (123).constructor; | ||
const typeDetect = require("type-detect"); | ||
let result = null; | ||
if (input === undefined) { | ||
result = "undefined"; | ||
} else if (input === null) { | ||
result = null; | ||
} else if (input.constructor === stringConstructor) { | ||
result = "String"; | ||
} else if (input.constructor === arrayConstructor) { | ||
result = "Array"; | ||
} else if (input.constructor === objectConstructor) { | ||
result = "Object"; | ||
} else if (input.constructor === booleanConstructor) { | ||
result = "Boolean"; | ||
} else if (input.constructor === integerConstructor) { | ||
result = "Number"; | ||
} | ||
return result; | ||
}; | ||
this.on('input', function (msg) { | ||
@@ -52,3 +26,3 @@ var serverConfig = RED.nodes.getNode(config.server); | ||
//Check if there's valid data to pass | ||
if (returnTypeOf(msg.payload) !== "Object") | ||
if (typeDetect(msg.payload) !== "Object") | ||
msg.payload = {}; | ||
@@ -55,0 +29,0 @@ |
{ | ||
"name": "node-red-contrib-agilite", | ||
"license": "MIT", | ||
"version": "5.4.1", | ||
"version": "5.4.2", | ||
"description": "Node-RED nodes to integrate with Agilit-e cloud or Agilit-e on-prem", | ||
@@ -6,0 +6,0 @@ "homepage": "https://portal.agilite.io", |
@@ -11,30 +11,4 @@ module.exports = function (RED) { | ||
returnTypeOf = (input) => { | ||
let stringConstructor = "test".constructor; | ||
let arrayConstructor = [].constructor; | ||
let objectConstructor = {}.constructor; | ||
let booleanConstructor = true.constructor; | ||
let integerConstructor = (123).constructor; | ||
const typeDetect = require("type-detect"); | ||
let result = null; | ||
if (input === undefined) { | ||
result = "undefined"; | ||
} else if (input === null) { | ||
result = null; | ||
} else if (input.constructor === stringConstructor) { | ||
result = "String"; | ||
} else if (input.constructor === arrayConstructor) { | ||
result = "Array"; | ||
} else if (input.constructor === objectConstructor) { | ||
result = "Object"; | ||
} else if (input.constructor === booleanConstructor) { | ||
result = "Boolean"; | ||
} else if (input.constructor === integerConstructor) { | ||
result = "Number"; | ||
} | ||
return result; | ||
}; | ||
this.on('input', function (msg) { | ||
@@ -59,3 +33,3 @@ var serverConfig = RED.nodes.getNode(config.server); | ||
//Check if there's valid data to pass | ||
if (returnTypeOf(msg.payload) !== "Object") | ||
if (typeDetect(msg.payload) !== "Object") | ||
msg.payload = {}; | ||
@@ -62,0 +36,0 @@ |
@@ -11,30 +11,4 @@ module.exports = function (RED) { | ||
returnTypeOf = (input) => { | ||
let stringConstructor = "test".constructor; | ||
let arrayConstructor = [].constructor; | ||
let objectConstructor = {}.constructor; | ||
let booleanConstructor = true.constructor; | ||
let integerConstructor = (123).constructor; | ||
const typeDetect = require("type-detect"); | ||
let result = null; | ||
if (input === undefined) { | ||
result = "undefined"; | ||
} else if (input === null) { | ||
result = null; | ||
} else if (input.constructor === stringConstructor) { | ||
result = "String"; | ||
} else if (input.constructor === arrayConstructor) { | ||
result = "Array"; | ||
} else if (input.constructor === objectConstructor) { | ||
result = "Object"; | ||
} else if (input.constructor === booleanConstructor) { | ||
result = "Boolean"; | ||
} else if (input.constructor === integerConstructor) { | ||
result = "Number"; | ||
} | ||
return result; | ||
}; | ||
this.on('input', function (msg) { | ||
@@ -52,3 +26,3 @@ var serverConfig = RED.nodes.getNode(config.server); | ||
//Check if there's valid data to pass | ||
if (returnTypeOf(msg.payload) !== "Object") | ||
if (typeDetect(msg.payload) !== "Object") | ||
msg.payload = {}; | ||
@@ -55,0 +29,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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
140677
1916