1 Star 1 Fork 1

RHQYZ / skit-extensions.js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

@skit/extensions

NPM Version NPM Download Build Status License

一个多功能的 JavaScript 内置对象原型链扩展方法工具库。


特性

  • 对部分内置对象扩展了若干常用原型链方法(所有 API 均被设计为以 $ 开头、且不可枚举,无需担心与 ECMAScript 标准的向前兼容问题);

  • 各模块相互独立,可单独拷贝到项目中使用;

  • 支持 TypeScript。


用法

安装:

npm install @skit/extensions

导入:

/* 使用 `require` 导入 */
require('@skit/extensions');

/* 使用 `import` 导入 */
import '@skit/extensions';

API:

请参考 /types/*.d.ts 下的声明文件。

  • Array:

    • Array.$shuffle
    • Array.prototype.$distinct
    • Array.prototype.$distinctBy
    • Array.prototype.$fill
    • Array.prototype.$findLast
    • Array.prototype.$findLastIndex
    • Array.prototype.$groupBy
    • Array.prototype.$groupByToMap
    • Array.prototype.$insertAt
    • Array.prototype.$max
    • Array.prototype.$maxBy
    • Array.prototype.$min
    • Array.prototype.$minBy
    • Array.prototype.$removeAt
    • Array.prototype.$shuffle
    • Array.prototype.$sortAsc
    • Array.prototype.$sortAscBy
    • Array.prototype.$sortDesc
    • Array.prototype.$sortDescBy
  • Boolean:

    • Boolean.$from
  • Date:

    • Date.$now
    • Date.$today
    • Date.$unix
    • Date.prototype.$addMilliseconds
    • Date.prototype.$addSeconds
    • Date.prototype.$addMinutes
    • Date.prototype.$addHours
    • Date.prototype.$addDays
    • Date.prototype.$addMonths
    • Date.prototype.$addYears
    • Date.prototype.$format
    • Date.prototype.$isToday
    • Date.prototype.$isWeekend
    • Date.prototype.$midnight
    • Date.prototype.$unix
  • Function:

    • Function.$noop
    • Function.$debounce
    • Function.$throttle
  • Number:

    • Number.$isNumeric
    • Number.$isOdd
    • Number.$isEven
    • Number.prototype.$toFloor
    • Number.prototype.$toCeil
    • Number.prototype.$toRound
  • Object:

    • Object.$deepEquals
    • Object.$merge
  • Promise:

    • Promise.$delay
    • Promise.$sequential
    • Promise.$try
    • Promise.$waitUntil
    • Promise.$waitWhile
  • String:

    • String.$equals
    • String.prototype.$reverse
    • String.prototype.$toCamelCase
    • String.prototype.$toKebabCase
    • String.prototype.$toPascalCase
    • String.prototype.$toSnakeCase

更新记录

请参阅 CHANGELOG

MIT License Copyright (c) 2019 RHQYZ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

一个多功能的 JavaScript 内置对象原型链扩展方法工具库。A powerful JavaScript utility library for built-in object extensions. 展开 收起
TypeScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/fudiwei/skit-extensions.js.git
git@gitee.com:fudiwei/skit-extensions.js.git
fudiwei
skit-extensions.js
skit-extensions.js
main

搜索帮助