UNPKG

react-http-fetch

Version:

An http library for React JS built on top of native JS fetch

61 lines (60 loc) 1.83 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isObject = exports.isBoolean = exports.isNumber = exports.isUrlSearchParams = exports.isFormData = exports.isBlob = exports.isArrayBuffer = void 0; /** * Safely assert whether the given value is an ArrayBuffer. * * In some execution environments ArrayBuffer is not defined. */ function isArrayBuffer(value) { return typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer; } exports.isArrayBuffer = isArrayBuffer; /** * Safely assert whether the given value is a Blob. * * In some execution environments Blob is not defined. */ function isBlob(value) { return typeof Blob !== 'undefined' && value instanceof Blob; } exports.isBlob = isBlob; /** * Safely assert whether the given value is a FormData instance. * * In some execution environments FormData is not defined. */ function isFormData(value) { return typeof FormData !== 'undefined' && value instanceof FormData; } exports.isFormData = isFormData; /** * Safely assert whether the given value is a URLSearchParams instance. * * In some execution environments URLSearchParams is not defined. */ function isUrlSearchParams(value) { return typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams; } exports.isUrlSearchParams = isUrlSearchParams; /** * Safely assert whether the given value is a number. */ function isNumber(value) { return typeof value === 'number'; } exports.isNumber = isNumber; /** * Safely assert whether the given value is a boolean. */ function isBoolean(value) { return typeof value === 'boolean'; } exports.isBoolean = isBoolean; /** * Safely assert whether the given value is an object. */ function isObject(value) { return typeof value === 'object'; } exports.isObject = isObject;