| 821 | * start with `<`, script-based files don't. |
| 822 | */ |
| 823 | export function isBareScriptCfml(source: string): boolean { |
| 824 | let i = 0; |
| 825 | const len = source.length; |
| 826 | while (i < len) { |
| 827 | const ch = source[i]; |
| 828 | if (ch === ' ' || ch === '\t' || ch === '\n' || ch === '\r' || ch === '\uFEFF') { |
| 829 | i++; |
| 830 | } else if (ch === '/' && source[i + 1] === '/') { |
| 831 | const nl = source.indexOf('\n', i); |
| 832 | i = nl === -1 ? len : nl + 1; |
| 833 | } else if (ch === '/' && source[i + 1] === '*') { |
| 834 | const end = source.indexOf('*/', i + 2); |
| 835 | i = end === -1 ? len : end + 2; |
| 836 | } else { |
| 837 | return ch !== '<'; |
| 838 | } |
| 839 | } |
| 840 | return true; // empty/whitespace-only file — treat as script (no-op extraction either way) |
| 841 | } |