一个 NPM 包,帮助数十万程序员提高数十倍效率,难道不开源出来?(一)
首先贴下我们的官网
【预览页】
https://kennana.github.io/toolkit-use/
我们的推特
【toolkituse】
https://twitter.com/Toolkituse
我们的github
【toolkit-use】文章来源:https://www.toymoban.com/news/detail-593884.html
https://github.com/KenNaNa/toolkit-use文章来源地址https://www.toymoban.com/news/detail-593884.html
数据类型是否为基础类型
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.isPrimitive(v)
是否为引用类型或通过由new构造的类型
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.isObject(obj)
是否为 Promise 函数
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.isPromise(val)
转换为数字
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.toNumber(val)
The object to inspect
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.isPlainObject(obj)
转换为字符串
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.toString(val)
将类数组对象转换为数组
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.toArray(list, start)
将属性赋予目标对象
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.extend(to, _from)
将对象数组合并到对象中
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.toObject(arr)
驼峰式变短横线分隔
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.capitalize(str)
驼峰式变短横线分隔
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.hyphenate(str)
短横线分隔变驼峰式
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.camelize(str)
删除数组项
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.remove(arr, item)
函数只执行一次
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.once(fn)
检测数组
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.isArray(obj)
检测 map
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.isMap(val)
检测 set
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.isSet(val)
检测日期
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.isDate(val)
检测函数
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.isFunction(val)
检测字符串
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.isString(val)
检测 symbol
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.isSymbol(val)
判断是否为整数键值
import { ToolkitUseShared } from 'toolkit-use/dist/shared/index.esm'
ToolkitUseShared.isIntegerKey(val)
到了这里,关于rollup npm 工具包怎么做点有意思的事情的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!