{"id":15062679,"url":"https://github.com/tapjs/clean-yaml-object","last_synced_at":"2025-04-10T14:21:54.290Z","repository":{"id":55551027,"uuid":"49757621","full_name":"tapjs/clean-yaml-object","owner":"tapjs","description":"Clean up an object prior to serialization","archived":false,"fork":false,"pushed_at":"2022-02-26T20:03:06.000Z","size":119,"stargazers_count":3,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-05T13:43:31.132Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/clean-yaml-object","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tapjs.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["isaacs"]}},"created_at":"2016-01-16T03:29:38.000Z","updated_at":"2022-02-26T19:05:20.000Z","dependencies_parsed_at":"2022-08-15T03:00:56.957Z","dependency_job_id":null,"html_url":"https://github.com/tapjs/clean-yaml-object","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tapjs%2Fclean-yaml-object","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tapjs%2Fclean-yaml-object/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tapjs%2Fclean-yaml-object/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tapjs%2Fclean-yaml-object/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tapjs","download_url":"https://codeload.github.com/tapjs/clean-yaml-object/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248145795,"owners_count":21055203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T23:44:37.101Z","updated_at":"2025-04-10T14:21:54.269Z","avatar_url":"https://github.com/tapjs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/isaacs"],"categories":[],"sub_categories":[],"readme":"# clean-yaml-object [![Build Status](https://travis-ci.org/tapjs/clean-yaml-object.svg?branch=master)](https://travis-ci.org/tapjs/clean-yaml-object) [![Coverage Status](https://coveralls.io/repos/tapjs/clean-yaml-object/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/tapjs/clean-yaml-object?branch=master)\n\n\u003e Clean up an object prior to serialization.\n\nReplaces circular references, pretty prints Buffers, and numerous other enhancements. Primarily designed to prepare Errors for serialization to JSON/YAML.\n\nExtracted from [`node-tap`](https://github.com/tapjs/node-tap)\n\n## Install\n\n```\n$ npm install --save clean-yaml-object\n```\n\n\n## Usage\n\n```js\nconst cleanYamlObject = require('clean-yaml-object');\n\ncleanYamlObject(new Error('foo'));\n//=\u003e {name: 'Error', message: 'foo', stack: ...}\n```\n\n\n## API\n\n### cleanYamlObject(input, [filterFn])\n\nReturns a deep copy of `input` that is suitable for serialization. \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 property 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 passed to `copyYamlObject`\n- `source`: The source from which `source[propertyName]` will be copied.\n- `target`: The target object.\n\n## License\n\n\nMIT © [Isaac Z. Schlueter](http://github.com/isaacs) [James Talmage](http://github.com/jamestalmage)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftapjs%2Fclean-yaml-object","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftapjs%2Fclean-yaml-object","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftapjs%2Fclean-yaml-object/lists"}