Skip to content

Commit

Permalink
Add traverseNodes and parseYAML (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Dec 18, 2020
1 parent aab68ea commit 07cd973
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
export * from "./parser"
import { parseForESLint, ParseError } from "./parser"
import type * as AST from "./ast"
import { traverseNodes } from "./traverse"
import { getStaticYAMLValue } from "./utils"
import { KEYS } from "./visitor-keys"

export { AST, getStaticYAMLValue }
export { AST, ParseError }

// parser
export { parseForESLint }
// Keys
// eslint-disable-next-line @typescript-eslint/naming-convention -- ignore
export const VisitorKeys = KEYS

// tools
export { traverseNodes, getStaticYAMLValue }

/**
* Parse YAML source code
*/
export function parseYAML(code: string, _options?: any): AST.YAMLProgram {
return parseForESLint(code).ast
}

0 comments on commit 07cd973

Please sign in to comment.