clubhouse-lib
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -196,17 +196,19 @@ 'use strict'; | ||
key: 'searchStories', | ||
value: function searchStories(query) { | ||
value: function searchStories(query, pageSize) { | ||
var _this = this; | ||
var pageSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 25; | ||
var processResult = function processResult(result) { | ||
if (result.next) { | ||
return _extends({}, result, { | ||
fetchNext: function fetchNext() { | ||
return _this.getResource(result.next).then(processResult); | ||
} | ||
}); | ||
} | ||
return result; | ||
}; | ||
return this.getResource('search/stories', { | ||
query: query, | ||
page_size: pageSize | ||
}).then(function (result) { | ||
return _extends({}, result, { | ||
fetchNext: function fetchNext() { | ||
return _this.getResource(result.next); | ||
} | ||
}); | ||
}); | ||
page_size: pageSize || 25 | ||
}).then(processResult); | ||
} | ||
@@ -213,0 +215,0 @@ |
{ | ||
"name": "clubhouse-lib", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "A Promise based library to the Clubhouse REST API", | ||
"files": [ | ||
"build" | ||
"build", | ||
"typings" | ||
], | ||
@@ -12,12 +13,16 @@ "main": "build/index.js", | ||
"scripts": { | ||
"build": "babel src --out-dir build --ignore '**/__tests__/**' && npm run build-flow", | ||
"build-flow": "flow-copy-source -v -i '**/__tests__/**' src build", | ||
"build": "babel src --out-dir build --ignore '**/__tests__/**' && npm run build:flow && npm run build:typescript", | ||
"build:flow": "flow-copy-source -v -i '**/__tests__/**' src build", | ||
"build:typescript": "scripts/ts-generate-definition.js && tsc", | ||
"lint": "eslint src", | ||
"prepublish": "npm run build", | ||
"test": "jest", | ||
"test:format": "prettier --list-different --single-quote --trailing-comma all --write src/**/*.js", | ||
"test:typescript": "scripts/ts-check.sh", | ||
"flow": "flow", | ||
"prettier": "prettier --single-quote --trailing-comma all --write src/**/*.js", | ||
"ci": "npm run lint && npm run flow && npm test" | ||
"format": "prettier --single-quote --trailing-comma all --write src/**/*.js", | ||
"ci": "npm run lint && npm run flow && npm test && npm run test:format && npm run test:typescript && npm run build" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^10.11.3", | ||
"babel-cli": "^6.26.0", | ||
@@ -47,3 +52,4 @@ "babel-eslint": "^8.0.1", | ||
"prettier": "^1.16.4", | ||
"save": "^2.3.1" | ||
"save": "^2.3.1", | ||
"typescript": "^3.4.0" | ||
}, | ||
@@ -62,3 +68,4 @@ "jest": { | ||
"universal-url": "^2.0.0" | ||
} | ||
}, | ||
"typings": "typings/index.d.ts" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
44709
16
806
27