extra-request 3.0.3 → 4.0.0
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/es2015/index.min.mjs +2 -2
- package/dist/es2015/index.min.mjs.map +1 -1
- package/dist/es2015/index.mjs +158 -10
- package/dist/es2015/index.mjs.map +1 -1
- package/dist/es2015/index.umd.js +158 -10
- package/dist/es2015/index.umd.js.map +1 -1
- package/dist/es2015/index.umd.min.js +2 -2
- package/dist/es2015/index.umd.min.js.map +1 -1
- package/dist/es2018/index.min.mjs +2 -2
- package/dist/es2018/index.min.mjs.map +1 -1
- package/dist/es2018/index.mjs +158 -10
- package/dist/es2018/index.mjs.map +1 -1
- package/dist/es2018/index.umd.js +158 -10
- package/dist/es2018/index.umd.js.map +1 -1
- package/dist/es2018/index.umd.min.js +2 -2
- package/dist/es2018/index.umd.min.js.map +1 -1
- package/package.json +16 -13
- package/CHANGELOG.md +0 -233
package/dist/es2015/index.umd.js
CHANGED
|
@@ -263,19 +263,167 @@
|
|
|
263
263
|
|
|
264
264
|
var object = {};
|
|
265
265
|
|
|
266
|
-
|
|
266
|
+
/**
|
|
267
|
+
* lodash (Custom Build) <https://lodash.com/>
|
|
268
|
+
* Build: `lodash modularize exports="npm" -o ./`
|
|
269
|
+
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
270
|
+
* Released under MIT license <https://lodash.com/license>
|
|
271
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
272
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
273
|
+
*/
|
|
274
|
+
|
|
275
|
+
/** `Object#toString` result references. */
|
|
276
|
+
var objectTag = '[object Object]';
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Checks if `value` is a host object in IE < 9.
|
|
280
|
+
*
|
|
281
|
+
* @private
|
|
282
|
+
* @param {*} value The value to check.
|
|
283
|
+
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
|
|
284
|
+
*/
|
|
285
|
+
function isHostObject(value) {
|
|
286
|
+
// Many host objects are `Object` objects that can coerce to strings
|
|
287
|
+
// despite having improperly defined `toString` methods.
|
|
288
|
+
var result = false;
|
|
289
|
+
if (value != null && typeof value.toString != 'function') {
|
|
290
|
+
try {
|
|
291
|
+
result = !!(value + '');
|
|
292
|
+
} catch (e) {}
|
|
293
|
+
}
|
|
294
|
+
return result;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Creates a unary function that invokes `func` with its argument transformed.
|
|
299
|
+
*
|
|
300
|
+
* @private
|
|
301
|
+
* @param {Function} func The function to wrap.
|
|
302
|
+
* @param {Function} transform The argument transform.
|
|
303
|
+
* @returns {Function} Returns the new function.
|
|
304
|
+
*/
|
|
305
|
+
function overArg(func, transform) {
|
|
306
|
+
return function(arg) {
|
|
307
|
+
return func(transform(arg));
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/** Used for built-in method references. */
|
|
312
|
+
var funcProto = Function.prototype,
|
|
313
|
+
objectProto = Object.prototype;
|
|
314
|
+
|
|
315
|
+
/** Used to resolve the decompiled source of functions. */
|
|
316
|
+
var funcToString = funcProto.toString;
|
|
317
|
+
|
|
318
|
+
/** Used to check objects for own properties. */
|
|
319
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
320
|
+
|
|
321
|
+
/** Used to infer the `Object` constructor. */
|
|
322
|
+
var objectCtorString = funcToString.call(Object);
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Used to resolve the
|
|
326
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
327
|
+
* of values.
|
|
328
|
+
*/
|
|
329
|
+
var objectToString = objectProto.toString;
|
|
330
|
+
|
|
331
|
+
/** Built-in value references. */
|
|
332
|
+
var getPrototype = overArg(Object.getPrototypeOf, Object);
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
336
|
+
* and has a `typeof` result of "object".
|
|
337
|
+
*
|
|
338
|
+
* @static
|
|
339
|
+
* @memberOf _
|
|
340
|
+
* @since 4.0.0
|
|
341
|
+
* @category Lang
|
|
342
|
+
* @param {*} value The value to check.
|
|
343
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
344
|
+
* @example
|
|
345
|
+
*
|
|
346
|
+
* _.isObjectLike({});
|
|
347
|
+
* // => true
|
|
348
|
+
*
|
|
349
|
+
* _.isObjectLike([1, 2, 3]);
|
|
350
|
+
* // => true
|
|
351
|
+
*
|
|
352
|
+
* _.isObjectLike(_.noop);
|
|
353
|
+
* // => false
|
|
354
|
+
*
|
|
355
|
+
* _.isObjectLike(null);
|
|
356
|
+
* // => false
|
|
357
|
+
*/
|
|
358
|
+
function isObjectLike(value) {
|
|
359
|
+
return !!value && typeof value == 'object';
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Checks if `value` is a plain object, that is, an object created by the
|
|
364
|
+
* `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
365
|
+
*
|
|
366
|
+
* @static
|
|
367
|
+
* @memberOf _
|
|
368
|
+
* @since 0.8.0
|
|
369
|
+
* @category Lang
|
|
370
|
+
* @param {*} value The value to check.
|
|
371
|
+
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
|
|
372
|
+
* @example
|
|
373
|
+
*
|
|
374
|
+
* function Foo() {
|
|
375
|
+
* this.a = 1;
|
|
376
|
+
* }
|
|
377
|
+
*
|
|
378
|
+
* _.isPlainObject(new Foo);
|
|
379
|
+
* // => false
|
|
380
|
+
*
|
|
381
|
+
* _.isPlainObject([1, 2, 3]);
|
|
382
|
+
* // => false
|
|
383
|
+
*
|
|
384
|
+
* _.isPlainObject({ 'x': 0, 'y': 0 });
|
|
385
|
+
* // => true
|
|
386
|
+
*
|
|
387
|
+
* _.isPlainObject(Object.create(null));
|
|
388
|
+
* // => true
|
|
389
|
+
*/
|
|
390
|
+
function isPlainObject$1(value) {
|
|
391
|
+
if (!isObjectLike(value) ||
|
|
392
|
+
objectToString.call(value) != objectTag || isHostObject(value)) {
|
|
393
|
+
return false;
|
|
394
|
+
}
|
|
395
|
+
var proto = getPrototype(value);
|
|
396
|
+
if (proto === null) {
|
|
397
|
+
return true;
|
|
398
|
+
}
|
|
399
|
+
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
|
400
|
+
return (typeof Ctor == 'function' &&
|
|
401
|
+
Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
var lodash_isplainobject = isPlainObject$1;
|
|
405
|
+
|
|
406
|
+
var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
407
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
408
|
+
};object.isntEmptyObject = object.isEmptyObject = object.isntPlainObject = object.isPlainObject = object.isntObject = object.isObject = void 0;
|
|
409
|
+
const lodash_isplainobject_1 = __importDefault(lodash_isplainobject);
|
|
267
410
|
function isObject(val) {
|
|
268
|
-
return val !== null
|
|
411
|
+
return val !== null
|
|
412
|
+
&& typeof val === 'object';
|
|
269
413
|
}
|
|
270
414
|
object.isObject = isObject;
|
|
271
415
|
function isntObject(val) {
|
|
272
416
|
return !isObject(val);
|
|
273
417
|
}
|
|
274
418
|
object.isntObject = isntObject;
|
|
275
|
-
function
|
|
276
|
-
return
|
|
419
|
+
function isPlainObject(val) {
|
|
420
|
+
return (0, lodash_isplainobject_1.default)(val);
|
|
421
|
+
}
|
|
422
|
+
object.isPlainObject = isPlainObject;
|
|
423
|
+
function isntPlainObject(val) {
|
|
424
|
+
return !isPlainObject(val);
|
|
277
425
|
}
|
|
278
|
-
object.
|
|
426
|
+
object.isntPlainObject = isntPlainObject;
|
|
279
427
|
function isEmptyObject(val) {
|
|
280
428
|
return Object.keys(val).length === 0;
|
|
281
429
|
}
|
|
@@ -310,7 +458,7 @@
|
|
|
310
458
|
return (0, array_1.isArray)(val) || (0, object_1.isObject)(val);
|
|
311
459
|
}
|
|
312
460
|
function isJsonRpcNotification(val) {
|
|
313
|
-
return (0, object_1.
|
|
461
|
+
return (0, object_1.isPlainObject)(val)
|
|
314
462
|
&& (0, string_1.isString)(val.jsonrpc)
|
|
315
463
|
&& (0, string_1.isString)(val.method)
|
|
316
464
|
&& (0, undefined_1.isUndefined)(val.id)
|
|
@@ -322,7 +470,7 @@
|
|
|
322
470
|
}
|
|
323
471
|
jsonRpc.isntJsonRpcNotification = isntJsonRpcNotification;
|
|
324
472
|
function isJsonRpcRequest(val) {
|
|
325
|
-
return (0, object_1.
|
|
473
|
+
return (0, object_1.isPlainObject)(val)
|
|
326
474
|
&& (0, string_1.isString)(val.jsonrpc)
|
|
327
475
|
&& (0, string_1.isString)(val.method)
|
|
328
476
|
&& isJsonRpcId(val.id)
|
|
@@ -334,7 +482,7 @@
|
|
|
334
482
|
}
|
|
335
483
|
jsonRpc.isntJsonRpcRequest = isntJsonRpcRequest;
|
|
336
484
|
function isJsonRpcSuccess(val) {
|
|
337
|
-
return (0, object_1.
|
|
485
|
+
return (0, object_1.isPlainObject)(val)
|
|
338
486
|
&& (0, string_1.isString)(val.jsonrpc)
|
|
339
487
|
&& (0, string_1.isString)(val.id)
|
|
340
488
|
&& 'result' in val;
|
|
@@ -345,7 +493,7 @@
|
|
|
345
493
|
}
|
|
346
494
|
jsonRpc.isntJsonRpcSuccess = isntJsonRpcSuccess;
|
|
347
495
|
function isJsonRpcError(val) {
|
|
348
|
-
return (0, object_1.
|
|
496
|
+
return (0, object_1.isPlainObject)(val)
|
|
349
497
|
&& (0, string_1.isString)(val.jsonrpc)
|
|
350
498
|
&& isJsonRpcId(val.id)
|
|
351
499
|
&& isJsonRpcErrorObject(val.error);
|
|
@@ -356,7 +504,7 @@
|
|
|
356
504
|
}
|
|
357
505
|
jsonRpc.isntJsonRpcError = isntJsonRpcError;
|
|
358
506
|
function isJsonRpcErrorObject(val) {
|
|
359
|
-
return (0, object_1.
|
|
507
|
+
return (0, object_1.isPlainObject)(val)
|
|
360
508
|
&& (0, number_1.isNumber)(val.code)
|
|
361
509
|
&& (0, string_1.isString)(val.message)
|
|
362
510
|
&& ((0, undefined_1.isUndefined)(val.data) || (0, object_1.isObject)(val.data));
|