Skip to content

Commit

Permalink
v4.0.20200531
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornstar committed May 31, 2020
1 parent 7d6d046 commit fcbf304
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
package-lock.json
npm-debug.log
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
language:
- node_js
node_js:
- "6"
- "8"
- "10"
- "12"
- "14"
jobs:
include:
- stage: lint
Expand Down
6 changes: 3 additions & 3 deletions Blob.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@

function FakeBlobBuilder () {
function isDataView (obj) {
return obj && DataView.prototype.isPrototypeOf(obj);
return obj && Object.prototype.isPrototypeOf.call(DataView, obj);
}
function bufferClone (buf) {
var view = new Array(buf.byteLength);
Expand Down Expand Up @@ -352,7 +352,7 @@
chunks[i] = chunk._buffer;
} else if (typeof chunk === "string") {
chunks[i] = textEncode(chunk);
} else if (arrayBufferSupported && (ArrayBuffer.prototype.isPrototypeOf(chunk) || isArrayBufferView(chunk))) {
} else if (arrayBufferSupported && (Object.prototype.isPrototypeOf.call(ArrayBuffer, chunk) || isArrayBufferView(chunk))) {
chunks[i] = bufferClone(chunk);
} else if (arrayBufferSupported && isDataView(chunk)) {
chunks[i] = bufferClone(chunk.buffer);
Expand Down Expand Up @@ -521,7 +521,7 @@
);

// Monkey patched
// IE don't set Content-Type header on XHR whose body is a typed Blob
// IE doesn't set Content-Type header on XHR whose body is a typed Blob
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/6047383
var _send = global.XMLHttpRequest && global.XMLHttpRequest.prototype.send;
if (isIE && _send) {
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# `blob-polyfill` CHANGELOG

## v4.0.20200531
* [Blob.js] Do not attempt to set readonly property Symbols (@bjornstar)
* [Blob.js] Do not use prototype built-ins (@bjornstar)
* [.travis.yml] Drop testing for node v6 and v8 (@bjornstar)
* [.travis.yml] Add testing for node v14 (@bjornstar)
* [package.json] Update devDependencies: `eslint` & `mocha` (@bjornstar)
* [.gitignore] Add `npm-debug.log` (@bjornstar)
* [README] Add usage examples to encourage non-global use of Blob (@bjornstar)

## v4.0.20190430
* A complete rewrite of Blob.js (@jimmywarting)
* Restore the UMD wrapper (@bjornstar)
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ To install this library, run:
$ npm install blob-polyfill --save
```

## Usage

CommonJS:
```js
var Blob = require('blob-polyfill').Blob;
```

AMD
```js
import { Blob } from 'blob-polyfill';
```

## Supported browsers

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blob-polyfill",
"version": "4.0.20190430",
"version": "4.0.20200531",
"description": "Blob.js implements the W3C Blob interface in browsers that do not natively support it.",
"main": "Blob.js",
"scripts": {
Expand All @@ -22,7 +22,7 @@
},
"homepage": "https://github.com/bjornstar/blob-polyfill",
"devDependencies": {
"eslint": "^5.16.0",
"mocha": "^6.1.4"
"eslint": "^7.1.0",
"mocha": "^7.2.0"
}
}

0 comments on commit fcbf304

Please sign in to comment.