Skip to content

Commit 6c9771c

Browse files
author
Philipp Alferov
committed
Fix assumption function
1 parent 266b3a9 commit 6c9771c

File tree

4 files changed

+7
-19
lines changed

4 files changed

+7
-19
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
angular-file-saver
22
=========
3-
Angular file saver is an AngularJS service that provides integration of [FileSaver.js](https://github.com/eligrey/FileSaver.js/) that implements the
3+
Angular file saver is an AngularJS service that provides integration between [FileSaver.js](https://github.com/eligrey/FileSaver.js/) and AngularJS. FileSaver.js implements the
44
HTML5 W3C saveAs() FileSaver interface in browsers that do not natively support
55
it. The package also comes with [Blob.js](https://github.com/eligrey/Blob.js/)
66
as a dependency to provide support of wide range of browsers.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-file-saver",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"main": [
55
"src/file-saver.js"
66
],

src/file-saver.js

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
.module('fileSaver', [])
1616
.factory('SaveAs', [SaveAs]);
1717

18-
function SaveAs () {
18+
function SaveAs() {
1919
function blobInit(data, type) {
2020
var blob;
2121

@@ -30,23 +30,11 @@
3030
return blob;
3131
}
3232

33-
function isBlobInstance(data) {
34-
var blobSupport = hasBlobSupport();
35-
36-
if (blobSupport && data instanceof Blob) {
37-
return true;
38-
}
39-
40-
//If browser does not suport Blob natively, but the object passed as
41-
//first argument represented as BlobBuilder polyfill instance
42-
if (!blobSupport && data instanceof BlobBuilder) {
43-
return true;
44-
}
45-
46-
return false;
33+
function isBlobInstance (data) {
34+
return data instanceof Blob || data instanceof BlobBuilder;
4735
}
4836

49-
function hasBlobSupport () {
37+
function hasBlobSupport() {
5038
return typeof(Blob) === "function";
5139
}
5240

src/file-saver.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)