Skip to content

Commit

Permalink
feat: Expose tags & types required by custom composers
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli committed Nov 1, 2021
1 parent daaa5b4 commit e1548a2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions docs/06_custom_tags.md
Expand Up @@ -137,6 +137,9 @@ import {
debug, // (logLevel, ...messages) => void -- Log debug messages to console
findPair, // (items, key) => Pair? -- Given a key, find a matching Pair
foldFlowLines, // (text, indent, mode, options) => string -- Fold long lines
mapTag, // CollectionTag
seqTag, // CollectionTag
stringTag, // ScalarTag
stringifyNumber, // (node) => string
stringifyString, // (node, ctx, ...) => string
toJS, // (value, arg, ctx) => any -- Recursively convert to plain JS
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -14,6 +14,7 @@
"files": [
"browser/",
"dist/",
"util.d.ts",
"util.js"
],
"type": "commonjs",
Expand Down
5 changes: 3 additions & 2 deletions src/index.ts
Expand Up @@ -3,7 +3,7 @@ export { Composer } from './compose/composer.js'
export { Document } from './doc/Document.js'
export { Schema } from './schema/Schema.js'

export { YAMLError, YAMLParseError, YAMLWarning } from './errors.js'
export { ErrorCode, YAMLError, YAMLParseError, YAMLWarning } from './errors.js'

export { Alias } from './nodes/Alias.js'
export {
Expand All @@ -16,7 +16,8 @@ export {
isScalar,
isSeq,
Node,
ParsedNode
ParsedNode,
Range
} from './nodes/Node.js'
export { Pair } from './nodes/Pair.js'
export { Scalar } from './nodes/Scalar.js'
Expand Down
3 changes: 3 additions & 0 deletions src/util.ts
@@ -1,6 +1,9 @@
export { debug, LogLevelId, warn } from './log.js'
export { findPair } from './nodes/YAMLMap.js'
export { toJS, ToJSContext } from './nodes/toJS.js'
export { map as mapTag } from './schema/common/map.js'
export { seq as seqTag } from './schema/common/seq.js'
export { string as stringTag } from './schema/common/string.js'
export { foldFlowLines } from './stringify/foldFlowLines'
export { stringifyNumber } from './stringify/stringifyNumber.js'
export { stringifyString } from './stringify/stringifyString.js'
3 changes: 3 additions & 0 deletions util.d.ts
@@ -0,0 +1,3 @@
// Workaround for incomplete exports support in TypeScript
// https://github.com/microsoft/TypeScript/issues/33079
export * from './dist/util.js'

0 comments on commit e1548a2

Please sign in to comment.