Skip to content

Commit 07a8739

Browse files
oisezrgmightyaleksey
authored andcommitted
camelize double-dashes regex with tests fixed (#108)
* camelize double-dashes regex, tests fixed * tests fix
1 parent c89b4fb commit 07a8739

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/transformTokens.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ exports.transformTokens = transformTokens;
3636
* @return {string}
3737
*/
3838
function camelizeDashes(str) {
39-
return str.replace(/-(\w)/g, (m, letter) => letter.toUpperCase());
39+
return str.replace(/-+(\w)/g, (m, letter) => letter.toUpperCase());
4040
}
4141

4242
/**

test/api/camelCase.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ suite('api/camelCase', () => {
2323
test('should replace keys with dashes by its camel-cased equivalent', () => {
2424
const tokens = require('./fixture/bem.css');
2525
assert.deepEqual(tokens, {
26-
'block__element-Modifier': '_test_api_fixture_bem__block__element--modifier',
26+
'block__elementModifier': '_test_api_fixture_bem__block__element--modifier',
2727
});
2828
});
2929

test/api/generateScopedName.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ suite('api/generateScopedName', () => {
88
let args;
99
let tokens;
1010

11-
const processor = spy(function (selector, filepath, source) {
11+
const processor = spy((selector, filepath, source) => {
1212
args = [selector, filepath, source];
1313
return selector;
1414
});

test/api/hashPrefix.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const detachHook = require('../sugar').detachHook;
22
const dropCache = require('../sugar').dropCache;
33

44
suite('api/hashPrefix', () => {
5-
let samples = [];
5+
const samples = [];
66

77
suite('using string pattern and hashPrefix', () => {
88
let tokens;

0 commit comments

Comments
 (0)