Skip to content
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

Merged
merged 3 commits into from Oct 6, 2023

Conversation

aleclarson
Copy link
Contributor

@aleclarson aleclarson commented Oct 5, 2023

Found some broken types and made Extension generic so I could specify its binding type

@chicoxyzzy
Copy link
Member

@aleclarson please run npm run gen to regenerate documentation as well


// 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)
Copy link
Contributor Author

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(/ *[=] */)
Copy link
Contributor Author

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

Copy link
Member

@chicoxyzzy chicoxyzzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jwerle jwerle merged commit f008e6d into socketsupply:master Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants