mobiusbye
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

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] } }
// }

名称由来

再见莫比乌斯环。

Package Sidebar

Install

npm i mobiusbye

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

16.3 kB

Total Files

8

Last publish

Collaborators

  • nisal