diff options
Diffstat (limited to 'node_modules/@csstools/utilities/dist')
| -rw-r--r-- | node_modules/@csstools/utilities/dist/index.cjs | 1 | ||||
| -rw-r--r-- | node_modules/@csstools/utilities/dist/index.d.ts | 24 | ||||
| -rw-r--r-- | node_modules/@csstools/utilities/dist/index.mjs | 1 |
3 files changed, 26 insertions, 0 deletions
diff --git a/node_modules/@csstools/utilities/dist/index.cjs b/node_modules/@csstools/utilities/dist/index.cjs new file mode 100644 index 00000000..5b60709f --- /dev/null +++ b/node_modules/@csstools/utilities/dist/index.cjs @@ -0,0 +1 @@ +"use strict";exports.hasFallback=function hasFallback(t){const e=t.parent;if(!e)return!1;const r=t.prop.toLowerCase(),s=e.index(t);for(let t=0;t<s;t++){const s=e.nodes[t];if("decl"===s.type&&s.prop.toLowerCase()===r)return!0}return!1},exports.hasSupportsAtRuleAncestor=function hasSupportsAtRuleAncestor(t,e){let r=t.parent;for(;r;)if("atrule"===r.type&&"supports"===r.name.toLowerCase()){if(e.test(r.params))return!0;r=r.parent}else r=r.parent;return!1}; diff --git a/node_modules/@csstools/utilities/dist/index.d.ts b/node_modules/@csstools/utilities/dist/index.d.ts new file mode 100644 index 00000000..f1610688 --- /dev/null +++ b/node_modules/@csstools/utilities/dist/index.d.ts @@ -0,0 +1,24 @@ +import type { Declaration } from 'postcss'; +import type { Node } from 'postcss'; + +/** + * Check if a declaration has a fallback. + * Returns true if a declaration with the same property name appears before the current declaration. + * + * @param {Declaration} node The declaration node to check + * @returns {boolean} Whether the declaration has a fallback + */ +export declare function hasFallback(node: Declaration): boolean; + +/** + * Check if a node has a `@supports` at-rule ancestor with a given regex in its params. + * + * @param {Node} node The node to check + * @param {{ test(str: string): boolean }} predicate The test to match against the `@supports` at-rule's params + * @returns {boolean} + */ +export declare function hasSupportsAtRuleAncestor(node: Node, predicate: { + test(str: string): boolean; +}): boolean; + +export { } diff --git a/node_modules/@csstools/utilities/dist/index.mjs b/node_modules/@csstools/utilities/dist/index.mjs new file mode 100644 index 00000000..282f9708 --- /dev/null +++ b/node_modules/@csstools/utilities/dist/index.mjs @@ -0,0 +1 @@ +function hasFallback(e){const t=e.parent;if(!t)return!1;const r=e.prop.toLowerCase(),o=t.index(e);for(let e=0;e<o;e++){const o=t.nodes[e];if("decl"===o.type&&o.prop.toLowerCase()===r)return!0}return!1}function hasSupportsAtRuleAncestor(e,t){let r=e.parent;for(;r;)if("atrule"===r.type&&"supports"===r.name.toLowerCase()){if(t.test(r.params))return!0;r=r.parent}else r=r.parent;return!1}export{hasFallback,hasSupportsAtRuleAncestor}; |
