Skip to content

hiNISAL/mobiusbye

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mobiusbye

对象循环引用检测,可以知道对象中哪两个属性发生了循环引用。

安装

npm i mobiusbye

使用

// ESM
import mobiusbye from 'mobiusbye';

// CommonJS
const mobiusbye = require('mobiusbye/release/commonjs/index').default;
const obj = {
  a: {
    b: {
      c: {
        d: {
          e: 1,
        },
      },
    },
  },
};

obj.a.b.c.d.e = obj as any;

mobiusbye(obj);

// 输出:
// {
//   path: [ [ 'a', 'b', 'c', 'd', 'e', 'a' ], [ 'a' ] ],
//   value: { b: { c: [Object] } }
// }

名称由来

再见莫比乌斯环。

About

找到对象中的循环引用

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published