first
This commit is contained in:
16
node_modules/postcss-pxtorem/lib/filter-prop-list.js
generated
vendored
Normal file
16
node_modules/postcss-pxtorem/lib/filter-prop-list.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
module.exports = {
|
||||
exact: list => list.filter(m => m.match(/^[^*!]+$/)),
|
||||
contain: list =>
|
||||
list.filter(m => m.match(/^\*.+\*$/)).map(m => m.substr(1, m.length - 2)),
|
||||
endWith: list => list.filter(m => m.match(/^\*[^*]+$/)).map(m => m.substr(1)),
|
||||
startWith: list =>
|
||||
list.filter(m => m.match(/^[^*!]+\*$/)).map(m => m.substr(0, m.length - 1)),
|
||||
notExact: list =>
|
||||
list.filter(m => m.match(/^![^*].*$/)).map(m => m.substr(1)),
|
||||
notContain: list =>
|
||||
list.filter(m => m.match(/^!\*.+\*$/)).map(m => m.substr(2, m.length - 3)),
|
||||
notEndWith: list =>
|
||||
list.filter(m => m.match(/^!\*[^*]+$/)).map(m => m.substr(2)),
|
||||
notStartWith: list =>
|
||||
list.filter(m => m.match(/^![^*]+\*$/)).map(m => m.substr(1, m.length - 2))
|
||||
};
|
9
node_modules/postcss-pxtorem/lib/pixel-unit-regex.js
generated
vendored
Normal file
9
node_modules/postcss-pxtorem/lib/pixel-unit-regex.js
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
// excluding regex trick: http://www.rexegg.com/regex-best-trick.html
|
||||
|
||||
// Not anything inside double quotes
|
||||
// Not anything inside single quotes
|
||||
// Not anything inside url()
|
||||
// Any digit followed by px
|
||||
// !singlequotes|!doublequotes|!url()|pixelunit
|
||||
|
||||
module.exports = /"[^"]+"|'[^']+'|url\([^)]+\)|var\([^)]+\)|(\d*\.?\d+)px/g;
|
21
node_modules/postcss-pxtorem/lib/type.js
generated
vendored
Normal file
21
node_modules/postcss-pxtorem/lib/type.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
const type = s =>
|
||||
Object.prototype.toString
|
||||
.call(s)
|
||||
.slice(8, -1)
|
||||
.toLowerCase();
|
||||
|
||||
const types = [
|
||||
"String",
|
||||
"Array",
|
||||
"Undefined",
|
||||
"Boolean",
|
||||
"Number",
|
||||
"Function",
|
||||
"Symbol",
|
||||
"Object"
|
||||
];
|
||||
|
||||
module.exports = types.reduce((acc, str) => {
|
||||
acc["is" + str] = val => type(val) === str.toLowerCase();
|
||||
return acc;
|
||||
}, {});
|
Reference in New Issue
Block a user