Skip to content

zxmajunhong/dotString2ObjKey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

dotString2ObjKey

形如 x.xx.xxx的字符串转换成对象的key值

方法调用

const dotToObjKey = require('dotString2ObjKey');
  • 例一
console.log(dotToObjKey('a', '例一')); // { a: '例一'}
  • 例二
console.log(dotToObjKey('a.b', '例二')); // { a: { b: '例二' } }
  • 例三
console.log(dotToObject('a.b.c', '例三')); // { a: { b: { c: '例三' } } }

About

形如 x.xx.xxx的字符串转换成对象的key值

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published