rattail 2.0.6 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +7 -2
- package/dist/index.mjs +11 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -78,6 +78,11 @@ declare function omit<T extends object, K extends keyof T>(object: T, keys: K[])
|
|
|
78
78
|
//#region src/object/omitBy.d.ts
|
|
79
79
|
declare function omitBy<T extends object>(object: T, fn: (value: any, key: keyof T) => any): Partial<T>;
|
|
80
80
|
//#endregion
|
|
81
|
+
//#region src/object/rekey.d.ts
|
|
82
|
+
type RekeyMap<T extends object> = Partial<Record<keyof T, PropertyKey>>;
|
|
83
|
+
type RekeyResult<T extends object, M extends RekeyMap<T>> = Omit<T, keyof M> & { [K in keyof M as M[K] extends PropertyKey ? M[K] : never]: K extends keyof T ? T[K] : never };
|
|
84
|
+
declare function rekey<T extends object, M extends RekeyMap<T>>(object: T, mapping: M): RekeyResult<T, M>;
|
|
85
|
+
//#endregion
|
|
81
86
|
//#region src/object/mapObject.d.ts
|
|
82
87
|
declare function mapObject<K extends PropertyKey, V, NK extends PropertyKey = K, NV = V>(object: Record<K, V>, fn: (key: K, value: V) => [PropertyKey, NV] | undefined): Record<NK, NV>;
|
|
83
88
|
//#endregion
|
|
@@ -570,7 +575,7 @@ declare function floor(val: number, precision?: number): number;
|
|
|
570
575
|
//#region src/math/ceil.d.ts
|
|
571
576
|
declare function ceil(val: number, precision?: number): number;
|
|
572
577
|
declare namespace index_d_exports {
|
|
573
|
-
export { BEM, ClassName, Classes, CookieAttributes, CookieStorage, CreateCacheManagerOptions, DurationContext, EnumOf, EnumOfConfigValue, EnumOfExtractOptionShape, EnumOfExtractValues, EnumOfKeyForValue, EnumOfNormalizeToOption, EnumOfOptionForValue, EnumOfResolvedField, EnumOfResolvedOption, EnumOfResult, EnumOfResultMethods, EnumOfStringOrGetter, EnumOfValue, EnumOfValueObject, MaskStringOptions, Motion, MotionOptions, MotionState, NOOP, NavigationTarget, PromiseWithResolvers, Storage, assert, at, baseRound, buildNavigationUrl, call, callOrReturn, camelize, cancelAnimationFrame, ceil, chunk, clamp, clampArrayRange, classes, cloneDeep, cloneDeepWith, copyText, createCacheManager, createCookieStorage, createNamespaceFn, createStorage, debounce, delay, difference, differenceWith, doubleRaf, download, duration, ensurePrefix, ensureSuffix, enumOf, find, floor, genNumberKey, genStringKey, getAllParentScroller, getGlobalThis, getParentScroller, getRect, getScrollLeft, getScrollTop, getStyle, groupBy, hasDuplicates, hasDuplicatesBy, hasOwn, inBrowser, inMobile, inViewport, intersection, intersectionWith, isArray, isArrayBuffer, isBlob, isBoolean, isDOMException, isDataView, isDate, isEmpty, isEmptyPlainObject, isEqual, isEqualWith, isError, isFile, isFunction, isMap, isNonEmptyArray, isNullish, isNumber, isNumeric, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isTruthy, isTypedArray, isWeakMap, isWeakSet, isWindow, kebabCase, localStorage, lowerFirst, mapObject, maskString, maxBy, mean, meanBy, merge, mergeWith, minBy, mitt, motion, navigation, normalizeToArray, objectEntries, objectKeys, objectToString, omit, omitBy, once, pascalCase, pick, pickBy, prettyJSONObject, preventDefault, promiseWithResolvers, raf, randomColor, randomNumber, randomString, removeArrayBlank, removeArrayEmpty, removeItem, removeItemBy, removeItemsBy, requestAnimationFrame, round, sample, sessionStorage, set, shuffle, slash, sum, sumBy, sumHash, supportTouch, throttle, times, toArrayBuffer, toDataURL, toNumber, toRawType, toText, toTypeString, toggleItem, tryAsyncCall, tryCall, tryParseJSON, uniq, uniqBy, upperFirst, uuid, uuidV6, xor, xorWith };
|
|
578
|
+
export { BEM, ClassName, Classes, CookieAttributes, CookieStorage, CreateCacheManagerOptions, DurationContext, EnumOf, EnumOfConfigValue, EnumOfExtractOptionShape, EnumOfExtractValues, EnumOfKeyForValue, EnumOfNormalizeToOption, EnumOfOptionForValue, EnumOfResolvedField, EnumOfResolvedOption, EnumOfResult, EnumOfResultMethods, EnumOfStringOrGetter, EnumOfValue, EnumOfValueObject, MaskStringOptions, Motion, MotionOptions, MotionState, NOOP, NavigationTarget, PromiseWithResolvers, Storage, assert, at, baseRound, buildNavigationUrl, call, callOrReturn, camelize, cancelAnimationFrame, ceil, chunk, clamp, clampArrayRange, classes, cloneDeep, cloneDeepWith, copyText, createCacheManager, createCookieStorage, createNamespaceFn, createStorage, debounce, delay, difference, differenceWith, doubleRaf, download, duration, ensurePrefix, ensureSuffix, enumOf, find, floor, genNumberKey, genStringKey, getAllParentScroller, getGlobalThis, getParentScroller, getRect, getScrollLeft, getScrollTop, getStyle, groupBy, hasDuplicates, hasDuplicatesBy, hasOwn, inBrowser, inMobile, inViewport, intersection, intersectionWith, isArray, isArrayBuffer, isBlob, isBoolean, isDOMException, isDataView, isDate, isEmpty, isEmptyPlainObject, isEqual, isEqualWith, isError, isFile, isFunction, isMap, isNonEmptyArray, isNullish, isNumber, isNumeric, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isTruthy, isTypedArray, isWeakMap, isWeakSet, isWindow, kebabCase, localStorage, lowerFirst, mapObject, maskString, maxBy, mean, meanBy, merge, mergeWith, minBy, mitt, motion, navigation, normalizeToArray, objectEntries, objectKeys, objectToString, omit, omitBy, once, pascalCase, pick, pickBy, prettyJSONObject, preventDefault, promiseWithResolvers, raf, randomColor, randomNumber, randomString, rekey, removeArrayBlank, removeArrayEmpty, removeItem, removeItemBy, removeItemsBy, requestAnimationFrame, round, sample, sessionStorage, set, shuffle, slash, sum, sumBy, sumHash, supportTouch, throttle, times, toArrayBuffer, toDataURL, toNumber, toRawType, toText, toTypeString, toggleItem, tryAsyncCall, tryCall, tryParseJSON, uniq, uniqBy, upperFirst, uuid, uuidV6, xor, xorWith };
|
|
574
579
|
}
|
|
575
580
|
//#endregion
|
|
576
|
-
export { BEM, ClassName, Classes, CookieAttributes, CookieStorage, CreateCacheManagerOptions, DurationContext, EnumOf, EnumOfConfigValue, EnumOfExtractOptionShape, EnumOfExtractValues, EnumOfKeyForValue, EnumOfNormalizeToOption, EnumOfOptionForValue, EnumOfResolvedField, EnumOfResolvedOption, EnumOfResult, EnumOfResultMethods, EnumOfStringOrGetter, EnumOfValue, EnumOfValueObject, MaskStringOptions, Motion, MotionOptions, MotionState, NOOP, NavigationTarget, PromiseWithResolvers, Storage, assert, at, baseRound, buildNavigationUrl, call, callOrReturn, camelize, cancelAnimationFrame, ceil, chunk, clamp, clampArrayRange, classes, cloneDeep, cloneDeepWith, copyText, createCacheManager, createCookieStorage, createNamespaceFn, createStorage, debounce, delay, difference, differenceWith, doubleRaf, download, duration, ensurePrefix, ensureSuffix, enumOf, find, floor, genNumberKey, genStringKey, getAllParentScroller, getGlobalThis, getParentScroller, getRect, getScrollLeft, getScrollTop, getStyle, groupBy, hasDuplicates, hasDuplicatesBy, hasOwn, inBrowser, inMobile, inViewport, intersection, intersectionWith, isArray, isArrayBuffer, isBlob, isBoolean, isDOMException, isDataView, isDate, isEmpty, isEmptyPlainObject, isEqual, isEqualWith, isError, isFile, isFunction, isMap, isNonEmptyArray, isNullish, isNumber, isNumeric, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isTruthy, isTypedArray, isWeakMap, isWeakSet, isWindow, kebabCase, localStorage, lowerFirst, mapObject, maskString, maxBy, mean, meanBy, merge, mergeWith, minBy, mitt, motion, navigation, normalizeToArray, objectEntries, objectKeys, objectToString, omit, omitBy, once, pascalCase, pick, pickBy, prettyJSONObject, preventDefault, promiseWithResolvers, raf, randomColor, randomNumber, randomString, removeArrayBlank, removeArrayEmpty, removeItem, removeItemBy, removeItemsBy, requestAnimationFrame, round, sample, sessionStorage, set, shuffle, slash, sum, sumBy, sumHash, supportTouch, throttle, times, toArrayBuffer, toDataURL, toNumber, toRawType, toText, toTypeString, toggleItem, tryAsyncCall, tryCall, tryParseJSON, uniq, uniqBy, upperFirst, uuid, uuidV6, xor, xorWith };
|
|
581
|
+
export { BEM, ClassName, Classes, CookieAttributes, CookieStorage, CreateCacheManagerOptions, DurationContext, EnumOf, EnumOfConfigValue, EnumOfExtractOptionShape, EnumOfExtractValues, EnumOfKeyForValue, EnumOfNormalizeToOption, EnumOfOptionForValue, EnumOfResolvedField, EnumOfResolvedOption, EnumOfResult, EnumOfResultMethods, EnumOfStringOrGetter, EnumOfValue, EnumOfValueObject, MaskStringOptions, Motion, MotionOptions, MotionState, NOOP, NavigationTarget, PromiseWithResolvers, Storage, assert, at, baseRound, buildNavigationUrl, call, callOrReturn, camelize, cancelAnimationFrame, ceil, chunk, clamp, clampArrayRange, classes, cloneDeep, cloneDeepWith, copyText, createCacheManager, createCookieStorage, createNamespaceFn, createStorage, debounce, delay, difference, differenceWith, doubleRaf, download, duration, ensurePrefix, ensureSuffix, enumOf, find, floor, genNumberKey, genStringKey, getAllParentScroller, getGlobalThis, getParentScroller, getRect, getScrollLeft, getScrollTop, getStyle, groupBy, hasDuplicates, hasDuplicatesBy, hasOwn, inBrowser, inMobile, inViewport, intersection, intersectionWith, isArray, isArrayBuffer, isBlob, isBoolean, isDOMException, isDataView, isDate, isEmpty, isEmptyPlainObject, isEqual, isEqualWith, isError, isFile, isFunction, isMap, isNonEmptyArray, isNullish, isNumber, isNumeric, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isTruthy, isTypedArray, isWeakMap, isWeakSet, isWindow, kebabCase, localStorage, lowerFirst, mapObject, maskString, maxBy, mean, meanBy, merge, mergeWith, minBy, mitt, motion, navigation, normalizeToArray, objectEntries, objectKeys, objectToString, omit, omitBy, once, pascalCase, pick, pickBy, prettyJSONObject, preventDefault, promiseWithResolvers, raf, randomColor, randomNumber, randomString, rekey, removeArrayBlank, removeArrayEmpty, removeItem, removeItemBy, removeItemsBy, requestAnimationFrame, round, sample, sessionStorage, set, shuffle, slash, sum, sumBy, sumHash, supportTouch, throttle, times, toArrayBuffer, toDataURL, toNumber, toRawType, toText, toTypeString, toggleItem, tryAsyncCall, tryCall, tryParseJSON, uniq, uniqBy, upperFirst, uuid, uuidV6, xor, xorWith };
|
package/dist/index.mjs
CHANGED
|
@@ -498,6 +498,15 @@ function omitBy(object, fn) {
|
|
|
498
498
|
}, {});
|
|
499
499
|
}
|
|
500
500
|
//#endregion
|
|
501
|
+
//#region src/object/rekey.ts
|
|
502
|
+
function rekey(object, mapping) {
|
|
503
|
+
return [...Object.keys(object), ...Object.getOwnPropertySymbols(object)].reduce((result, key) => {
|
|
504
|
+
const nextKey = hasOwn(mapping, key) ? mapping[key] : key;
|
|
505
|
+
result[nextKey] = object[key];
|
|
506
|
+
return result;
|
|
507
|
+
}, {});
|
|
508
|
+
}
|
|
509
|
+
//#endregion
|
|
501
510
|
//#region src/object/mapObject.ts
|
|
502
511
|
function mapObject(object, fn) {
|
|
503
512
|
return Object.entries(object).reduce((result, [key, value]) => {
|
|
@@ -1521,6 +1530,7 @@ __reExport(/* @__PURE__ */ __exportAll({
|
|
|
1521
1530
|
randomColor: () => randomColor,
|
|
1522
1531
|
randomNumber: () => randomNumber,
|
|
1523
1532
|
randomString: () => randomString,
|
|
1533
|
+
rekey: () => rekey,
|
|
1524
1534
|
removeArrayBlank: () => removeArrayBlank,
|
|
1525
1535
|
removeArrayEmpty: () => removeArrayEmpty,
|
|
1526
1536
|
removeItem: () => removeItem,
|
|
@@ -1558,4 +1568,4 @@ __reExport(/* @__PURE__ */ __exportAll({
|
|
|
1558
1568
|
xorWith: () => xorWith
|
|
1559
1569
|
}), integrated_exports);
|
|
1560
1570
|
//#endregion
|
|
1561
|
-
export { NOOP, assert, at, baseRound, buildNavigationUrl, call, callOrReturn, camelize, cancelAnimationFrame, ceil, chunk, clamp, clampArrayRange, classes, cloneDeep, cloneDeepWith, copyText, createCacheManager, createCookieStorage, createNamespaceFn, createStorage, debounce, delay, difference, differenceWith, doubleRaf, download, duration, ensurePrefix, ensureSuffix, enumOf, find, floor, genNumberKey, genStringKey, getAllParentScroller, getGlobalThis, getParentScroller, getRect, getScrollLeft, getScrollTop, getStyle, groupBy, hasDuplicates, hasDuplicatesBy, hasOwn, inBrowser, inMobile, inViewport, intersection, intersectionWith, isArray, isArrayBuffer, isBlob, isBoolean, isDOMException, isDataView, isDate, isEmpty, isEmptyPlainObject, isEqual, isEqualWith, isError, isFile, isFunction, isMap, isNonEmptyArray, isNullish, isNumber, isNumeric, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isTruthy, isTypedArray, isWeakMap, isWeakSet, isWindow, kebabCase, localStorage, lowerFirst, mapObject, maskString, maxBy, mean, meanBy, merge, mergeWith, minBy, mitt, motion, navigation, normalizeToArray, objectEntries, objectKeys, objectToString, omit, omitBy, once, pascalCase, pick, pickBy, prettyJSONObject, preventDefault, promiseWithResolvers, raf, randomColor, randomNumber, randomString, removeArrayBlank, removeArrayEmpty, removeItem, removeItemBy, removeItemsBy, requestAnimationFrame, round, sample, sessionStorage, set, shuffle, slash, sum, sumBy, sumHash, supportTouch, throttle, times, toArrayBuffer, toDataURL, toNumber, toRawType, toText, toTypeString, toggleItem, tryAsyncCall, tryCall, tryParseJSON, uniq, uniqBy, upperFirst, uuid, uuidV6, xor, xorWith };
|
|
1571
|
+
export { NOOP, assert, at, baseRound, buildNavigationUrl, call, callOrReturn, camelize, cancelAnimationFrame, ceil, chunk, clamp, clampArrayRange, classes, cloneDeep, cloneDeepWith, copyText, createCacheManager, createCookieStorage, createNamespaceFn, createStorage, debounce, delay, difference, differenceWith, doubleRaf, download, duration, ensurePrefix, ensureSuffix, enumOf, find, floor, genNumberKey, genStringKey, getAllParentScroller, getGlobalThis, getParentScroller, getRect, getScrollLeft, getScrollTop, getStyle, groupBy, hasDuplicates, hasDuplicatesBy, hasOwn, inBrowser, inMobile, inViewport, intersection, intersectionWith, isArray, isArrayBuffer, isBlob, isBoolean, isDOMException, isDataView, isDate, isEmpty, isEmptyPlainObject, isEqual, isEqualWith, isError, isFile, isFunction, isMap, isNonEmptyArray, isNullish, isNumber, isNumeric, isObject, isPlainObject, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isTruthy, isTypedArray, isWeakMap, isWeakSet, isWindow, kebabCase, localStorage, lowerFirst, mapObject, maskString, maxBy, mean, meanBy, merge, mergeWith, minBy, mitt, motion, navigation, normalizeToArray, objectEntries, objectKeys, objectToString, omit, omitBy, once, pascalCase, pick, pickBy, prettyJSONObject, preventDefault, promiseWithResolvers, raf, randomColor, randomNumber, randomString, rekey, removeArrayBlank, removeArrayEmpty, removeItem, removeItemBy, removeItemsBy, requestAnimationFrame, round, sample, sessionStorage, set, shuffle, slash, sum, sumBy, sumHash, supportTouch, throttle, times, toArrayBuffer, toDataURL, toNumber, toRawType, toText, toTypeString, toggleItem, tryAsyncCall, tryCall, tryParseJSON, uniq, uniqBy, upperFirst, uuid, uuidV6, xor, xorWith };
|