Skip to content

Commit

Permalink
fix(utilities): allow numbers in custom style names
Browse files Browse the repository at this point in the history
  • Loading branch information
samikarak committed Jan 2, 2019
1 parent a6cd723 commit 5a6600f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utilities.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var React = require('react');
var hyphenPatternRegex = /-([a-z])/g;
var CUSTOM_PROPERTY_OR_NO_HYPHEN_REGEX = /^--[a-zA-Z-]+$|^[^-]+$/;
var CUSTOM_PROPERTY_OR_NO_HYPHEN_REGEX = /^--[a-zA-Z0-9-]+$|^[^-]+$/;

/**
* Converts a string to camelCase.
Expand Down
2 changes: 2 additions & 0 deletions test/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ describe('utilties.camelCase', () => {
assert.equal(camelCase('fooBar'), 'fooBar');
assert.equal(camelCase('--fooBar'), '--fooBar');
assert.equal(camelCase('--foo-bar'), '--foo-bar');
assert.equal(camelCase('--foo100'), '--foo100');
assert.equal(camelCase('--foo-100'), '--foo-100');
});

it('camelCases a string', () => {
Expand Down

0 comments on commit 5a6600f

Please sign in to comment.