utilitas 1998.2.47 → 1998.2.48
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/dist/utilitas.lite.mjs +1 -1
- package/dist/utilitas.lite.mjs.map +1 -1
- package/lib/manifest.mjs +1 -1
- package/lib/shot.mjs +3 -5
- package/package.json +1 -1
package/lib/manifest.mjs
CHANGED
package/lib/shot.mjs
CHANGED
|
@@ -20,7 +20,7 @@ const [_JSON, _PARSED] = ['JSON', 'PARSED'];
|
|
|
20
20
|
const getJson = async (u, o) => await get(u, { encode: _JSON, ...o || {} });
|
|
21
21
|
const getParsedHtml = async (u, o) => await get(u, { encode: _PARSED, ...o || {} });
|
|
22
22
|
|
|
23
|
-
let
|
|
23
|
+
let googleApiKey, googleCx;
|
|
24
24
|
|
|
25
25
|
const defFetchOpt = {
|
|
26
26
|
redirect: 'follow', follow: 3, timeout: 1000 * 10, headers: {
|
|
@@ -153,11 +153,9 @@ const get = async (url, options) => {
|
|
|
153
153
|
|
|
154
154
|
const initSearch = (options) => {
|
|
155
155
|
assert(
|
|
156
|
-
options?.
|
|
157
|
-
'Invalid search options.'
|
|
156
|
+
options?.apiKey && options?.cx, 'Invalid search options.'
|
|
158
157
|
);
|
|
159
|
-
return [
|
|
160
|
-
= [options.provider, options.apiKey, options.cx];
|
|
158
|
+
return [googleApiKey, googleCx] = [options.apiKey, options.cx];
|
|
161
159
|
};
|
|
162
160
|
|
|
163
161
|
const search = async (query, options) => {
|