Skip to content

Commit

Permalink
v7.0.20220408
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornstar committed Apr 8, 2022
1 parent 4cbed56 commit ae2bd38
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 16 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12, 14, 16, 17]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm i
- run: npm run build --if-present
- run: npm test
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.eslintrc.js
.travis.yml
.github
test
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Blob.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@
/* Blob constructor */
/********************************************************/
function Blob (chunks, opts) {
chunks = chunks || [];
chunks = chunks ? chunks.slice() : [];
opts = opts == null ? {} : opts;
for (var i = 0, len = chunks.length; i < len; i++) {
var chunk = chunks[i];
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `blob-polyfill` CHANGELOG

## v7.0.20220408
* [Blob.js] Do not modify array that is passed into constructor (@zyrong)
* [.github] Start automated tests on github (@bjornstar)
* [.travis.yml] Remove travis-ci integration (@bjornstar)
* [.npmignore] Ignore .github, remove .travis.yml (@bjornstar)
* [devDependencies] Update test dependencies (@bjornstar)

## v6.0.20211015
* [Blob.js] Check object class names when determining Object types (@coclauso)
* [Blob.js] Reduce redundancies in getting class names and prototype checks (@bjornstar)
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blob-polyfill",
"version": "6.0.20211015",
"version": "7.0.20220408",
"description": "Blob.js implements the W3C Blob interface in browsers that do not natively support it.",
"main": "Blob.js",
"scripts": {
Expand All @@ -22,8 +22,8 @@
},
"homepage": "https://github.com/bjornstar/blob-polyfill",
"devDependencies": {
"@sindresorhus/is": "^4.0.0",
"eslint": "^7.19.0",
"mocha": "^8.2.1"
"@sindresorhus/is": "^4.6.0",
"eslint": "^8.12.0",
"mocha": "^9.2.2"
}
}
7 changes: 7 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ describe("blob-polyfill", function () {
assert.strictEqual(testString, testStringRecovered);
});
});

it("Does not modify the source array", function () {
var array = ['mutation'];
var clone = array.slice();
var blob = new Blob(array);
assert.deepStrictEqual(array, clone);
});
});

describe("File", function () {
Expand Down

0 comments on commit ae2bd38

Please sign in to comment.