From e1700fdcb7e483a21cc1654c1031fe591db27eac Mon Sep 17 00:00:00 2001 From: Colin Timmermans Date: Wed, 1 Jun 2022 11:04:39 +0200 Subject: [PATCH] Vendor isBlob package for now to get rid of arrow function --- LICENSE | 2 +- package-lock.json | 19 +------------------ package.json | 1 - src/is_blob.js | 28 ++++++++++++++++++++++++++++ src/utils.js | 2 +- 5 files changed, 31 insertions(+), 21 deletions(-) create mode 100644 src/is_blob.js diff --git a/LICENSE b/LICENSE index 4d1e452..558dbf4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Colin Timmermans +Copyright (c) Colin Timmermans Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package-lock.json b/package-lock.json index 7a1bb55..146b595 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,6 @@ "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", - "is-blob": "^2.1.0", "is-buffer": "^2.0.5" }, "devDependencies": { @@ -26,7 +25,7 @@ "webpack-cli": "^4.9.2" }, "peerDependencies": { - "axios": ">= 0.9.0" + "axios": ">= 0.17.0" } }, "node_modules/@babel/code-frame": { @@ -2700,17 +2699,6 @@ "node": ">=8" } }, - "node_modules/is-blob": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-blob/-/is-blob-2.1.0.tgz", - "integrity": "sha512-SZ/fTft5eUhQM6oF/ZaASFDEdbFVe89Imltn9uZr03wdKMcWNVYSMjQPFtg05QuNkt5l5c135ElvXEQG0rk4tw==", - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-buffer": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", @@ -7570,11 +7558,6 @@ "binary-extensions": "^2.0.0" } }, - "is-blob": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-blob/-/is-blob-2.1.0.tgz", - "integrity": "sha512-SZ/fTft5eUhQM6oF/ZaASFDEdbFVe89Imltn9uZr03wdKMcWNVYSMjQPFtg05QuNkt5l5c135ElvXEQG0rk4tw==" - }, "is-buffer": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", diff --git a/package.json b/package.json index 4bdac0b..f2b62dd 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,6 @@ }, "dependencies": { "fast-deep-equal": "^3.1.3", - "is-blob": "^2.1.0", "is-buffer": "^2.0.5" }, "bundlesize": [ diff --git a/src/is_blob.js b/src/is_blob.js new file mode 100644 index 0000000..b173540 --- /dev/null +++ b/src/is_blob.js @@ -0,0 +1,28 @@ +/*! + * MIT License + * + * Copyright (c) Sindre Sorhus (https://sindresorhus.com) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit + * persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +function isBlob(value) { + if (typeof Blob === 'undefined') { + return false; + } + + return value instanceof Blob || Object.prototype.toString.call(value) === '[object Blob]'; +} + +module.exports = isBlob; diff --git a/src/utils.js b/src/utils.js index 79b91ad..890fa7a 100644 --- a/src/utils.js +++ b/src/utils.js @@ -2,7 +2,7 @@ var isEqual = require("fast-deep-equal"); var isBuffer = require("is-buffer"); -var isBlob = require("is-blob"); +var isBlob = require("./is_blob"); var toString = Object.prototype.toString; function find(array, predicate) {