@chakra-ui/shared-utils
Advanced tools
Comparing version 0.0.0-dev-20220819090547 to 0.0.0-dev-20220819092119
@@ -24,2 +24,3 @@ "use strict"; | ||
ariaAttr: () => ariaAttr, | ||
callAll: () => callAll, | ||
callAllHandlers: () => callAllHandlers, | ||
@@ -29,2 +30,3 @@ cx: () => cx, | ||
isObject: () => isObject, | ||
omit: () => omit, | ||
runIfFn: () => runIfFn, | ||
@@ -62,5 +64,22 @@ warn: () => warn | ||
var ariaAttr = (condition) => condition ? true : void 0; | ||
function omit(object, keys) { | ||
const result = {}; | ||
Object.keys(object).forEach((key) => { | ||
if (keys.includes(key)) | ||
return; | ||
result[key] = object[key]; | ||
}); | ||
return result; | ||
} | ||
function callAll(...fns) { | ||
return function mergedFn(arg) { | ||
fns.forEach((fn) => { | ||
fn == null ? void 0 : fn(arg); | ||
}); | ||
}; | ||
} | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
ariaAttr, | ||
callAll, | ||
callAllHandlers, | ||
@@ -70,4 +89,5 @@ cx, | ||
isObject, | ||
omit, | ||
runIfFn, | ||
warn | ||
}); |
@@ -14,3 +14,6 @@ declare const cx: (...classNames: any[]) => string; | ||
declare const ariaAttr: (condition: boolean | undefined) => true | undefined; | ||
declare function omit<T extends Record<string, any>, K extends keyof T>(object: T, keys: K[]): Omit<T, K>; | ||
declare type AnyFunction<T = any> = (...args: T[]) => any; | ||
declare function callAll<T extends AnyFunction>(...fns: (T | undefined)[]): (arg: FunctionArguments<T>[0]) => void; | ||
export { ariaAttr, callAllHandlers, cx, dataAttr, isObject, runIfFn, warn }; | ||
export { ariaAttr, callAll, callAllHandlers, cx, dataAttr, isObject, omit, runIfFn, warn }; |
@@ -30,4 +30,21 @@ // src/index.ts | ||
var ariaAttr = (condition) => condition ? true : void 0; | ||
function omit(object, keys) { | ||
const result = {}; | ||
Object.keys(object).forEach((key) => { | ||
if (keys.includes(key)) | ||
return; | ||
result[key] = object[key]; | ||
}); | ||
return result; | ||
} | ||
function callAll(...fns) { | ||
return function mergedFn(arg) { | ||
fns.forEach((fn) => { | ||
fn == null ? void 0 : fn(arg); | ||
}); | ||
}; | ||
} | ||
export { | ||
ariaAttr, | ||
callAll, | ||
callAllHandlers, | ||
@@ -37,4 +54,5 @@ cx, | ||
isObject, | ||
omit, | ||
runIfFn, | ||
warn | ||
}; |
{ | ||
"name": "@chakra-ui/shared-utils", | ||
"version": "0.0.0-dev-20220819090547", | ||
"version": "0.0.0-dev-20220819092119", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
7581
161