EITS-web/node_modules/eslint-plugin-svelte/lib/rules/indent-helpers/ast.js
2025-12-06 09:54:52 -05:00

17 lines
527 B
JavaScript

/**
* Check whether the given token is a whitespace.
*/
export function isWhitespace(token) {
return (token != null &&
((token.type === 'HTMLText' && !token.value.trim()) ||
(token.type === 'JSXText' && !token.value.trim())));
}
/**
* Check whether the given token is a not whitespace.
*/
export function isNotWhitespace(token) {
return (token != null &&
(token.type !== 'HTMLText' || Boolean(token.value.trim())) &&
(token.type !== 'JSXText' || Boolean(token.value.trim())));
}