Skip to content

Commit

Permalink
Odd bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Ser-Gen committed Apr 13, 2015
1 parent 889bd50 commit 4719ad4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = function (opts) {
// удаляем свойства и правила без данных
css.eachRule(function (rule, i) {
rule.eachDecl(function (decl, j) {
if (!(dataRegexp.test(decl.value))) {
if (!decl.value.match(dataRegexp)) {
decl.removeSelf();
};
if (rule.nodes.length === 0) {
Expand All @@ -39,7 +39,7 @@ module.exports = function (opts) {
});
});
css.eachAtRule(function (atRule) {
if (atRule.nodes.length === 0) {
if (atRule.nodes && atRule.nodes.length === 0) {
atRule.removeSelf();
};
});
Expand Down Expand Up @@ -90,7 +90,7 @@ module.exports = function (opts) {

// после слияния правил могут остаться пустые медиавыражения
css.eachAtRule(function (atRule) {
if (atRule.nodes.length === 0) {
if (atRule.nodes && atRule.nodes.length === 0) {
atRule.removeSelf();
};
});
Expand Down Expand Up @@ -124,7 +124,7 @@ module.exports = function (opts) {
function removeData () {
css.eachRule(function (rule, i) {
rule.eachDecl(function (decl, j) {
if (dataRegexp.test(decl.value)) {
if (decl.value.match(dataRegexp)) {
decl.removeSelf();
};
if (rule.nodes.length === 0) {
Expand All @@ -136,7 +136,7 @@ module.exports = function (opts) {
if (atRule.name === 'font-face') {
atRule.eachDecl(function (decl, j) {
if (decl.prop === 'src') {
if (dataRegexp.test(decl.value)) {
if (decl.value.match(dataRegexp)) {
atRule.removeSelf();
};
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postcss-data-packer",
"version": "1.0.5",
"version": "1.0.6",
"description": "PostCSS plugin to move an embedded data into a separate file",
"keywords": [
"css",
Expand Down

0 comments on commit 4719ad4

Please sign in to comment.