duck-duck-scrape
Advanced tools
Comparing version 2.1.4 to 2.1.5
@@ -8,2 +8,5 @@ # Changelog | ||
## [Unreleased] | ||
## [2.1.5] - 2021-09-29 | ||
### Fixed: | ||
- Fixed `searchImages` to use ensureJSON | ||
## [2.1.4] - 2021-09-15 | ||
@@ -39,3 +42,3 @@ ### Fixed: | ||
[Unreleased]: https://github.com/Snazzah/duck-duck-scrape/compare/v2.1.4...HEAD | ||
[Unreleased]: https://github.com/Snazzah/duck-duck-scrape/compare/v2.1.5...HEAD | ||
[1.0.3]: https://github.com/Snazzah/duck-duck-scrape/releases/tag/v1.0.3 | ||
@@ -49,1 +52,2 @@ [2.0.0]: https://github.com/Snazzah/duck-duck-scrape/compare/v1.0.3...v2.0.0 | ||
[2.1.4]: https://github.com/Snazzah/duck-duck-scrape/compare/v2.1.3...v2.1.4 | ||
[2.1.5]: https://github.com/Snazzah/duck-duck-scrape/compare/v2.1.4...v2.1.5 |
@@ -145,3 +145,3 @@ "use strict"; | ||
throw new Error('A server error occurred!'); | ||
const imagesResult = JSON.parse(response.body.toString()); | ||
const imagesResult = (0, util_1.ensureJSON)(response.body); | ||
return { | ||
@@ -148,0 +148,0 @@ noResults: !imagesResult.results.length, |
{ | ||
"name": "duck-duck-scrape", | ||
"version": "2.1.4", | ||
"version": "2.1.5", | ||
"description": "Search from DuckDuckGo and use it's spice APIs.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
import { decode } from 'html-entities'; | ||
import needle, { NeedleOptions } from 'needle'; | ||
import { DuckbarResponse, DuckbarImageResult } from '../types'; | ||
import { getVQD, queryString } from '../util'; | ||
import { ensureJSON, getVQD, queryString } from '../util'; | ||
import { SafeSearchType } from '../util'; | ||
@@ -186,3 +186,3 @@ | ||
const imagesResult = JSON.parse(response.body.toString()) as DuckbarResponse<DuckbarImageResult>; | ||
const imagesResult = ensureJSON(response.body) as DuckbarResponse<DuckbarImageResult>; | ||
@@ -189,0 +189,0 @@ return { |
138227