Namespace: masseuse/utilities/createOptions

masseuse/utilities/createOptions

createOptions allows for the proper creation of options objects, so that the object references passed in to it are not modified.

The method returns a new object.

The order of arguments is that of _.extend. Passing an empty object in as the first argument is not required.

Example:

new BaseView(createOptions(generalOptions, specificOptions));

The options are deep extended, so fields are combined if both objects.

undefined can be used to clobber fields:

// will return {a:undefined}
createOptions({a:1},{a:undefined});
Source: