Socket
Socket
Sign inDemoInstall

@emqx/shared-ui-utils

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emqx/shared-ui-utils - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

dist/format.d.ts

1

dist/index.d.ts
export * from './objectUtils';
export * from './jsonUtils';
export * from './format';

58

dist/index.js

@@ -1,18 +0,18 @@

const l = (r, e = [], t = {}) => {
const i = (r, t = [], e = {}) => {
if (typeof r == "object" && !Array.isArray(r) && r !== null)
for (const n of Object.keys(r))
l(r[n], e.concat(n), t);
i(r[n], t.concat(n), e);
else
t[e.join(".")] = r;
return t;
}, i = (r) => {
e[t.join(".")] = r;
return e;
}, f = (r) => {
if (Object(r) !== r && !Array.isArray(r))
return r;
const e = /\.?([^.[\]]+)|\[(\d+)\]/g, t = {};
const t = /\.?([^.[\]]+)|\[(\d+)\]/g, e = {};
try {
for (const n in r) {
let c = t, s = "", o;
for (; o = e.exec(n); )
c = c[s] || (c[s] = o[2] ? [] : {}), s = o[2] || o[1];
c[s] = r[n];
let o = e, s = "", c;
for (; c = t.exec(n); )
o = o[s] || (o[s] = c[2] ? [] : {}), s = c[2] || c[1];
o[s] = r[n];
}

@@ -22,4 +22,4 @@ } catch (n) {

}
return t[""] || t;
}, y = (r) => Object.keys(r).length === 0, a = (r) => {
return e[""] || e;
}, l = (r) => Object.keys(r).length === 0, y = (r) => {
try {

@@ -30,25 +30,33 @@ return JSON.parse(r);

}
}, f = (r, e) => {
}, u = (r, t) => {
try {
return typeof r == "string" ? r : JSON.stringify(r, null, e);
} catch (t) {
return console.error(t), "stringify error";
return typeof r == "string" ? r : JSON.stringify(r, null, t);
} catch (e) {
return console.error(e), "stringify error";
}
}, u = (r) => {
}, a = (r) => {
if (typeof r != "string")
return !1;
try {
const e = JSON.parse(r);
return typeof e == "object" && e !== null;
const t = JSON.parse(r);
return typeof t == "object" && t !== null;
} catch {
return !1;
}
}, p = (r) => {
if (typeof r != "number" || isNaN(r) || r < 0)
throw new Error("Invalid input: input should be a non-negative number");
if (r === 0)
return "0 Bytes";
const t = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], e = Math.floor(Math.log(r) / Math.log(1024));
return `${(r / 1024 ** e).toFixed(1)} ${t[e]}`;
};
export {
l as flattenObject,
y as isEmptyObj,
u as isJSONString,
a as parseJSONSafely,
f as stringifyObjSafely,
i as unflattenObject
i as flattenObject,
p as formatSizeUnit,
l as isEmptyObj,
a as isJSONString,
y as parseJSONSafely,
u as stringifyObjSafely,
f as unflattenObject
};
{
"name": "@emqx/shared-ui-utils",
"version": "0.0.8",
"version": "0.0.9",
"homepage": "https://emqx.io",

@@ -5,0 +5,0 @@ "license": "Apache-2.0",

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