oberknecht-utils
Advanced tools
Comparing version 1.2.9 to 1.3.0
@@ -7,19 +7,21 @@ "use strict"; | ||
switch (typeof inp) { | ||
case "boolean": return (inp === true); | ||
case "number": return parseInt(`${inp}`); | ||
case "object": | ||
{ | ||
if (Array.isArray(inp)) | ||
return [...inp]; | ||
if (regex_1.regex.jsonreg().test(JSON.stringify(inp))) | ||
return { ...inp }; | ||
return Object.assign({}, inp); | ||
} | ||
; | ||
case "string": return `${inp}`; | ||
case "undefined": return undefined; | ||
case "boolean": | ||
return inp === true; | ||
case "number": | ||
return parseInt(`${inp}`); | ||
case "object": { | ||
if (Array.isArray(inp)) | ||
return [...inp]; | ||
if (inp instanceof HTMLElement) | ||
return inp.cloneNode(true); | ||
if (regex_1.regex.jsonreg().test(JSON.stringify(inp))) | ||
return { ...inp }; | ||
return Object.assign({}, inp); | ||
} | ||
case "string": | ||
return `${inp}`; | ||
case "undefined": | ||
return undefined; | ||
} | ||
; | ||
} | ||
exports.recreate = recreate; | ||
; |
import { regex } from "../variables/regex"; | ||
export function recreate(inp: any): any { | ||
switch (typeof inp) { | ||
case "boolean": return (inp === true); | ||
case "number": return parseInt(`${inp}`); | ||
case "object": { | ||
if (Array.isArray(inp)) return [...inp]; | ||
if (regex.jsonreg().test(JSON.stringify(inp))) return { ...inp }; | ||
return Object.assign({}, inp); | ||
}; | ||
case "string": return `${inp}`; | ||
case "undefined": return undefined; | ||
}; | ||
}; | ||
switch (typeof inp) { | ||
case "boolean": | ||
return inp === true; | ||
case "number": | ||
return parseInt(`${inp}`); | ||
case "object": { | ||
if (Array.isArray(inp)) return [...inp]; | ||
if (inp instanceof HTMLElement) return inp.cloneNode(true); | ||
if (regex.jsonreg().test(JSON.stringify(inp))) return { ...inp }; | ||
return Object.assign({}, inp); | ||
} | ||
case "string": | ||
return `${inp}`; | ||
case "undefined": | ||
return undefined; | ||
} | ||
} |
{ | ||
"name": "oberknecht-utils", | ||
"version": "1.2.9", | ||
"version": "1.3.0", | ||
"description": "Utils for oberknecht packages", | ||
@@ -5,0 +5,0 @@ "main": "./lib-ts/utils/index", |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
0
96956
136
1980