mirror of
https://github.com/samiyev/puaros.git
synced 2025-12-28 07:16:53 +05:00
refactor: update AST strategies to use centralized node type constants
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import Parser from "tree-sitter"
|
||||
import { HardcodedValue, HardcodeType } from "../../domain/value-objects/HardcodedValue"
|
||||
import { HARDCODE_TYPES } from "../../shared/constants/rules"
|
||||
import { AST_STRING_TYPES } from "../../shared/constants/ast-node-types"
|
||||
import { ALLOWED_NUMBERS } from "../constants/defaults"
|
||||
import { AstContextChecker } from "./AstContextChecker"
|
||||
|
||||
@@ -71,7 +72,9 @@ export class AstConfigObjectAnalyzer {
|
||||
}
|
||||
|
||||
if (node.type === "string") {
|
||||
const stringFragment = node.children.find((c) => c.type === "string_fragment")
|
||||
const stringFragment = node.children.find(
|
||||
(c) => c.type === AST_STRING_TYPES.STRING_FRAGMENT,
|
||||
)
|
||||
return stringFragment !== undefined && stringFragment.text.length > 3
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user