@vill-v/type-as
v2.0.1
Published
开发中常用的类型判断
Readme
@vill-v/type-as
neta了崩坏3 往世乐土的英杰维尔薇
开发中常用的类型判断
安装
# ✨ Auto-detect
npx nypm install @vill-v/type-as
# npm
npm install @vill-v/type-as
# yarn
yarn add @vill-v/type-as
# pnpm
pnpm install @vill-v/type-as
# bun
bun install @vill-v/type-as
# deno
deno install @vill-v/type-as说明
只是个人项目,整体较为随便,作为开发途中的经验总结,如有相似的需求,推荐copy或阅读源码,不建议将该包在实际项目中使用
如有幸被实际使用在项目内,不胜荣幸
const obj = {test: [{test1: 'test2'}]}
getByPath(obj, 'test[0].test1')
// -> test2
const obj1 = {test: [{test1: 'test2'}]}
setByPath(obj1, 'test[0].test1', 'test3')
// obj -> {test: [{test1: 'test3'}]}
const obj2 = {test: [{test1: 'test2'}]}
delByPath(obj2, 'test[0]')
// obj -> {test: []}
const obj3 = {test: [{test1: 'test2'}]}
hasByPath(obj3, 'test[0].test1')
// -> truePublished under the MIT license. Made by @Colourlessglow and community 💛
🤖 auto updated with automd
