From 0b6d49ca5d64baa3f9c2ca7b8d528af2263cafc5 Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Sun, 7 Jun 2020 21:57:55 -0400 Subject: [PATCH 1/6] remove manual typings --- index.d.ts | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 841e665..0000000 --- a/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// - -/* global Blob */ -export = Blob; From a9109830298272b2ab285de3a3cf8d678c5e2283 Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Sun, 7 Jun 2020 22:01:56 -0400 Subject: [PATCH 2/6] create typings from JSDoc --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 3564f87..df58462 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "lint": "xo", "test": "xo && ava", "report": "nyc ava", - "coverage": "nyc --reporter json --reporter text ava && codecov -f coverage/coverage-final.json" + "coverage": "nyc --reporter json --reporter text ava && codecov -f coverage/coverage-final.json", + "prepublishOnly": "npx typescript --declaration --emitDeclarationOnly --allowJs index.js" }, "repository": "https://github.com/node-fetch/fetch-blob.git", "keywords": [ From dad79d0c4ba86c90f76c102bac61e5bf203411b7 Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Sun, 7 Jun 2020 22:06:26 -0400 Subject: [PATCH 3/6] fix param name --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 5ad1e05..e163717 100644 --- a/index.js +++ b/index.js @@ -129,7 +129,7 @@ class Blob { * * @param {number} [start] * @param {number} [end] - * @param {string} [contentType] + * @param {string} [type] */ slice(start = 0, end = this.size, type = '') { const {size} = this; From e0deec83488405d1ea74838338d38fdd167083bb Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Sun, 7 Jun 2020 22:09:22 -0400 Subject: [PATCH 4/6] add typings to gitignore --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2d318e6..8602d1e 100644 --- a/.gitignore +++ b/.gitignore @@ -62,5 +62,4 @@ typings/ # dotenv environment variables file .env -# next.js build output -.next +index.d.ts From f9142eaa05e9526364461124ea9fc84d9ebb7f50 Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Mon, 8 Jun 2020 11:46:56 -0400 Subject: [PATCH 5/6] specify TypeScript minimum version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index df58462..48475fa 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "test": "xo && ava", "report": "nyc ava", "coverage": "nyc --reporter json --reporter text ava && codecov -f coverage/coverage-final.json", - "prepublishOnly": "npx typescript --declaration --emitDeclarationOnly --allowJs index.js" + "prepublishOnly": "npx 'typescript@>3.7' --declaration --emitDeclarationOnly --allowJs index.js" }, "repository": "https://github.com/node-fetch/fetch-blob.git", "keywords": [ From f5213eca991d049d5c7497ee6eb4c646506e0160 Mon Sep 17 00:00:00 2001 From: Konstantin Vyatkin Date: Wed, 10 Jun 2020 09:40:53 -0400 Subject: [PATCH 6/6] move typescript into devDependencies --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 48475fa..75fd152 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "test": "xo && ava", "report": "nyc ava", "coverage": "nyc --reporter json --reporter text ava && codecov -f coverage/coverage-final.json", - "prepublishOnly": "npx 'typescript@>3.7' --declaration --emitDeclarationOnly --allowJs index.js" + "prepublishOnly": "tsc --declaration --emitDeclarationOnly --allowJs index.js" }, "repository": "https://github.com/node-fetch/fetch-blob.git", "keywords": [ @@ -34,6 +34,7 @@ "get-stream": "^5.1.0", "node-fetch": "^2.6.0", "nyc": "^15.0.1", + "typescript": "^3.9.5", "xo": "^0.30.0" }, "xo": {