Socket
Socket
Sign inDemoInstall

clean-yaml-object

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    clean-yaml-object

Clean up an object prior to serialization


Version published
Weekly downloads
229K
decreased by-2.37%
Maintainers
1
Install size
6.46 kB
Created
Weekly downloads
 

Readme

Source

clean-yaml-object Build Status Coverage Status

Clean up an object prior to serialization.

Replaces circular references, pretty prints Buffers, and numerous other enhancements. Primarily designed to prepare Errors for serialization to JSON/YAML.

Extracted from node-tap

Install

$ npm install --save clean-yaml-object

Usage

const cleanYamlObject = require('clean-yaml-object');

cleanYamlObject(new Error('foo'));
//=> {name: 'Error', message: 'foo', stack: ...}

API

cleanYamlObject(input, [filterFn])

Returns a deep copy of input that is suitable for serialization.

input

Type: *

Any object.

filterFn

Type: callback(propertyName, isRoot, source, target)

Optional filter callback. Returning true will cause the property to be copied. Otherwise it will be skipped

  • propertyName: The property being copied.
  • isRoot: true only if source is the top level object passed to copyYamlObject
  • source: The source from which source[propertyName] will be copied.
  • target: The target object.

License

MIT © Isaac Z. Schlueter James Talmage

Keywords

FAQs

Last updated on 16 Jan 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc