Skip to content

Commit 5fd273f

Browse files
author
Philipp Alferov
committed
Refactoring
1 parent 6c963f8 commit 5fd273f

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

gulpfile.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ function handleErrors(err) {
5151
this.emit('end');
5252
}
5353

54+
/*
55+
* Get arguments for release task from CLI
56+
*/
5457
function getUpdateType() {
5558
var env = $.util.env;
5659

src/angular-file-saver.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@
1010
*
1111
*/
1212

13-
angular
14-
.module('fileSaver', [])
15-
.factory('SaveAs', SaveAs);
13+
function handleErrors (msg) {
14+
throw new Error(msg);
15+
}
1616

17-
function SaveAs() {
17+
function isArray (obj) {
18+
return Object.prototype.toString.call(obj) === '[object Array]';
19+
}
1820

19-
function handleErrors (msg) {
20-
throw new Error(msg);
21-
}
21+
function isObject (obj) {
22+
return obj !== null && typeof obj === 'object';
23+
}
2224

23-
function isArray (obj) {
24-
return Object.prototype.toString.call(obj) === '[object Array]';
25-
}
25+
function isString (obj) {
26+
return typeof obj === 'string' || obj instanceof String;
27+
}
2628

27-
function isObject (obj) {
28-
return obj !== null && typeof obj === 'object';
29-
}
29+
function isBlobInstance (obj) {
30+
return obj instanceof Blob;
31+
}
3032

31-
function isString (obj) {
32-
return typeof obj === 'string' || obj instanceof String;
33-
}
33+
angular
34+
.module('fileSaver', [])
35+
.factory('SaveAs', SaveAs);
3436

35-
function isBlobInstance (obj) {
36-
return obj instanceof Blob;
37-
}
37+
function SaveAs() {
3838

3939
function save(blob, filename) {
4040
try {

0 commit comments

Comments
 (0)