Package Exports
- forward-object
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 (forward-object) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
forward-object

Copy properties from an object to another object, where properties with function values will be invoked in the context of the provider, and properties with non-function values are just copied.
Install with npm
$ npm i forward-object --save
Usage
var forwardObject = require('forward-object');
API
forward
Copy properties from an object to another object, where properties with function values will be invoked in the context of the provider, and properties with non-function values are just copied.
Params
receiver
{Object}: Object to receive properties.provider
{Object}: Object providing properties.keys
{Array}: Optional array of keys to foward.returns
{Object}: Modifiedreceiver
object with properties fromprovider
Example
var receiver = {};
var provider = {
name: 'provider',
upper: function (str) {
return '[' + this.name + '] ' + str.toUpperCase();
}
};
var receiver = forward(receiver, provider);
receiver.name = 'receiver';
console.log(receiver.upper('foo'));
//=> [provider] FOO
Related projects
Running tests
Install dev dependencies:
$ npm i -d && npm test
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Author
Brian Woodward
License
Copyright © 2015 Brian Woodward Released under the MIT license.
This file was generated by verb-cli on August 07, 2015.