From dd10db91809b28ad655d68606953637b939bf66f Mon Sep 17 00:00:00 2001 From: Eugene ONeill Date: Wed, 3 Aug 2016 15:46:19 -0700 Subject: [PATCH] feat(normalize-word): expose normalize word private method --- eyeglass-exports.js | 6 ++++++ test/fixtures/util.css | 3 +++ test/fixtures/util.scss | 11 +++++++++++ 3 files changed, 20 insertions(+) diff --git a/eyeglass-exports.js b/eyeglass-exports.js index 1e604ed..da2694e 100644 --- a/eyeglass-exports.js +++ b/eyeglass-exports.js @@ -174,6 +174,12 @@ module.exports = function(eyeglass, sass) { else { done(toSass(result)); } + }, + + "normalize-word($word)": function($word, done) { + var word = toJS($word); + var normalizedWord = util.normalizeWord(word); + done(toSass(normalizedWord)); } }) }; diff --git a/test/fixtures/util.css b/test/fixtures/util.css index 188c62b..a1c8743 100644 --- a/test/fixtures/util.css +++ b/test/fixtures/util.css @@ -33,3 +33,6 @@ /* [PASS] -restyle--normalize-property-js(test-foo): test-foo */ /* [PASS] -restyle--normalize-property(test): test */ /* [PASS] -restyle--normalize-property-js(test): test */ } + +.normalize-word { + /* [PASS] -restyle--normalize-word-js(yellow): yellow */ } diff --git a/test/fixtures/util.scss b/test/fixtures/util.scss index 79fdb3c..9797c53 100644 --- a/test/fixtures/util.scss +++ b/test/fixtures/util.scss @@ -51,3 +51,14 @@ /* [#{if($actual == $expected, PASS, FAIL)}] -restyle--normalize-property-js(#{$test}): #{$actual} */ } } + +.normalize-word { + $tests: ( + yellow: 'yellow' + ); + + @each $test, $expected in $tests { + $actual: -restyle--normalize-word-js($test); + /* [#{if($actual == $expected, PASS, FAIL)}] -restyle--normalize-word-js(#{$test}): #{$actual} */ + } +}