diff options
Diffstat (limited to 'src/js_ast.zig')
-rw-r--r-- | src/js_ast.zig | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/js_ast.zig b/src/js_ast.zig index 9df3e36f0..4eb2450e3 100644 --- a/src/js_ast.zig +++ b/src/js_ast.zig @@ -758,6 +758,21 @@ pub const Symbol = struct { pub fn isKindFunction(kind: Symbol.Kind) bool { return kind == Symbol.Kind.hoisted_function or kind == Symbol.Kind.generator_or_async_function; } + + pub fn isReactComponentishName(symbol: *const Symbol) bool { + switch (symbol.kind) { + .hoisted, .hoisted_function, .cconst, .class, .other => { + return switch (symbol.original_name[0]) { + 'A'...'Z' => true, + else => false, + }; + }, + + else => { + return false; + }, + } + } }; pub const OptionalChain = packed enum(u2) { |