Skip to content

Commit ae2bd38

Browse files
committed
v7.0.20220408
1 parent 4cbed56 commit ae2bd38

File tree

7 files changed

+49
-16
lines changed

7 files changed

+49
-16
lines changed

.github/workflows/node.js.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node-version: [12, 14, 16, 17]
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v1
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
- run: npm i
28+
- run: npm run build --if-present
29+
- run: npm test

.npmignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.eslintrc.js
2-
.travis.yml
2+
.github
33
test

.travis.yml

-10
This file was deleted.

Blob.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@
355355
/* Blob constructor */
356356
/********************************************************/
357357
function Blob (chunks, opts) {
358-
chunks = chunks || [];
358+
chunks = chunks ? chunks.slice() : [];
359359
opts = opts == null ? {} : opts;
360360
for (var i = 0, len = chunks.length; i < len; i++) {
361361
var chunk = chunks[i];

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# `blob-polyfill` CHANGELOG
22

3+
## v7.0.20220408
4+
* [Blob.js] Do not modify array that is passed into constructor (@zyrong)
5+
* [.github] Start automated tests on github (@bjornstar)
6+
* [.travis.yml] Remove travis-ci integration (@bjornstar)
7+
* [.npmignore] Ignore .github, remove .travis.yml (@bjornstar)
8+
* [devDependencies] Update test dependencies (@bjornstar)
9+
310
## v6.0.20211015
411
* [Blob.js] Check object class names when determining Object types (@coclauso)
512
* [Blob.js] Reduce redundancies in getting class names and prototype checks (@bjornstar)

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "blob-polyfill",
3-
"version": "6.0.20211015",
3+
"version": "7.0.20220408",
44
"description": "Blob.js implements the W3C Blob interface in browsers that do not natively support it.",
55
"main": "Blob.js",
66
"scripts": {
@@ -22,8 +22,8 @@
2222
},
2323
"homepage": "https://github.com/bjornstar/blob-polyfill",
2424
"devDependencies": {
25-
"@sindresorhus/is": "^4.0.0",
26-
"eslint": "^7.19.0",
27-
"mocha": "^8.2.1"
25+
"@sindresorhus/is": "^4.6.0",
26+
"eslint": "^8.12.0",
27+
"mocha": "^9.2.2"
2828
}
2929
}

test/index.js

+7
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ describe("blob-polyfill", function () {
6161
assert.strictEqual(testString, testStringRecovered);
6262
});
6363
});
64+
65+
it("Does not modify the source array", function () {
66+
var array = ['mutation'];
67+
var clone = array.slice();
68+
var blob = new Blob(array);
69+
assert.deepStrictEqual(array, clone);
70+
});
6471
});
6572

6673
describe("File", function () {

0 commit comments

Comments
 (0)