{"_id":"clean-yaml-object","_rev":"4665451","name":"clean-yaml-object","description":"Clean up an object prior to serialization","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"bcoe","email":"bencoe@gmail.com"},{"name":"isaacs","email":""},{"name":"jamestalmage","email":"james@talmage.io"}],"time":{"modified":"2026-04-10T22:38:14.000Z","created":"2016-01-16T03:51:55.398Z","1.0.0":"2025-11-02T01:27:54.093Z","0.1.0":"2016-01-16T06:20:58.159Z","0.0.1":"2016-01-16T03:51:55.398Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/tapjs/clean-yaml-object.git"},"versions":{"1.0.0":{"name":"clean-yaml-object","version":"1.0.0","description":"Clean up an object prior to serialization","repository":{"type":"git","url":"git+https://github.com/tapjs/clean-yaml-object.git"},"engines":{"node":">=18"},"scripts":{"preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","prepare":"tshy","pretest":"npm run prepare","presnap":"npm run prepare","test":"tap","snap":"tap","format":"prettier --write . --log-level warn","typedoc":"typedoc --tsconfig .tshy/esm.json"},"dependencies":{"@isaacs/buffer-to-string":"^1.0.1"},"devDependencies":{"prettier":"^3.6.2","tap":"^21.1.3","tshy":"^3.0.3","typedoc":"^0.28.14"},"type":"module","tshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts"}},"exports":{"./package.json":"./package.json",".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}}},"main":"./dist/commonjs/index.js","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","_id":"clean-yaml-object@1.0.0","gitHead":"3c9870bba4fdbaf480c8df1cd3d61a94faf2665e","bugs":{"url":"https://github.com/tapjs/clean-yaml-object/issues"},"homepage":"https://github.com/tapjs/clean-yaml-object#readme","_nodeVersion":"24.4.1","_npmVersion":"11.4.2","dist":{"shasum":"8b31fd1a4341e5cef33482c409a0cf1344421908","size":1883,"noattachment":false,"key":"/clean-yaml-object/-/clean-yaml-object-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/clean-yaml-object/download/clean-yaml-object-1.0.0.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"maintainers":[{"name":"bcoe","email":"bencoe@gmail.com"},{"name":"isaacs","email":""},{"name":"jamestalmage","email":"james@talmage.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/clean-yaml-object_1.0.0_1762046873924_0.06744671507865774"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-11-02T01:27:54.093Z","publish_time":1762046874093,"_source_registry_name":"default","_cnpm_publish_time":1762046874093},"0.1.0":{"name":"clean-yaml-object","version":"0.1.0","description":"Clean up an object prior to serialization","license":"MIT","repository":{"type":"git","url":"git+https://github.com/tapjs/clean-yaml-object.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && nyc --cache --reporter=lcov --reporter=text ava"},"files":["index.js"],"keywords":["serialize","clean","dedupe","circular","yaml","json","error"],"dependencies":{},"devDependencies":{"ava":"^0.10.0","coveralls":"^2.11.6","nyc":"^5.3.0","xo":"^0.12.1"},"gitHead":"37e3fd40076d7e6f92b9ca9a09a4cf600e6bac24","bugs":{"url":"https://github.com/tapjs/clean-yaml-object/issues"},"homepage":"https://github.com/tapjs/clean-yaml-object#readme","_id":"clean-yaml-object@0.1.0","_shasum":"63fb110dc2ce1a84dc21f6d9334876d010ae8b68","_from":".","_npmVersion":"3.5.3","_nodeVersion":"5.3.0","_npmUser":{"name":"jamestalmage","email":"james@talmage.io"},"dist":{"shasum":"63fb110dc2ce1a84dc21f6d9334876d010ae8b68","size":2721,"noattachment":false,"key":"/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/clean-yaml-object/download/clean-yaml-object-0.1.0.tgz"},"maintainers":[{"name":"bcoe","email":"bencoe@gmail.com"},{"name":"isaacs","email":""},{"name":"jamestalmage","email":"james@talmage.io"}],"directories":{},"publish_time":1452925258159,"_cnpm_publish_time":1452925258159,"_hasShrinkwrap":false},"0.0.1":{"name":"clean-yaml-object","version":"0.0.1","description":"My flawless module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jamestalmage/clean-yaml-object.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && nyc --cache --reporter=lcov --reporter=text ava"},"files":["index.js"],"keywords":[],"dependencies":{},"devDependencies":{"ava":"^0.10.0","nyc":"^5.3.0","xo":"^0.12.1"},"gitHead":"08bdab8163ec8c7b506c2e410e1fb1de7d6a7c86","bugs":{"url":"https://github.com/jamestalmage/clean-yaml-object/issues"},"homepage":"https://github.com/jamestalmage/clean-yaml-object#readme","_id":"clean-yaml-object@0.0.1","_shasum":"f48ed1af1b2fdba05584544c07c3cdc6c1ad3a38","_from":".","_npmVersion":"3.4.0","_nodeVersion":"0.10.40","_npmUser":{"name":"jamestalmage","email":"james@talmage.io"},"dist":{"shasum":"f48ed1af1b2fdba05584544c07c3cdc6c1ad3a38","size":2714,"noattachment":false,"key":"/clean-yaml-object/-/clean-yaml-object-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/clean-yaml-object/download/clean-yaml-object-0.0.1.tgz"},"maintainers":[{"name":"bcoe","email":"bencoe@gmail.com"},{"name":"isaacs","email":""},{"name":"jamestalmage","email":"james@talmage.io"}],"directories":{},"publish_time":1452916315398,"_cnpm_publish_time":1452916315398,"_hasShrinkwrap":false}},"readme":"# clean-yaml-object\n\n> Clean up an object prior to serialization.\n\nReplaces circular references, pretty prints Buffers, and numerous\nother enhancements. Primarily designed to prepare Errors for\nserialization to JSON/YAML.\n\nExtracted from [`node-tap`](https://github.com/tapjs/node-tap)\n\n## Usage\n\n```ts\nimport { cleanYamlObject } from 'clean-yaml-object'\n// or: const { cleanYamlObject } = require('clean-yaml-object')\n\ncleanYamlObject(new Error('foo'))\n//=> {name: 'Error', message: 'foo', stack: ...}\n```\n\n## API\n\n### cleanYamlObject(input, [filterFn])\n\nReturns a deep copy of `input` that is suitable for\nserialization.\n\n#### input\n\nType: `*`\n\nAny object.\n\n#### filterFn\n\nType: `callback(propertyName, isRoot, source, target)`\n\nOptional filter callback. Returning `true` will cause the\nproperty to be copied. Otherwise it will be skipped\n\n- `propertyName`: The property being copied.\n- `isRoot`: `true` only if `source` is the top level object\n  passed to `copyYamlObject`\n- `source`: The source from which `source[propertyName]` will be\n  copied.\n- `target`: The target object.\n","_attachments":{},"homepage":"https://github.com/tapjs/clean-yaml-object#readme","bugs":{"url":"https://github.com/tapjs/clean-yaml-object/issues"}}