-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Blob: Add types #19092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blob: Add types #19092
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,9 @@ | |
| */ | ||
| const { createObjectURL, revokeObjectURL } = window.URL; | ||
|
|
||
| /** | ||
| * @type {{[key: string]: File|undefined}} | ||
| */ | ||
| const cache = {}; | ||
|
|
||
| /** | ||
|
|
@@ -27,7 +30,7 @@ export function createBlobURL( file ) { | |
| * | ||
| * @param {string} url The blob URL. | ||
| * | ||
| * @return {?File} The file for the blob URL. | ||
| * @return {File|undefined} The file for the blob URL. | ||
|
||
| */ | ||
| export function getBlobByURL( url ) { | ||
| return cache[ url ]; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ | |
|
|
||
| /* Strict Type-Checking Options */ | ||
| "strict": true, /* Enable all strict type-checking options. */ | ||
| "strictNullChecks": true, | ||
|
||
| "noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */ | ||
|
|
||
| /* Additional Checks */ | ||
|
|
@@ -21,6 +22,7 @@ | |
| "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ | ||
| }, | ||
| "include": [ | ||
| "./packages/blob/**/*.js", | ||
| "./packages/dom-ready/**/*.js", | ||
| "./packages/i18n/**/*.js", | ||
| "./packages/is-shallow-equal/**/*.js", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially, my editor ignored the
| undefinedpart of this type and the following one. Adding explicitstrictNullChecksto the tsconfig restored it.