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
fix(types): fixes to @socketsupply/socket types #645
Conversation
@aleclarson please run |
3375800
to
914bd8d
Compare
|
||
// type could be [(string|number)=] | ||
const parenthasisedType = rawType | ||
.replace(/\s*\|\s*/g, ' \\| ') | ||
.replace(/\[|\]/g, '') | ||
// now it is (string|number)= | ||
const optional = parenthasisedType.endsWith('=') | ||
const optional = parenthasisedType.endsWith('=') || /^ *\[/.test(rawName) |
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.
added handling for [optionalParam]
without default value
@@ -141,21 +141,21 @@ export function generateApiModuleDoc ({ | |||
item.signature = item.signature || [] | |||
const parts = attr.split(/-\s+(.*)/) | |||
const { 1: rawType, 2: rawName } = parts[0].match(/{([^}]+)}(.*)/) | |||
const [name, defaultValue] = rawName.replace(/[[\]']+/g, '').trim().split('=') | |||
const [name, defaultValue] = rawName.replace(/[[\]']+/g, '').trim().split(/ *[=] */) |
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.
added whitespace tolerance to param name =
splitting
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.
👍
Found some broken types and made
Extension
generic so I could specify itsbinding
type