mirror of
https://gh.wpcy.net/https://github.com/djav1985/v-wordpress-plugin-updater.git
synced 2026-04-30 11:35:48 +08:00
28 lines
530 B
JavaScript
28 lines
530 B
JavaScript
/**
|
|
* Check whether a function is standard
|
|
*
|
|
* @param {import('postcss-value-parser').Node} node
|
|
* @returns {boolean}
|
|
*/
|
|
export default function isStandardSyntaxFunction(node) {
|
|
// Function nodes without names are things in parentheses like Sass lists
|
|
if (!node.value) {
|
|
return false;
|
|
}
|
|
|
|
if (node.value.startsWith('#{')) {
|
|
return false;
|
|
}
|
|
|
|
// CSS-in-JS interpolation
|
|
if (node.value.startsWith('${')) {
|
|
return false;
|
|
}
|
|
|
|
// CSS-in-JS syntax
|
|
if (node.value.startsWith('`')) {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|