Package Exports
- transform-props
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (transform-props) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Transform Props
Transform @object properties using @propKeys and @transformers. ES5 compatible.
Installation
$ npm install transform-propsUsage
var transformProps = require('transform-props');
function castToString(arg) {
return String(arg);
}
var doc = new MongooseModel({ subDoc: { foo: 'bar' }});
var docObj = doc.toObject();
transformProps(docObj, castToString, '_id');
console.log(typeof docObj._id); // 'string'
console.log(typeof docObj.subDoc._id); // 'string'