-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
2,755 additions
and
2,411 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,45 @@ | ||
# See http://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# compiled output | ||
# Compiled output | ||
/dist | ||
/tmp | ||
/out-tsc | ||
/publish | ||
/package-lock.json | ||
/.angular/cache | ||
/bazel-out | ||
|
||
# dependencies | ||
# Node | ||
/node_modules | ||
npm-debug.log | ||
yarn-error.log | ||
|
||
# IDEs and editors | ||
/.idea | ||
.idea/ | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
# IDE - VSCode | ||
# Visual Studio Code | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
.history/* | ||
|
||
# misc | ||
/.sass-cache | ||
# Miscellaneous | ||
/.angular/cache | ||
.sass-cache/ | ||
/connect.lock | ||
/coverage | ||
/libpeerconnection.log | ||
npm-debug.log | ||
yarn-error.log | ||
testem.log | ||
/typings | ||
|
||
# System Files | ||
# System files | ||
.DS_Store | ||
Thumbs.db | ||
|
||
/publish | ||
/yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
14.16.1 | ||
18.12.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
import * as fs from 'file-saver'; | ||
import { FileSaverService } from '../src/filesaver.service'; | ||
|
||
describe('ngx-filesaver:', () => { | ||
let srv: FileSaverService; | ||
|
||
beforeEach(() => { | ||
srv = TestBed.inject(FileSaverService); | ||
}); | ||
|
||
it('#genType', () => { | ||
[ | ||
{ name: null, ret: 'text/plain' }, | ||
{ name: '1.txt', ret: 'text/plain' }, | ||
{ name: '1.xml', ret: 'text/xml' }, | ||
{ name: '1.html', ret: 'text/html' }, | ||
{ name: '1.json', ret: 'octet/stream' }, | ||
{ name: '1.apk', ret: 'application/apk' }, | ||
].forEach(({ name, ret }) => { | ||
expect(srv.genType(name)).toBe(ret); | ||
}); | ||
}); | ||
|
||
describe('#save', () => { | ||
it('should be error when is ', () => { | ||
expect(() => srv.save(null)).toThrowError('Data argument should be a blob instance'); | ||
}); | ||
|
||
it('should be use default filename: download', () => { | ||
const blob = new Blob(); | ||
const spy = spyOn(fs, 'saveAs'); | ||
srv.save(blob); | ||
expect(spy.calls.first().args[1] as string).toBe('download'); | ||
}); | ||
}); | ||
|
||
it('#saveText', () => { | ||
const spy = spyOn(fs, 'saveAs'); | ||
srv.saveText('a'); | ||
expect((spy.calls.first().args[0] as Blob).size).toBe(1); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
import { enableProdMode } from '@angular/core'; | ||
import { environment } from './environments/environment'; | ||
|
||
import { bootstrapApplication } from '@angular/platform-browser'; | ||
import { AppComponent } from './app/app.component'; | ||
import { provideHttpClient } from '@angular/common/http'; | ||
|
||
if (environment.production) { | ||
enableProdMode(); | ||
} | ||
|
||
bootstrapApplication(AppComponent).catch((err) => console.error(err)); | ||
bootstrapApplication(AppComponent, { | ||
providers: [provideHttpClient()], | ||
}).catch((err) => console.error(err)); |
Oops, something went wrong.