Node-Red configuration
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

circular.js 451B

12345678910111213141516
  1. var inspect = require('../');
  2. var test = require('tape');
  3. test('circular', function (t) {
  4. t.plan(2);
  5. var obj = { a: 1, b: [3, 4] };
  6. obj.c = obj;
  7. t.equal(inspect(obj), '{ a: 1, b: [ 3, 4 ], c: [Circular] }');
  8. var double = {};
  9. double.a = [double];
  10. double.b = {};
  11. double.b.inner = double.b;
  12. double.b.obj = double;
  13. t.equal(inspect(double), '{ a: [ [Circular] ], b: { inner: [Circular], obj: [Circular] } }');
  14. });