From ac4e1d5703968cf640bf1c800f7c396a225e99f1 Mon Sep 17 00:00:00 2001 From: Eric Bower Date: Mon, 15 Aug 2016 09:57:13 -0400 Subject: [PATCH] remove `replaceAnimations` from noscope option, exports csjs instead of csjs() --- index.js | 2 +- lib/csjs.js | 8 +------- lib/extract-exports.js | 5 ++--- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/index.js b/index.js index 82c1eed..bb5fe54 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,6 @@ var csjs = require('./csjs'); module.exports = csjs(); -module.exports.csjs = csjs(); +module.exports.csjs = csjs; module.exports.noScope = csjs({ noscope: true }); module.exports.getCss = require('./get-css'); diff --git a/lib/csjs.js b/lib/csjs.js index d8bbd91..59d3b5d 100644 --- a/lib/csjs.js +++ b/lib/csjs.js @@ -22,13 +22,7 @@ module.exports = function csjsTemplate(opts) { var css = joiner(strings, values.map(selectorize)); var ignores = ignoreComposition(values); - var scope; - if (noscope) { - scope = extractExports(css); - } else { - scope = scopify(css, ignores); - } - + var scope = noscope ? extractExports(css) : scopify(css, ignores); var extracted = extractExtends(scope.css); var localClasses = without(scope.classes, ignores); var localKeyframes = without(scope.keyframes, ignores); diff --git a/lib/extract-exports.js b/lib/extract-exports.js index 09a4865..b0de096 100644 --- a/lib/extract-exports.js +++ b/lib/extract-exports.js @@ -1,6 +1,5 @@ 'use strict'; -var replaceAnimations = require('./replace-animations'); var regex = require('./regex'); var classRegex = regex.classRegex; var keyframesRegex = regex.keyframesRegex; @@ -8,11 +7,11 @@ var keyframesRegex = regex.keyframesRegex; module.exports = extractExports; function extractExports(css) { - return replaceAnimations({ + return { css: css, keyframes: getExport(css, keyframesRegex), classes: getExport(css, classRegex) - }); + }; } function getExport(css, regex) {