method PatternBuilder.tsConst
PatternBuilder.tsConst(
name: string,
exported?: boolean
): RegExp

Build a TypeScript const pattern

Examples

Example 1

// Matches: export const VERSION = "1.2.3"
const pattern = PatternBuilder.tsConst('VERSION', true);

Parameters

name: string

Name of the constant

optional
exported: boolean = true

Whether the const is exported

Return Type

RegExp

Pattern for TypeScript const declaration

Usage

import { PatternBuilder } from ".";