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

WIP: Optimize templating #56

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mainarthur
Copy link

@mainarthur mainarthur commented Jul 18, 2021

  • tests and linter show no problems (npm t)
  • tests are added/updated for bug fixes and new features
  • code is properly formatted (npm run fmt)
  • description of changes is added in CHANGELOG.md
  • update .d.ts typings

Comment on lines +7 to +8
- Refactoerd tickplate function
- Updated typings
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Refactoerd tickplate function
- Updated typings
- Refactored tickplate function

@@ -1,6 +1,6 @@
{
"name": "tickplate",
"version": "1.0.3",
"version": "1.0.4",
Copy link
Member

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",
Copy link
Member

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[]
Copy link
Member

Choose a reason for hiding this comment

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

We prefer Array<string>

Comment on lines +5 to +6
(values) =>
String.raw(strings, ...keys.map((key) => values[key] ?? ''));
Copy link
Member

Choose a reason for hiding this comment

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

@tshemsedinov tshemsedinov changed the title Refactored WIP: Optimize templating Jul 18, 2021
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