-
Notifications
You must be signed in to change notification settings - Fork 251
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
V7: Move context and breadcrumbs to private properties #681
Changes from 2 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 |
---|---|---|
|
@@ -88,9 +88,14 @@ module.exports.schema = { | |
return includes(BREADCRUMB_TYPES, maybeType) | ||
}, true)) | ||
}, | ||
context: { | ||
defaultValue: () => undefined, | ||
message: 'should be a string', | ||
validate: value => value === undefined || typeof value === 'string' | ||
}, | ||
user: { | ||
defaultValue: () => null, | ||
message: '(object) user should be an object', | ||
message: 'user should be an object', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could remove 'user' here? I guess the context would be sufficient to know it was user? Also makes it consistent with the other messages and may save a byte if we're lucky! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 6 bytes after minification! |
||
validate: (value) => typeof value === 'object' | ||
}, | ||
metadata: { | ||
|
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.
Do these need adding to the public interface typedefs?
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.
yeah – I was in the middle of a big types refactor when I realised this change was needed, so they are in #682 to save a conflict!