Skip to content

Commit a250044

Browse files
committed
chore: upgrade deps
1 parent 424cdeb commit a250044

File tree

6 files changed

+2660
-1904
lines changed

6 files changed

+2660
-1904
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22
node_js:
3-
- '8'
3+
- '10'
44

55
script:
66
- yarn test:cov

package.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,29 +46,29 @@
4646
}
4747
},
4848
"dependencies": {
49-
"tslib": "^1.9.0"
49+
"tslib": "^2.0.1"
5050
},
5151
"devDependencies": {
52-
"@babel/core": "^7.0.0-beta.54",
53-
"@types/jest": "^23.3.3",
54-
"@types/node": "^9.4.5",
55-
"babel-core": "^7.0.0-0",
56-
"babel-jest": "^23.4.0",
57-
"camelcase": "^4.1.0",
58-
"jest": "^23.6.0",
59-
"jest-environment-jsdom": "^23.4.0",
60-
"npm-run-all": "^4.1.3",
61-
"rollup": "^0.65.0",
62-
"rollup-plugin-commonjs": "^9.1.6",
63-
"rollup-plugin-node-resolve": "^3.3.0",
64-
"rollup-plugin-sourcemaps": "^0.4.2",
65-
"rollup-plugin-uglify": "^4.0.0",
66-
"standard-version": "^4.4.0",
67-
"ts-jest": "^23.10.3",
68-
"tslint": "^5.9.1",
69-
"typescript": "^3.0.3"
52+
"@babel/core": "^7.11.6",
53+
"@rollup/plugin-commonjs": "^15.0.0",
54+
"@rollup/plugin-node-resolve": "^9.0.0",
55+
"@types/jest": "^26.0.13",
56+
"@types/node": "^14.6.4",
57+
"babel-core": "^6.26.3",
58+
"babel-jest": "^26.3.0",
59+
"camelcase": "^6.0.0",
60+
"jest": "^26.4.2",
61+
"jest-environment-jsdom": "^26.3.0",
62+
"npm-run-all": "^4.1.5",
63+
"rollup": "^2.26.10",
64+
"rollup-plugin-sourcemaps": "^0.6.2",
65+
"rollup-plugin-terser": "^7.0.2",
66+
"standard-version": "^9.0.0",
67+
"ts-jest": "^26.3.0",
68+
"tslint": "^6.1.3",
69+
"typescript": "^4.0.2"
7070
},
7171
"engines": {
72-
"node": ">= 8"
72+
"node": ">= 10"
7373
}
7474
}

rollup.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
const camelCase = require('camelcase');
2-
const commonjs = require('rollup-plugin-commonjs');
3-
const resolve = require('rollup-plugin-node-resolve');
2+
const commonjs = require('@rollup/plugin-commonjs');
3+
const {nodeResolve} = require('@rollup/plugin-node-resolve');
44
const sourcemaps = require('rollup-plugin-sourcemaps');
5-
const {uglify} = require('rollup-plugin-uglify');
5+
const {terser} = require('rollup-plugin-terser');
66

77
const pckg = require('./package.json');
88
const name = pckg.name;
99
const input = pckg.module;
1010

1111
const plugins = [
12-
resolve(),
12+
nodeResolve(),
1313
commonjs(),
1414
sourcemaps()
1515
];
@@ -46,7 +46,7 @@ export default [{
4646
input,
4747
plugins: [
4848
...plugins,
49-
uglify()
49+
terser()
5050
],
5151
external,
5252
output: {

src/file-selector.spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,12 @@ function fileSystemFileEntryFromFile(file: File, err?: any): FileEntry {
325325
}
326326

327327
function fileSystemDirEntryFromFile(
328-
files: Array<FileEntry | DirEntry>,
328+
files: FileOrDirEntry[],
329329
batchSize: number = 1,
330330
throwAfter: number = 0
331331
): DirEntry {
332332
const copy = files.slice(0);
333-
const batches: Array<Array<FileEntry | DirEntry>> = [];
333+
const batches: FileOrDirEntry[][] = [];
334334

335335
let current = 0;
336336
while (copy.length) {
@@ -390,6 +390,8 @@ function sortFiles<T extends File>(files: T[]) {
390390
}
391391

392392

393+
type FileOrDirEntry = FileEntry | DirEntry
394+
393395
interface FileEntry extends Entry {
394396
file(
395397
cb: (file: File) => void,
@@ -408,7 +410,7 @@ interface Entry {
408410

409411
interface DirReader {
410412
readEntries(
411-
cb: (entries: Array<FileEntry | DirEntry>) => void,
413+
cb: (entries: FileOrDirEntry[]) => void,
412414
errCb: (err: any) => void
413415
): void;
414416
}

src/file-selector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const FILES_TO_IGNORE = [
1414
* everything will be flattened and placed in the same list but the paths will be kept as a {path} property.
1515
* @param evt
1616
*/
17-
export async function fromEvent(evt: Event): Promise<Array<FileWithPath | DataTransferItem>> {
17+
export async function fromEvent(evt: Event): Promise<(FileWithPath | DataTransferItem)[]> {
1818
return isDragEvt(evt) && evt.dataTransfer
1919
? getDataTransferFiles(evt.dataTransfer, evt.type)
2020
: getInputFiles(evt);
@@ -120,7 +120,7 @@ function fromDirEntry(entry: any) {
120120
const reader = entry.createReader();
121121

122122
return new Promise<FileArray[]>((resolve, reject) => {
123-
const entries: Array<Promise<FileValue[]>> = [];
123+
const entries: Promise<FileValue[]>[] = [];
124124

125125
function readEntries() {
126126
// https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry/createReader

0 commit comments

Comments
 (0)