Last active
December 10, 2016 06:50
-
-
Save AlanBreck/abd025698f6919cae4ae3216f8c6d587 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const jobsArray = [].slice.call( jobs ); | |
const jobsToInvoice = jobsArray.map( job => ({ | |
name: job.name, | |
quantity: 1, | |
unit_price: { | |
currency: "USD", | |
value: job.cost | |
} | |
})); | |
/* | |
* Returns: | |
ModelArray [ | |
{ name: undefined, | |
quantity: 1, | |
unit_price: { currency: 'USD', value: undefined } }, | |
{ name: undefined, | |
quantity: 1, | |
unit_price: { currency: 'USD', value: undefined } }, | |
{ name: undefined, | |
quantity: 1, | |
unit_price: { currency: 'USD', value: undefined } }, | |
_meta: { total: 0, offset: 0 }, | |
Model: 3 ] | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment