-
Notifications
You must be signed in to change notification settings - Fork 937
Remove JS input validation for Storage #3967
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
Conversation
|
Binary Size ReportAffected SDKs
Test Logs |
…/firebase-js-sdk into mrschmidt/no-validation-storage
if (!type.isObject(p) || !p) { | ||
throw 'Expected Metadata object.'; | ||
} | ||
export function validateMetadata(p: { [key: string]: unknown }): void { |
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.
I actually got rid of this entirely in storage-exp because it's checking types of Metadata fields which should be caught by typescript check? Or did I make a mistake?
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.
Oh, I didn't realize this was fully typed. Removed.
packages/storage/src/reference.ts
Outdated
@@ -353,3 +338,23 @@ export class Reference { | |||
} | |||
} | |||
} | |||
|
|||
export function validateNumber( |
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.
Should this go in a separate file? type.ts?
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.
I didn't want to keep the original file for just this one function, but types.ts
is a good location. Moved.
wow, impressive 10% saving! |
Removes all input validation that can be caught by TypeScript transpiler.