Skip to content

Support dasherizing symbols by using their descriptions #226

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

Merged
merged 3 commits into from
May 6, 2022

Conversation

keithamus
Copy link
Contributor

Some groundwork for 2.0: dasherizing Symbols currently fails. symbol.description returns the string value of the symbol, we should use that to dasherize Symbols.

@keithamus keithamus requested a review from a team as a code owner May 6, 2022 18:19
@keithamus keithamus requested a review from srt32 May 6, 2022 18:19
@keithamus keithamus enabled auto-merge May 6, 2022 18:20
@@ -53,7 +53,7 @@
{
"path": "lib/index.js",
"import": "{controller, attr, target, targets}",
"limit": "1.64kb"
"limit": "1.66kb"
Copy link
Contributor

Choose a reason for hiding this comment

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

lol should we just set this to 2kb?

Comment on lines +8 to +14
export const mustDasherize = (str: unknown, type = 'property'): string => {
const dashed = dasherize(str)
if (!dashed.includes('-')) {
throw new DOMException(`${type}: ${String(str)} is not a valid ${type} name`, 'SyntaxError')
}
return dashed
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't used any where? Should this be in some other PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh this was a rebase error. 🤷 doesn't do any harm staying here.

@keithamus keithamus merged commit df0e263 into main May 6, 2022
@keithamus keithamus deleted the dasherize-symbols branch May 6, 2022 18:35
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.

2 participants