mirror of
https://github.com/Ku6epXBOCTuK/easy-png-tools.git
synced 2026-09-14 21:46:35 +00:00
16 lines
472 B
JavaScript
16 lines
472 B
JavaScript
// Shared helpers for the conventions plugin (web/eslint-plugins/conventions).
|
|
|
|
/**
|
|
* True when the node sits somewhere under a Svelte <script> block
|
|
* (SvelteScriptElement). Used to limit $props() checks to script code.
|
|
* @param {any} node
|
|
*/
|
|
export function isInsideScriptElement(node) {
|
|
let cursor = node.parent;
|
|
while (cursor && cursor.type !== "Program") {
|
|
if (cursor.type === "SvelteScriptElement") return true;
|
|
cursor = cursor.parent;
|
|
}
|
|
return false;
|
|
}
|