Socket
Socket
Sign inDemoInstall

@zag-js/utils

Package Overview
Dependencies
Maintainers
1
Versions
778
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zag-js/utils - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

dist/chunk-Q55U6R3S.mjs

18

dist/index.js

@@ -148,7 +148,14 @@ "use strict";

function compact(obj) {
if (obj === void 0)
if (!isPlainObject(obj) || obj === void 0) {
return obj;
return Object.fromEntries(
Object.entries(obj).filter(([, value]) => value !== void 0).map(([key, value]) => [key, isObject(value) ? compact(value) : value])
);
}
const keys = Reflect.ownKeys(obj).filter((key) => typeof key === "string");
const filtered = {};
for (const key of keys) {
const value = obj[key];
if (value !== void 0) {
filtered[key] = compact(value);
}
}
return filtered;
}

@@ -158,2 +165,5 @@ function json(value) {

}
var isPlainObject = (value) => {
return value && typeof value === "object" && value.constructor === Object;
};

@@ -160,0 +170,0 @@ // src/warning.ts

@@ -27,14 +27,15 @@ "use strict";

module.exports = __toCommonJS(object_exports);
// src/guard.ts
var isArray = (v) => Array.isArray(v);
var isObject = (v) => !(v == null || typeof v !== "object" || isArray(v));
// src/object.ts
function compact(obj) {
if (obj === void 0)
if (!isPlainObject(obj) || obj === void 0) {
return obj;
return Object.fromEntries(
Object.entries(obj).filter(([, value]) => value !== void 0).map(([key, value]) => [key, isObject(value) ? compact(value) : value])
);
}
const keys = Reflect.ownKeys(obj).filter((key) => typeof key === "string");
const filtered = {};
for (const key of keys) {
const value = obj[key];
if (value !== void 0) {
filtered[key] = compact(value);
}
}
return filtered;
}

@@ -44,2 +45,5 @@ function json(value) {

}
var isPlainObject = (value) => {
return value && typeof value === "object" && value.constructor === Object;
};
// Annotate the CommonJS export names for ESM import in node:

@@ -46,0 +50,0 @@ 0 && (module.exports = {

{
"name": "@zag-js/utils",
"version": "0.3.3",
"version": "0.3.4",
"description": "",

@@ -5,0 +5,0 @@ "keywords": [

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