-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
WIP: Optimize templating #56
base: master
Are you sure you want to change the base?
Conversation
- Refactoerd tickplate function | ||
- Updated typings |
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.
- Refactoerd tickplate function | |
- Updated typings | |
- Refactored tickplate function |
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "tickplate", | |||
"version": "1.0.3", | |||
"version": "1.0.4", |
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.
Version should be changed separately in publish
commit
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "tickplate", | |||
"version": "1.0.3", | |||
"version": "1.0.4", |
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.
Ditto
declare function tickplate(strings: Array<string>, ...keys: Array<string>): (values: object) => string; | ||
declare function tickplate( | ||
strings: TemplateStringsArray, | ||
...keys: string[] |
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.
We prefer Array<string>
(values) => | ||
String.raw(strings, ...keys.map((key) => values[key] ?? '')); |
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.
- We support node.js 12, so can;t use nullish coalescing operator, see: https://node.green/#ES2020-features--nullish-coalescing-operator-----
- We'd prefer for loop here
npm t
)npm run fmt
)