utilitas 2001.1.111 → 2001.1.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/manifest.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  const manifest = {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for JavaScript.",
4
- "version": "2001.1.111",
4
+ "version": "2001.1.112",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",
package/lib/web.mjs CHANGED
@@ -195,6 +195,8 @@ const search = async (query, options = {}) => {
195
195
  + `&q=${encodeURIComponent(query)}&num=${num}&start=${start}`
196
196
  + (options?.image ? `&searchType=image` : '');
197
197
  var resp = await get(url, { encode: _JSON, ...options || {} });
198
+ assert(!resp?.content?.error?.message, resp?.content?.error?.message
199
+ || 'Failed to use Google Search API.');
198
200
  return options?.raw ? resp.content : {
199
201
  totalResults: resp?.content?.searchInformation?.totalResults || 0,
200
202
  startIndex: resp?.content?.queries?.request?.[0]?.startIndex || 1,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "utilitas",
3
3
  "description": "Just another common utility for JavaScript.",
4
- "version": "2001.1.111",
4
+ "version": "2001.1.112",
5
5
  "private": false,
6
6
  "homepage": "https://github.com/Leask/utilitas",
7
7
  "main": "index.mjs",