@chakra-ui/shared-utils
Advanced tools
Comparing version 0.0.0-dev-20220819191103 to 0.0.0-dev-20220820120308
@@ -29,3 +29,2 @@ "use strict"; | ||
isObject: () => isObject, | ||
omit: () => omit, | ||
runIfFn: () => runIfFn, | ||
@@ -52,2 +51,5 @@ warn: () => warn | ||
} | ||
var isFunction = (value) => typeof value === "function"; | ||
var dataAttr = (condition) => condition ? "" : void 0; | ||
var ariaAttr = (condition) => condition ? true : void 0; | ||
function callAllHandlers(...fns) { | ||
@@ -61,14 +63,2 @@ return function func(event) { | ||
} | ||
var isFunction = (value) => typeof value === "function"; | ||
var dataAttr = (condition) => condition ? "" : void 0; | ||
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) { | ||
@@ -89,5 +79,4 @@ return function mergedFn(arg) { | ||
isObject, | ||
omit, | ||
runIfFn, | ||
warn | ||
}); |
@@ -9,11 +9,10 @@ declare const cx: (...classNames: any[]) => string; | ||
declare function runIfFn<T, U>(valueOrFn: T | ((...fnArgs: U[]) => T), ...args: U[]): T; | ||
declare type FunctionArguments<T extends Function> = T extends (...args: infer R) => any ? R : never; | ||
declare function callAllHandlers<T extends (event: any) => void>(...fns: (T | undefined)[]): (event: FunctionArguments<T>[0]) => void; | ||
declare type Booleanish = boolean | "true" | "false"; | ||
declare const dataAttr: (condition: boolean | undefined) => Booleanish; | ||
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 Args<T extends Function> = T extends (...args: infer R) => any ? R : never; | ||
declare type AnyFunction<T = any> = (...args: T[]) => any; | ||
declare function callAll<T extends AnyFunction>(...fns: (T | undefined)[]): (arg: FunctionArguments<T>[0]) => void; | ||
declare function callAllHandlers<T extends (event: any) => void>(...fns: (T | undefined)[]): (event: Args<T>[0]) => void; | ||
declare function callAll<T extends AnyFunction>(...fns: (T | undefined)[]): (arg: Args<T>[0]) => void; | ||
export { ariaAttr, callAll, callAllHandlers, cx, dataAttr, isObject, omit, runIfFn, warn }; | ||
export { ariaAttr, callAll, callAllHandlers, cx, dataAttr, isObject, runIfFn, warn }; |
@@ -19,2 +19,5 @@ // src/index.ts | ||
} | ||
var isFunction = (value) => typeof value === "function"; | ||
var dataAttr = (condition) => condition ? "" : void 0; | ||
var ariaAttr = (condition) => condition ? true : void 0; | ||
function callAllHandlers(...fns) { | ||
@@ -28,14 +31,2 @@ return function func(event) { | ||
} | ||
var isFunction = (value) => typeof value === "function"; | ||
var dataAttr = (condition) => condition ? "" : void 0; | ||
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) { | ||
@@ -55,5 +46,4 @@ return function mergedFn(arg) { | ||
isObject, | ||
omit, | ||
runIfFn, | ||
warn | ||
}; |
{ | ||
"name": "@chakra-ui/shared-utils", | ||
"version": "0.0.0-dev-20220819191103", | ||
"version": "0.0.0-dev-20220820120308", | ||
"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
7013
139