freshbooks-classic
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "freshbooks-classic", | ||
"description": "FreshBooks Classic API wrapper", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"author": "Leonardo Dino", | ||
@@ -9,6 +9,6 @@ "scripts": { | ||
"build": "babel src -sd lib", | ||
"dev": "concurrently -kr 'babel src -wsd lib' 'ava -wv'" | ||
"dev": "concurrently -kr 'babel src -wsd lib' 'ava -w'" | ||
}, | ||
"homepage": "https://github.com/leonardodino/freshbooks-classic", | ||
"main": "index.js", | ||
"main": "lib/index.js", | ||
"engines": { | ||
@@ -15,0 +15,0 @@ "node": ">= 6" |
@@ -60,7 +60,9 @@ import _ from 'lodash/fp' | ||
const first = await request(1) | ||
const pages = _.range(first.page + 1, first.pages + 1).map(request) | ||
return _.flow([ | ||
_.map(paginate), | ||
_.spread(_.concat([])), | ||
])(await Promise.all([first, ...pages])) | ||
const {pages} = first | ||
let results = [...first[paginate]] | ||
for(let page = 2; page < first.pages + 1; page++){ | ||
const current = await request(page) | ||
results = [...results, ...current[paginate]] | ||
} | ||
return results | ||
} | ||
@@ -67,0 +69,0 @@ } |
import _ from 'lodash' | ||
import test from 'ava' | ||
import {url, token} from './credentials.json' | ||
import FreshBooks from '../lib' | ||
import FreshBooks from '..' | ||
@@ -6,0 +6,0 @@ let client_id = null |
import _ from 'lodash' | ||
import test from 'ava' | ||
import {url, token} from './credentials.json' | ||
import FreshBooks from '../lib' | ||
import FreshBooks from '..' | ||
@@ -6,0 +6,0 @@ let client_id = 2 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30703
19
716