Package Exports
- @skit/extensions
- @skit/extensions/dist/index.min.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@skit/extensions) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@skit/extensions
一个多功能的 JavaScript 内置对象原型链扩展方法工具库。
特性
对部分内置对象扩展了若干常用原型链方法(所有 API 均被设计为以
$开头、且不可枚举,无需担心与 ECMAScript 标准的向前兼容问题);各模块相互独立,可单独拷贝到项目中使用;
支持 TypeScript。
用法
安装:
npm install @skit/extensions导入:
/* 使用 `require` 导入 */
require('@skit/extensions');
/* 使用 `import` 导入 */
import '@skit/extensions';API:
请参考 /types/*.d.ts 下的声明文件。
Array:
Array.$shuffleArray.prototype.$distinctArray.prototype.$distinctByArray.prototype.$fillArray.prototype.$findLastArray.prototype.$findLastIndexArray.prototype.$groupByArray.prototype.$groupByToMapArray.prototype.$insertAtArray.prototype.$maxArray.prototype.$maxByArray.prototype.$minArray.prototype.$minByArray.prototype.$removeAtArray.prototype.$shuffleArray.prototype.$sortAscArray.prototype.$sortAscByArray.prototype.$sortDescArray.prototype.$sortDescBy
Boolean:
Boolean.$from
Date:
Date.$nowDate.$todayDate.$unixDate.prototype.$addMillisecondsDate.prototype.$addSecondsDate.prototype.$addMinutesDate.prototype.$addHoursDate.prototype.$addDaysDate.prototype.$addMonthsDate.prototype.$addYearsDate.prototype.$formatDate.prototype.$isTodayDate.prototype.$isWeekendDate.prototype.$midnightDate.prototype.$unix
Function:
Function.$noopFunction.$debounceFunction.$throttle
Number:
Number.$isNumericNumber.$isOddNumber.$isEvenNumber.prototype.$toFloorNumber.prototype.$toCeilNumber.prototype.$toRound
Object:
Object.$deepEqualsObject.$merge
Promise:
Promise.$delayPromise.$sequentialPromise.$tryPromise.$waitUntilPromise.$waitWhile
String:
String.$equalsString.prototype.$reverseString.prototype.$toCamelCaseString.prototype.$toKebabCaseString.prototype.$toPascalCaseString.prototype.$toSnakeCase
更新记录
请参阅 CHANGELOG。