Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

oberknecht-utils

Package Overview
Dependencies
Maintainers
1
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oberknecht-utils - npm Package Compare versions

Comparing version 1.2.9 to 1.3.0

32

lib-js/utils/recreate.js

@@ -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",

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