Skip to content

Commit b18af2e

Browse files
author
Philipp Alferov
committed
Build
1 parent 290c378 commit b18af2e

File tree

4 files changed

+47
-42
lines changed

4 files changed

+47
-42
lines changed

dist/angular-file-saver.js

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
1+
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.angularFileSaver = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2+
'use strict';
3+
24
/* angular-file-saver
35
*
46
* A AngularJS service that implements the HTML5 W3C saveAs() in browsers that
@@ -9,53 +11,51 @@
911
*
1012
*/
1113

12-
(function() {
13-
'use strict';
14-
15-
angular
16-
.module('fileSaver', [])
17-
.factory('SaveAs', SaveAs);
14+
angular
15+
.module('fileSaver', [])
16+
.factory('SaveAs', SaveAs);
1817

19-
function SaveAs() {
18+
function SaveAs() {
2019

21-
function isBlobInstance (data) {
22-
return data instanceof Blob;
23-
}
20+
function isBlobInstance (data) {
21+
return data instanceof Blob;
22+
}
2423

25-
function save(blob, filename) {
26-
try {
27-
saveAs(blob, filename);
28-
} catch(err) {
29-
console.error(err.message);
30-
}
24+
function save(blob, filename) {
25+
try {
26+
saveAs(blob, filename);
27+
} catch(err) {
28+
console.error(err.message);
3129
}
30+
}
3231

33-
return {
34-
35-
/**
36-
* saveFile - Immediately starts saving a file, returns undefined.
37-
*
38-
* @param {array|Blob} data Represented as an array or a Blob object
39-
* @param {string} filename
40-
* @param {object} options Set of Blob constructor options.
41-
* Optional parameter, if Blob object is passed as first argument
42-
* @return {undefined}
43-
*/
32+
return {
4433

45-
download: function (data, filename, options) {
46-
var blob;
47-
data = data instanceof Array ? data : [data];
34+
/**
35+
* saveFile - Immediately starts saving a file, returns undefined.
36+
*
37+
* @param {array|Blob} data Represented as an array or a Blob object
38+
* @param {string} filename
39+
* @param {object} options Set of Blob constructor options.
40+
* Optional parameter, if Blob object is passed as first argument
41+
* @return {undefined}
42+
*/
4843

49-
if (isBlobInstance(data)) {
50-
save(data, filename);
51-
}
44+
download: function (data, filename, options) {
45+
var blob;
46+
data = data instanceof Array ? data : [data];
5247

53-
blob = new Blob(data, options);
54-
save(blob, filename);
48+
if (isBlobInstance(data)) {
49+
save(data, filename);
5550
}
56-
};
57-
}
5851

59-
})();
52+
blob = new Blob(data, options);
53+
save(blob, filename);
54+
}
55+
};
56+
}
57+
58+
module.exports = function (n) { return n * 111 }
6059

61-
},{}]},{},[1]);
60+
},{}]},{},[1])(1)
61+
});

dist/angular-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.

gulpfile.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ gulp.task('watch:docs', ['serve'], function() {
170170
gulp.watch(config.docs.styles, ['styles:docs']);
171171
});
172172

173+
/*
174+
* Automate npm & bower updates.
175+
* $ gulp bump --type major - using gulp-bump versioning
176+
* $ gulp bump --version 1.1.1 - using explicit version number
177+
*/
173178
gulp.task('bump', function() {
174179

175180
return gulp.src('./*.json')

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/alferov/angular-file-saver.git"
88
},
99
"main": [
10-
"dist/angular-file-saver.js"
10+
"./dist/angular-file-saver.js"
1111
],
1212
"keywords": [
1313
"filesaver",

0 commit comments

Comments
 (0)