一个 NPM 包,帮助数十万程序员提高数十倍效率,难道不开源出来?(一)
首先贴下我们的官网
https://kennana.github.io/toolkit-use/
我们的推特
https://twitter.com/Toolkituse
我们的github
https://github.com/KenNaNa/toolkit-use
数据类型是否为基础类型
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)
Top comments (1)
super duper great post 👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌👌