【文件属性】:
文件名称:walkobj:小小的javascript模块,以递归方式遍历对象
文件大小:7KB
文件格式:ZIP
更新时间:2021-05-03 13:10:39
JavaScript
Walkobj
一个非常简单的小模块,它递归地遍历对象并在每个对象上调用一个函数。
var walkobj = require ( 'walkobj' ) ;
var obj = { /**whatever you want*/ } ;
walkobj ( obj , function ( val , type , path , parent , cache , cacheId , root ) {
if ( cacheId !== false ) {
//this is a circular reference that has been encountered at least once before
var circularlyReferencedObject = cache [ cacheId ] [ 1 ]
var c
【文件预览】:
walkobj-master
----.gitignore(12B)
----package.json(866B)
----src()
--------index.js(48B)
--------has.js(103B)
--------toType.js(122B)
--------constants.js(368B)
--------walk.js(2KB)
----webpack.config.js(549B)
----index.js(6KB)
----README.md(1KB)
----test()
--------index.js(1KB)