Skip to content

Commit

Permalink
fix: sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
koladilip committed Oct 16, 2024
1 parent bfc8caa commit f8cff74
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class JsonTemplateEngine {
if (
/^'.*'$/.test(input) ||
/^".*"$/.test(input) ||
/^[a-zA-Z0-9_]*$/.test(input) ||
/^\w+$/.test(input) ||
input.includes('.')
) {
return `$.${input}`;
Expand Down
6 changes: 3 additions & 3 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ type PathTypeResult = {
};

export class JsonTemplateParser {
private lexer: JsonTemplateLexer;
private readonly lexer: JsonTemplateLexer;

private options?: EngineOptions;
private readonly options?: EngineOptions;

private pathTypesStack: PathTypeResult[] = [];
private readonly pathTypesStack: PathTypeResult[] = [];

// indicates currently how many loops being parsed
private loopCount = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/reverse_translator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { BINDINGS_PARAM_KEY, DATA_PARAM_KEY, EMPTY_EXPR, INDENTATION_SPACES } fr
import { escapeStr } from './utils';

export class JsonTemplateReverseTranslator {
private options?: EngineOptions;
private readonly options?: EngineOptions;

private level = 0;

Expand Down

0 comments on commit f8cff74

Please sign in to comment.