@nextui-org/shared-utils
Advanced tools
Comparing version 0.0.0-dev-v2-20230624215649 to 0.0.0-dev-v2-20230625035223
@@ -16,3 +16,11 @@ type Args<T extends Function> = T extends (...args: infer R) => any ? R : never; | ||
declare function getUniqueID(prefix: string): string; | ||
/** | ||
* This function removes all event handlers from an object. | ||
*/ | ||
declare function removeEvents(input: { | ||
[key: string]: any; | ||
}): { | ||
[key: string]: any; | ||
}; | ||
export { callAll, callAllHandlers, capitalize, extractProperty, getUniqueID }; | ||
export { callAll, callAllHandlers, capitalize, extractProperty, getUniqueID, removeEvents }; |
@@ -27,3 +27,4 @@ "use strict"; | ||
extractProperty: () => extractProperty, | ||
getUniqueID: () => getUniqueID | ||
getUniqueID: () => getUniqueID, | ||
removeEvents: () => removeEvents | ||
}); | ||
@@ -61,2 +62,10 @@ module.exports = __toCommonJS(functions_exports); | ||
} | ||
function removeEvents(input) { | ||
for (const key in input) { | ||
if (key.startsWith("on")) { | ||
delete input[key]; | ||
} | ||
} | ||
return input; | ||
} | ||
// Annotate the CommonJS export names for ESM import in node: | ||
@@ -68,3 +77,4 @@ 0 && (module.exports = { | ||
extractProperty, | ||
getUniqueID | ||
getUniqueID, | ||
removeEvents | ||
}); |
@@ -6,3 +6,3 @@ export { Dict, __DEV__, __TEST__, dataAttr, isArray, isEmpty, isEmptyArray, isEmptyObject, isFunction, isNumeric, isObject } from './assertion.js'; | ||
export { getMargin } from './dimensions.js'; | ||
export { callAll, callAllHandlers, capitalize, extractProperty, getUniqueID } from './functions.js'; | ||
export { callAll, callAllHandlers, capitalize, extractProperty, getUniqueID, removeEvents } from './functions.js'; | ||
export { range } from './numbers.js'; | ||
@@ -9,0 +9,0 @@ export { warn } from './console.js'; |
@@ -49,2 +49,3 @@ "use strict"; | ||
range: () => range, | ||
removeEvents: () => removeEvents, | ||
renameProp: () => renameProp, | ||
@@ -248,2 +249,10 @@ safeText: () => safeText, | ||
} | ||
function removeEvents(input) { | ||
for (const key in input) { | ||
if (key.startsWith("on")) { | ||
delete input[key]; | ||
} | ||
} | ||
return input; | ||
} | ||
@@ -299,2 +308,3 @@ // src/numbers.ts | ||
range, | ||
removeEvents, | ||
renameProp, | ||
@@ -301,0 +311,0 @@ safeText, |
{ | ||
"name": "@nextui-org/shared-utils", | ||
"version": "0.0.0-dev-v2-20230624215649", | ||
"version": "0.0.0-dev-v2-20230625035223", | ||
"description": "A set of NextUI utilities", | ||
@@ -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
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
38729
1336