rattail 2.0.5 → 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/README.md +9 -0
- package/README.zh-CN.md +9 -0
- package/dist/index.d.mts +7 -2
- package/dist/index.mjs +11 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -42,3 +42,12 @@ yarn add rattail
|
|
|
42
42
|
# pnpm
|
|
43
43
|
pnpm add rattail
|
|
44
44
|
```
|
|
45
|
+
|
|
46
|
+
### Official Docs
|
|
47
|
+
|
|
48
|
+
- [Documentation Home](https://rattail.varletjs.org)
|
|
49
|
+
- [Getting Started](https://rattail.varletjs.org/getting-started)
|
|
50
|
+
- [Why Rattail](https://rattail.varletjs.org/why-rattail)
|
|
51
|
+
- [Vite+ Presets / CLI Getting Started](https://rattail.varletjs.org/cli/getting-started)
|
|
52
|
+
- [Axle Getting Started](https://rattail.varletjs.org/axle/getting-started)
|
|
53
|
+
- [Ruler Factory](https://rattail.varletjs.org/ruler/ruler-factory)
|
package/README.zh-CN.md
CHANGED
|
@@ -42,3 +42,12 @@ yarn add rattail
|
|
|
42
42
|
# pnpm
|
|
43
43
|
pnpm add rattail
|
|
44
44
|
```
|
|
45
|
+
|
|
46
|
+
### 官方文档
|
|
47
|
+
|
|
48
|
+
- [文档首页](https://rattail.varletjs.org/zh)
|
|
49
|
+
- [快速开始](https://rattail.varletjs.org/zh/getting-started)
|
|
50
|
+
- [为什么选择 Rattail](https://rattail.varletjs.org/zh/why-rattail)
|
|
51
|
+
- [Vite+ 预设 / CLI 快速开始](https://rattail.varletjs.org/zh/cli/getting-started)
|
|
52
|
+
- [Axle 快速开始](https://rattail.varletjs.org/zh/axle/getting-started)
|
|
53
|
+
- [Ruler Factory](https://rattail.varletjs.org/zh/ruler/ruler-factory)
|
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rattail",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "A Vite+ oriented, AI Agent friendly front-end toolchain",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agent",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
|
-
"@configurajs/vite-plus": "0.2.
|
|
94
|
+
"@configurajs/vite-plus": "0.2.6",
|
|
95
95
|
"@varlet/axle": "1.0.2",
|
|
96
96
|
"@varlet/release": "^2.2.1",
|
|
97
97
|
"api-farmer": "0.1.5",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"oxc-minify": "^0.124.0",
|
|
111
111
|
"tsx": "^4.21.0",
|
|
112
112
|
"typescript": "5.3.3",
|
|
113
|
-
"vite-plus": "0.1.
|
|
113
|
+
"vite-plus": "0.1.19",
|
|
114
114
|
"vitepress": "2.0.0-alpha.17",
|
|
115
115
|
"vitest": "$vitest"
|
|
116
116
|
},
|