Skip to content

Commit

Permalink
Drop exports of { parseMap, parseSeq } from 'yaml/util'
Browse files Browse the repository at this point in the history
BREAKING CHANGE: With the change in the tag resolver API, these
functions are no longer useful when writing custom tags.
  • Loading branch information
eemeli committed Oct 3, 2020
1 parent 6eecd50 commit 79c8f6f
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 16 deletions.
2 changes: 0 additions & 2 deletions docs/06_custom_tags.md
Expand Up @@ -128,8 +128,6 @@ Finally, `stringify(item, ctx, ...): string` defines how your data should be rep
```js
import {
findPair, // (items, key) => Pair? -- Given a key, find a matching Pair
parseMap, // (doc, cstNode) => new YAMLMap
parseSeq, // (doc, cstNode) => new YAMLSeq
stringifyNumber, // (node) => string
stringifyString, // (node, ctx, ...) => string
toJS, // (value, arg, ctx) => any -- Recursively convert to plain JS
Expand Down
2 changes: 0 additions & 2 deletions src/util.js
@@ -1,6 +1,4 @@
export { findPair, toJS } from './ast/index.js'
export { resolveMap as parseMap } from './resolve/resolveMap.js'
export { resolveSeq as parseSeq } from './resolve/resolveSeq.js'

export { stringifyNumber } from './stringify/stringifyNumber.js'
export { stringifyString } from './stringify/stringifyString.js'
Expand Down
8 changes: 1 addition & 7 deletions util.d.ts
@@ -1,14 +1,8 @@
import { Document } from './index'
import { CST } from './parse-cst'
import { AST, Pair, Scalar, Schema } from './types'
import { Pair, Scalar, Schema } from './types'

export function findPair(items: any[], key: Scalar | any): Pair | undefined

export function parseMap(doc: Document, cst: CST.Map): AST.BlockMap
export function parseMap(doc: Document, cst: CST.FlowMap): AST.FlowMap
export function parseSeq(doc: Document, cst: CST.Seq): AST.BlockSeq
export function parseSeq(doc: Document, cst: CST.FlowSeq): AST.FlowSeq

export function stringifyNumber(item: Scalar): string
export function stringifyString(
item: Scalar,
Expand Down
2 changes: 0 additions & 2 deletions util.js
Expand Up @@ -2,8 +2,6 @@ const util = require('./dist/util')

exports.findPair = util.findPair
exports.toJSON = util.toJSON
exports.parseMap = util.parseMap
exports.parseSeq = util.parseSeq

exports.stringifyNumber = util.stringifyNumber
exports.stringifyString = util.stringifyString
Expand Down
3 changes: 0 additions & 3 deletions util.mjs
Expand Up @@ -3,9 +3,6 @@ import util from './dist/util.js'
export const findPair = util.findPair
export const toJSON = util.toJSON

export const parseMap = util.parseMap
export const parseSeq = util.parseSeq

export const stringifyNumber = util.stringifyNumber
export const stringifyString = util.stringifyString

Expand Down

0 comments on commit 79c8f6f

Please sign in to comment.