forked from cuth/postcss-pxtorem
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change matching characters to just use asterix and bang
- Loading branch information
Jonathan Cuthbert
authored and
Jonathan Cuthbert
committed
Jan 15, 2017
1 parent
aa52ad5
commit 2af4ec6
Showing
5 changed files
with
72 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,56 @@ | ||
module.exports = { | ||
exact: function (list) { | ||
return list.filter(function (m) { | ||
return m.match(/^[^\*\~\^\$\!]+/); | ||
return m.match(/^[^\*\!]+$/); | ||
}); | ||
}, | ||
contain: function (list) { | ||
return list.filter(function (m) { | ||
return m.indexOf('~') === 0; | ||
}).map(trimFirstCharacter); | ||
return m.match(/^\*.+\*$/); | ||
}).map(function (m) { | ||
return m.substr(1, m.length - 2); | ||
}); | ||
}, | ||
start: function (list) { | ||
endWith: function (list) { | ||
return list.filter(function (m) { | ||
return m.indexOf('^') === 0; | ||
}).map(trimFirstCharacter); | ||
return m.match(/^\*[^\*]+$/); | ||
}).map(function (m) { | ||
return m.substr(1); | ||
}); | ||
}, | ||
end: function (list) { | ||
startWith: function (list) { | ||
return list.filter(function (m) { | ||
return m.indexOf('$') === 0; | ||
}).map(trimFirstCharacter); | ||
return m.match(/^[^\*\!]+\*$/); | ||
}).map(function (m) { | ||
return m.substr(0, m.length - 1); | ||
}); | ||
}, | ||
not: function (list) { | ||
notExact: function (list) { | ||
return list.filter(function (m) { | ||
return m.match(/^\![^\~\^\$]+/); | ||
}).map(trimFirstCharacter); | ||
return m.match(/^\![^\*].*$/); | ||
}).map(function (m) { | ||
return m.substr(1); | ||
}); | ||
}, | ||
notContain: function (list) { | ||
return list.filter(function (m) { | ||
return m.indexOf('!~') === 0; | ||
}).map(trimFirstTwoCharacters); | ||
return m.match(/^\!\*.+\*$/); | ||
}).map(function (m) { | ||
return m.substr(2, m.length - 3); | ||
}); | ||
}, | ||
notStart: function (list) { | ||
notEndWith: function (list) { | ||
return list.filter(function (m) { | ||
return m.indexOf('!^') === 0; | ||
}).map(trimFirstTwoCharacters); | ||
return m.match(/^\!\*[^\*]+$/); | ||
}).map(function (m) { | ||
return m.substr(2); | ||
}); | ||
}, | ||
notEnd: function (list) { | ||
notStartWith: function (list) { | ||
return list.filter(function (m) { | ||
return m.indexOf('!$') === 0; | ||
}).map(trimFirstTwoCharacters); | ||
return m.match(/^\![^\*]+\*$/); | ||
}).map(function (m) { | ||
return m.substr(1, m.length - 2); | ||
}); | ||
} | ||
}; | ||
|
||
function trimFirstCharacter(str) { | ||
return str.substring(1); | ||
} | ||
|
||
function trimFirstTwoCharacters(str) { | ||
return str.substring(2); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters