mirror of
https://gh.wpcy.net/https://github.com/djav1985/v-wordpress-plugin-updater.git
synced 2026-04-30 11:35:48 +08:00
17 lines
331 B
JavaScript
17 lines
331 B
JavaScript
import { isRoot } from './typeGuards.mjs';
|
|
|
|
/**
|
|
* @param {import('postcss').Node} node
|
|
* @returns {boolean}
|
|
*/
|
|
export default function isFirstNodeOfRoot(node) {
|
|
if (isRoot(node)) return false;
|
|
|
|
const parentNode = node.parent;
|
|
|
|
if (!parentNode) {
|
|
return false;
|
|
}
|
|
|
|
return isRoot(parentNode) && node === parentNode.first;
|
|
}
|