1.1.0 • Published 7 years ago

@segment/convert-dates v1.1.0

Weekly downloads
1,311
License
SEE LICENSE IN LI...
Repository
github
Last release
7 years ago

convert-dates

CircleCI Codecov

Convert all Date instances in an object.

Installation

$ npm install @segment/convert-dates

Example

var convert = require('convert-dates');
var obj = { date: new Date() };

obj = convert(obj, function (date) { return 'string'; });

obj.date; // "string"

API

convertDates(object, converter)

Passes all of the Date values in an object through the converter function.