@bearei/react-util
Advanced tools
Comparing version 0.0.28 to 0.0.29
@@ -9,2 +9,2 @@ export type DefaultEvent = { | ||
export declare const handleDefaultEvent: HandleDefaultEvent; | ||
export declare const bindEvents: <T extends string, C = (e: unknown) => void>(names: T[], match: (key: T) => C) => Record<T, C>; | ||
export declare const bindEvents: <T extends string, C = (e: unknown) => void>(names: T[], matchEvent: (key: T) => C) => Record<T, C>; |
@@ -26,6 +26,6 @@ /******/ (function() { // webpackBootstrap | ||
exports.handleDefaultEvent = handleDefaultEvent; | ||
var bindEvents = function bindEvents(names, match) { | ||
var bindEvents = function bindEvents(names, matchEvent) { | ||
var events = {}; | ||
var bindEvent = function bindEvent(key) { | ||
return _defineProperty({}, key, match(key)); | ||
return _defineProperty({}, key, matchEvent(key)); | ||
}; | ||
@@ -32,0 +32,0 @@ names.forEach(function (key) { |
@@ -49,6 +49,6 @@ /******/ (function() { // webpackBootstrap | ||
exports.handleDefaultEvent = handleDefaultEvent; | ||
var bindEvents = function bindEvents(names, match) { | ||
var bindEvents = function bindEvents(names, matchEvent) { | ||
var events = {}; | ||
var bindEvent = function bindEvent(key) { | ||
return _defineProperty({}, key, match(key)); | ||
return _defineProperty({}, key, matchEvent(key)); | ||
}; | ||
@@ -127,5 +127,5 @@ names.forEach(function (key) { | ||
})); | ||
var omit = function omit(target, fields) { | ||
var omit = function omit(target, keys) { | ||
var nextTarget = Object.assign({}, target); | ||
fields === null || fields === void 0 ? void 0 : fields.forEach(function (key) { | ||
keys === null || keys === void 0 ? void 0 : keys.forEach(function (key) { | ||
delete nextTarget[key]; | ||
@@ -159,3 +159,3 @@ }); | ||
var pickHTMLAttributes = function pickHTMLAttributes(props) { | ||
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { | ||
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { | ||
aria: true, | ||
@@ -178,5 +178,5 @@ data: true, | ||
value = _ref2[1]; | ||
var aria = config.aria && key === 'role' || matchPrefix(key, ariaPrefix); | ||
var data = config.data && matchPrefix(key, dataPrefix); | ||
var attr = config.attribute && allProps.includes(key); | ||
var aria = configs.aria && key === 'role' || matchPrefix(key, ariaPrefix); | ||
var data = configs.data && matchPrefix(key, dataPrefix); | ||
var attr = configs.attribute && allProps.includes(key); | ||
(aria || data || attr) && Object.assign(attrs, _defineProperty({}, key, value)); | ||
@@ -183,0 +183,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
declare const omit: <T extends Record<string, unknown>, K extends keyof T>(target: T, fields: K[]) => Omit<T, K>; | ||
declare const omit: <T extends Record<string, unknown>, K extends keyof T>(target: T, keys: K[]) => Omit<T, K>; | ||
export default omit; |
@@ -12,5 +12,5 @@ /******/ (function() { // webpackBootstrap | ||
})); | ||
var omit = function omit(target, fields) { | ||
var omit = function omit(target, keys) { | ||
var nextTarget = Object.assign({}, target); | ||
fields === null || fields === void 0 ? void 0 : fields.forEach(function (key) { | ||
keys === null || keys === void 0 ? void 0 : keys.forEach(function (key) { | ||
delete nextTarget[key]; | ||
@@ -17,0 +17,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
export interface PickHTMLAttributesConfig { | ||
export interface PickHTMLAttributesConfigs { | ||
aria?: boolean; | ||
@@ -6,3 +6,3 @@ data?: boolean; | ||
} | ||
export declare const pickHTMLAttributes: (props: Record<string, unknown>, config?: PickHTMLAttributesConfig) => Record<string, unknown>; | ||
export declare const pickHTMLAttributes: (props: Record<string, unknown>, configs?: PickHTMLAttributesConfigs) => Record<string, unknown>; | ||
export declare const pickNativeAttributes: (props: Record<string, unknown>) => Record<string, unknown>; |
@@ -24,3 +24,3 @@ /******/ (function() { // webpackBootstrap | ||
var pickHTMLAttributes = function pickHTMLAttributes(props) { | ||
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { | ||
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { | ||
aria: true, | ||
@@ -43,5 +43,5 @@ data: true, | ||
value = _ref2[1]; | ||
var aria = config.aria && key === 'role' || matchPrefix(key, ariaPrefix); | ||
var data = config.data && matchPrefix(key, dataPrefix); | ||
var attr = config.attribute && allProps.includes(key); | ||
var aria = configs.aria && key === 'role' || matchPrefix(key, ariaPrefix); | ||
var data = configs.data && matchPrefix(key, dataPrefix); | ||
var attr = configs.attribute && allProps.includes(key); | ||
(aria || data || attr) && Object.assign(attrs, _defineProperty({}, key, value)); | ||
@@ -48,0 +48,0 @@ }); |
@@ -9,2 +9,2 @@ export type DefaultEvent = { | ||
export declare const handleDefaultEvent: HandleDefaultEvent; | ||
export declare const bindEvents: <T extends string, C = (e: unknown) => void>(names: T[], match: (key: T) => C) => Record<T, C>; | ||
export declare const bindEvents: <T extends string, C = (e: unknown) => void>(names: T[], matchEvent: (key: T) => C) => Record<T, C>; |
@@ -40,6 +40,6 @@ /******/ // The require scope | ||
}; | ||
var bindEvents = function bindEvents(names, match) { | ||
var bindEvents = function bindEvents(names, matchEvent) { | ||
var events = {}; | ||
var bindEvent = function bindEvent(key) { | ||
return _defineProperty({}, key, match(key)); | ||
return _defineProperty({}, key, matchEvent(key)); | ||
}; | ||
@@ -46,0 +46,0 @@ names.forEach(function (key) { |
@@ -40,6 +40,6 @@ /******/ var __webpack_modules__ = ({ | ||
}; | ||
var bindEvents = function bindEvents(names, match) { | ||
var bindEvents = function bindEvents(names, matchEvent) { | ||
var events = {}; | ||
var bindEvent = function bindEvent(key) { | ||
return _defineProperty({}, key, match(key)); | ||
return _defineProperty({}, key, matchEvent(key)); | ||
}; | ||
@@ -57,5 +57,5 @@ names.forEach(function (key) { | ||
var omit = function omit(target, fields) { | ||
var omit = function omit(target, keys) { | ||
var nextTarget = Object.assign({}, target); | ||
fields === null || fields === void 0 ? void 0 : fields.forEach(function (key) { | ||
keys === null || keys === void 0 ? void 0 : keys.forEach(function (key) { | ||
delete nextTarget[key]; | ||
@@ -87,3 +87,3 @@ }); | ||
var pickHTMLAttributes = function pickHTMLAttributes(props) { | ||
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { | ||
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { | ||
aria: true, | ||
@@ -106,5 +106,5 @@ data: true, | ||
value = _ref2[1]; | ||
var aria = config.aria && key === 'role' || matchPrefix(key, ariaPrefix); | ||
var data = config.data && matchPrefix(key, dataPrefix); | ||
var attr = config.attribute && allProps.includes(key); | ||
var aria = configs.aria && key === 'role' || matchPrefix(key, ariaPrefix); | ||
var data = configs.data && matchPrefix(key, dataPrefix); | ||
var attr = configs.attribute && allProps.includes(key); | ||
(aria || data || attr) && Object.assign(attrs, _defineProperty({}, key, value)); | ||
@@ -111,0 +111,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
declare const omit: <T extends Record<string, unknown>, K extends keyof T>(target: T, fields: K[]) => Omit<T, K>; | ||
declare const omit: <T extends Record<string, unknown>, K extends keyof T>(target: T, keys: K[]) => Omit<T, K>; | ||
export default omit; |
var __webpack_exports__ = {}; | ||
var omit = function omit(target, fields) { | ||
var omit = function omit(target, keys) { | ||
var nextTarget = Object.assign({}, target); | ||
fields === null || fields === void 0 ? void 0 : fields.forEach(function (key) { | ||
keys === null || keys === void 0 ? void 0 : keys.forEach(function (key) { | ||
delete nextTarget[key]; | ||
@@ -6,0 +6,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
export interface PickHTMLAttributesConfig { | ||
export interface PickHTMLAttributesConfigs { | ||
aria?: boolean; | ||
@@ -6,3 +6,3 @@ data?: boolean; | ||
} | ||
export declare const pickHTMLAttributes: (props: Record<string, unknown>, config?: PickHTMLAttributesConfig) => Record<string, unknown>; | ||
export declare const pickHTMLAttributes: (props: Record<string, unknown>, configs?: PickHTMLAttributesConfigs) => Record<string, unknown>; | ||
export declare const pickNativeAttributes: (props: Record<string, unknown>) => Record<string, unknown>; |
@@ -39,3 +39,3 @@ /******/ // The require scope | ||
var pickHTMLAttributes = function pickHTMLAttributes(props) { | ||
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { | ||
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { | ||
aria: true, | ||
@@ -58,5 +58,5 @@ data: true, | ||
value = _ref2[1]; | ||
var aria = config.aria && key === 'role' || matchPrefix(key, ariaPrefix); | ||
var data = config.data && matchPrefix(key, dataPrefix); | ||
var attr = config.attribute && allProps.includes(key); | ||
var aria = configs.aria && key === 'role' || matchPrefix(key, ariaPrefix); | ||
var data = configs.data && matchPrefix(key, dataPrefix); | ||
var attr = configs.attribute && allProps.includes(key); | ||
(aria || data || attr) && Object.assign(attrs, _defineProperty({}, key, value)); | ||
@@ -63,0 +63,0 @@ }); |
{ | ||
"name": "@bearei/react-util", | ||
"version": "0.0.28", | ||
"version": "0.0.29", | ||
"main": "./lib/commonjs/index", | ||
@@ -5,0 +5,0 @@ "module": "./lib/module/index", |
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
106969