support custom styles beginning with '--*'#83
support custom styles beginning with '--*'#83remarkablemark merged 1 commit intoremarkablemark:masterfrom
Conversation
|
@remarkablemark I updated the pull request like described in the previous one, would you mind merging your current changes on master branch into it ? The previous PR somehow got deleted after a rebase. I just commented there, that the regex you proposed did not work for custom styles containing dashes in between e.g '--custom-style' would get transformed into '-CustomStyle' since the regex would return false. Now I just replaced string.startsWith('--') with string.indexOf('--') === 0. |
There was a problem hiding this comment.
Do you mind updating your commit messages to use the conventional commit format?
$ git commit --amend -m 'feat(utilities): add support for custom styles beginning with "--*"'
$ git push origin master --forceIt uses the commit type to help with releasing (otherwise, the version bump wouldn't be correct). (The precommit hook checks this.)
Also, do you mind adding a test?
Tasks
- Amend commit message
- Add test
lib/utilities.js
Outdated
| // no hyphen found | ||
| if (string.indexOf('-') === -1) { | ||
| // customStyle or no hyphen found | ||
| if (string.indexOf('--') === 0 || string.indexOf('-') === -1) { |
There was a problem hiding this comment.
Your modified regex seems to work perfectly, so replaced the strict check with your regex matcher. I also added the tests and modified the commit message as preferred.
Thank you for your help !
support custom styles beginning with '--*'
See #82
Resolves #81