Socket
Socket
Sign inDemoInstall

@zag-js/utils

Package Overview
Dependencies
Maintainers
1
Versions
779
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.61.1 to 0.62.0

3

dist/index.d.ts

@@ -48,2 +48,3 @@ declare function toArray<T>(v: T | T[] | undefined | null): T[];

declare function pick<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
declare function omit<T extends Record<string, any>>(obj: T, keys: string[]): Omit<T, string | number>;

@@ -59,2 +60,2 @@ type Dict = Record<string, any>;

export { type IndexOptions, type MaybeFunction, type Nullable, add, addOrRemove, callAll, cast, chunk, clear, compact, createSplitProps, first, fromLength, has, hasProp, invariant, isArray, isBoolean, isDev, isEmpty, isEqual, isFunction, isNull, isNumber, isObject, isString, json, last, match, next, nextIndex, noop, pick, prev, prevIndex, remove, removeAt, runIfFn, splitProps, toArray, tryCatch, uniq, uuid, warn };
export { type IndexOptions, type MaybeFunction, type Nullable, add, addOrRemove, callAll, cast, chunk, clear, compact, createSplitProps, first, fromLength, has, hasProp, invariant, isArray, isBoolean, isDev, isEmpty, isEqual, isFunction, isNull, isNumber, isObject, isString, json, last, match, next, nextIndex, noop, omit, pick, prev, prevIndex, remove, removeAt, runIfFn, splitProps, toArray, tryCatch, uniq, uuid, warn };

@@ -52,2 +52,3 @@ "use strict";

noop: () => noop,
omit: () => omit,
pick: () => pick,

@@ -205,2 +206,22 @@ prev: () => prev,

// src/split-props.ts
function splitProps(props, keys) {
const rest = {};
const result = {};
const keySet = new Set(keys);
for (const key in props) {
if (keySet.has(key)) {
result[key] = props[key];
} else {
rest[key] = props[key];
}
}
return [result, rest];
}
var createSplitProps = (keys) => {
return function split(props) {
return splitProps(props, keys);
};
};
// src/object.ts

@@ -237,22 +258,5 @@ function compact(obj) {

}
// src/split-props.ts
function splitProps(props, keys) {
const rest = {};
const result = {};
const keySet = new Set(keys);
for (const key in props) {
if (keySet.has(key)) {
result[key] = props[key];
} else {
rest[key] = props[key];
}
}
return [result, rest];
function omit(obj, keys) {
return createSplitProps(keys)(obj)[1];
}
var createSplitProps = (keys) => {
return function split(props) {
return splitProps(props, keys);
};
};

@@ -305,2 +309,3 @@ // src/warning.ts

noop,
omit,
pick,

@@ -307,0 +312,0 @@ prev,

{
"name": "@zag-js/utils",
"version": "0.61.1",
"version": "0.62.0",
"description": "",

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

@@ -0,1 +1,3 @@

import { createSplitProps } from "./split-props"
export function compact<T extends Record<string, unknown> | undefined>(obj: T): T {

@@ -37,1 +39,5 @@ if (!isPlainObject(obj) || obj === undefined) {

}
export function omit<T extends Record<string, any>>(obj: T, keys: string[]) {
return createSplitProps(keys)(obj)[1]
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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