projen 0.71.67 → 0.71.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/.jsii +24 -6
  2. package/docs/api/API.md +2 -0
  3. package/lib/awscdk/auto-discover.js +5 -5
  4. package/lib/awscdk/awscdk-app-java.js +1 -1
  5. package/lib/awscdk/awscdk-app-py.js +1 -1
  6. package/lib/awscdk/awscdk-app-ts.js +1 -1
  7. package/lib/awscdk/awscdk-construct.js +2 -2
  8. package/lib/awscdk/awscdk-deps-java.js +1 -1
  9. package/lib/awscdk/awscdk-deps-js.js +1 -1
  10. package/lib/awscdk/awscdk-deps-py.js +1 -1
  11. package/lib/awscdk/awscdk-deps.js +1 -1
  12. package/lib/awscdk/cdk-config.js +1 -1
  13. package/lib/awscdk/cdk-tasks.js +1 -1
  14. package/lib/awscdk/integration-test.js +1 -1
  15. package/lib/awscdk/lambda-extension.js +1 -1
  16. package/lib/awscdk/lambda-function.js +2 -2
  17. package/lib/build/build-workflow.js +1 -1
  18. package/lib/cdk/auto-discover-base.js +2 -2
  19. package/lib/cdk/construct-lib.js +1 -1
  20. package/lib/cdk/integration-test-base.js +1 -1
  21. package/lib/cdk/jsii-docgen.js +1 -1
  22. package/lib/cdk/jsii-project.js +1 -1
  23. package/lib/cdk8s/auto-discover.js +2 -2
  24. package/lib/cdk8s/cdk8s-app-py.js +1 -1
  25. package/lib/cdk8s/cdk8s-app-ts.js +1 -1
  26. package/lib/cdk8s/cdk8s-construct.js +1 -1
  27. package/lib/cdk8s/cdk8s-deps-py.js +1 -1
  28. package/lib/cdk8s/cdk8s-deps.js +1 -1
  29. package/lib/cdk8s/integration-test.js +1 -1
  30. package/lib/cdktf/cdktf-construct.js +1 -1
  31. package/lib/circleci/circleci.js +1 -1
  32. package/lib/component.js +1 -1
  33. package/lib/dependencies.js +1 -1
  34. package/lib/dev-env.js +1 -1
  35. package/lib/docker-compose/docker-compose-service.js +1 -1
  36. package/lib/docker-compose/docker-compose.js +1 -1
  37. package/lib/file.js +1 -1
  38. package/lib/gitattributes.js +1 -1
  39. package/lib/github/actions-provider.js +1 -1
  40. package/lib/github/auto-approve.js +1 -1
  41. package/lib/github/auto-merge.js +1 -1
  42. package/lib/github/dependabot.js +1 -1
  43. package/lib/github/github-credentials.js +1 -1
  44. package/lib/github/github-project.js +1 -1
  45. package/lib/github/github.js +1 -1
  46. package/lib/github/mergify.js +1 -1
  47. package/lib/github/pr-template.js +1 -1
  48. package/lib/github/pull-request-lint.js +1 -1
  49. package/lib/github/stale.js +1 -1
  50. package/lib/github/task-workflow.js +1 -1
  51. package/lib/github/workflow-actions.js +1 -1
  52. package/lib/github/workflow-jobs.js +1 -1
  53. package/lib/github/workflows.js +1 -1
  54. package/lib/gitlab/configuration.js +1 -1
  55. package/lib/gitlab/gitlab-configuration.js +1 -1
  56. package/lib/gitlab/nested-configuration.js +1 -1
  57. package/lib/gitpod.js +1 -1
  58. package/lib/ignore-file.js +1 -1
  59. package/lib/ini.js +1 -1
  60. package/lib/java/java-project.js +1 -1
  61. package/lib/java/junit.js +1 -1
  62. package/lib/java/maven-compile.js +1 -1
  63. package/lib/java/maven-packaging.js +1 -1
  64. package/lib/java/maven-sample.js +1 -1
  65. package/lib/java/pom.js +1 -1
  66. package/lib/java/projenrc.js +1 -1
  67. package/lib/javascript/bundler.js +1 -1
  68. package/lib/javascript/eslint.js +1 -1
  69. package/lib/javascript/jest.js +4 -4
  70. package/lib/javascript/node-package.js +1 -1
  71. package/lib/javascript/node-project.js +1 -1
  72. package/lib/javascript/npm-config.js +1 -1
  73. package/lib/javascript/prettier.js +1 -1
  74. package/lib/javascript/projenrc.js +1 -1
  75. package/lib/javascript/typescript-config.js +2 -2
  76. package/lib/javascript/upgrade-dependencies.js +2 -2
  77. package/lib/json-patch.js +1 -1
  78. package/lib/json.js +1 -1
  79. package/lib/license.js +1 -1
  80. package/lib/logger.js +1 -1
  81. package/lib/makefile.js +1 -1
  82. package/lib/object-file.js +1 -1
  83. package/lib/project-build.js +1 -1
  84. package/lib/project.js +1 -1
  85. package/lib/projects.js +1 -1
  86. package/lib/projenrc-json.js +2 -2
  87. package/lib/projenrc.js +1 -1
  88. package/lib/python/pip.js +1 -1
  89. package/lib/python/poetry.js +2 -2
  90. package/lib/python/projenrc.js +1 -1
  91. package/lib/python/pytest-sample.js +1 -1
  92. package/lib/python/pytest.js +1 -1
  93. package/lib/python/python-project.js +1 -1
  94. package/lib/python/python-sample.js +1 -1
  95. package/lib/python/requirements-file.js +1 -1
  96. package/lib/python/setuppy.js +1 -1
  97. package/lib/python/setuptools.js +1 -1
  98. package/lib/python/venv.js +1 -1
  99. package/lib/readme.js +1 -1
  100. package/lib/release/publisher.js +1 -1
  101. package/lib/release/release-trigger.js +1 -1
  102. package/lib/release/release.js +1 -1
  103. package/lib/renovatebot.js +1 -1
  104. package/lib/run-task.js +1889 -0
  105. package/lib/sample-file.js +2 -2
  106. package/lib/semver.js +1 -1
  107. package/lib/source-code.js +1 -1
  108. package/lib/task-runtime.js +1 -1
  109. package/lib/task.js +1 -1
  110. package/lib/tasks.js +1 -1
  111. package/lib/testing.js +1 -1
  112. package/lib/textfile.js +1 -1
  113. package/lib/toml.js +1 -1
  114. package/lib/typescript/projenrc-ts.js +1 -1
  115. package/lib/typescript/projenrc.d.ts +8 -0
  116. package/lib/typescript/projenrc.js +14 -5
  117. package/lib/typescript/typescript-typedoc.js +1 -1
  118. package/lib/typescript/typescript.js +3 -3
  119. package/lib/version.js +1 -1
  120. package/lib/vscode/devcontainer.js +1 -1
  121. package/lib/vscode/extensions.js +1 -1
  122. package/lib/vscode/launch-config.js +1 -1
  123. package/lib/vscode/settings.js +1 -1
  124. package/lib/vscode/vscode.js +1 -1
  125. package/lib/web/next.js +3 -3
  126. package/lib/web/postcss.js +1 -1
  127. package/lib/web/react.js +4 -4
  128. package/lib/web/tailwind.js +1 -1
  129. package/lib/xmlfile.js +1 -1
  130. package/lib/yaml.js +1 -1
  131. package/node_modules/yaml/README.md +4 -0
  132. package/node_modules/yaml/browser/dist/compose/compose-collection.js +46 -29
  133. package/node_modules/yaml/browser/dist/compose/compose-doc.js +1 -0
  134. package/node_modules/yaml/browser/dist/compose/compose-scalar.js +1 -1
  135. package/node_modules/yaml/browser/dist/compose/composer.js +1 -1
  136. package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +3 -2
  137. package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +3 -2
  138. package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +4 -5
  139. package/node_modules/yaml/browser/dist/compose/util-map-includes.js +1 -1
  140. package/node_modules/yaml/browser/dist/doc/Document.js +12 -10
  141. package/node_modules/yaml/browser/dist/doc/anchors.js +1 -1
  142. package/node_modules/yaml/browser/dist/doc/createNode.js +6 -2
  143. package/node_modules/yaml/browser/dist/doc/directives.js +1 -1
  144. package/node_modules/yaml/browser/dist/index.js +1 -1
  145. package/node_modules/yaml/browser/dist/node_modules/tslib/tslib.es6.js +6 -149
  146. package/node_modules/yaml/browser/dist/nodes/Alias.js +9 -2
  147. package/node_modules/yaml/browser/dist/nodes/Collection.js +2 -1
  148. package/node_modules/yaml/browser/dist/nodes/Node.js +25 -35
  149. package/node_modules/yaml/browser/dist/nodes/Pair.js +1 -1
  150. package/node_modules/yaml/browser/dist/nodes/Scalar.js +2 -1
  151. package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +30 -2
  152. package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +17 -1
  153. package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +1 -1
  154. package/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
  155. package/node_modules/yaml/browser/dist/nodes/toJS.js +1 -1
  156. package/node_modules/yaml/browser/dist/schema/Schema.js +1 -1
  157. package/node_modules/yaml/browser/dist/schema/common/map.js +3 -28
  158. package/node_modules/yaml/browser/dist/schema/common/seq.js +3 -19
  159. package/node_modules/yaml/browser/dist/schema/tags.js +1 -1
  160. package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +9 -8
  161. package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +1 -1
  162. package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +14 -13
  163. package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +1 -1
  164. package/node_modules/yaml/browser/dist/stringify/stringify.js +1 -1
  165. package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +1 -1
  166. package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +1 -1
  167. package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +1 -1
  168. package/node_modules/yaml/browser/dist/stringify/stringifyString.js +10 -1
  169. package/node_modules/yaml/browser/dist/util.js +2 -0
  170. package/node_modules/yaml/browser/dist/visit.js +1 -1
  171. package/node_modules/yaml/dist/compose/compose-collection.d.ts +1 -1
  172. package/node_modules/yaml/dist/compose/compose-collection.js +47 -30
  173. package/node_modules/yaml/dist/compose/compose-doc.d.ts +2 -1
  174. package/node_modules/yaml/dist/compose/compose-doc.js +1 -0
  175. package/node_modules/yaml/dist/compose/compose-scalar.js +7 -7
  176. package/node_modules/yaml/dist/compose/composer.d.ts +5 -5
  177. package/node_modules/yaml/dist/compose/composer.js +3 -3
  178. package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +2 -1
  179. package/node_modules/yaml/dist/compose/resolve-block-map.js +3 -2
  180. package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +2 -1
  181. package/node_modules/yaml/dist/compose/resolve-block-seq.js +3 -2
  182. package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +2 -1
  183. package/node_modules/yaml/dist/compose/resolve-flow-collection.js +5 -6
  184. package/node_modules/yaml/dist/compose/util-map-includes.d.ts +3 -3
  185. package/node_modules/yaml/dist/compose/util-map-includes.js +3 -3
  186. package/node_modules/yaml/dist/doc/Document.d.ts +11 -9
  187. package/node_modules/yaml/dist/doc/Document.js +22 -20
  188. package/node_modules/yaml/dist/doc/anchors.d.ts +4 -4
  189. package/node_modules/yaml/dist/doc/anchors.js +2 -2
  190. package/node_modules/yaml/dist/doc/createNode.d.ts +1 -1
  191. package/node_modules/yaml/dist/doc/createNode.js +13 -9
  192. package/node_modules/yaml/dist/doc/directives.js +3 -3
  193. package/node_modules/yaml/dist/errors.d.ts +1 -1
  194. package/node_modules/yaml/dist/index.d.ts +2 -1
  195. package/node_modules/yaml/dist/index.js +9 -9
  196. package/node_modules/yaml/dist/nodes/Alias.d.ts +1 -1
  197. package/node_modules/yaml/dist/nodes/Alias.js +12 -5
  198. package/node_modules/yaml/dist/nodes/Collection.d.ts +3 -2
  199. package/node_modules/yaml/dist/nodes/Collection.js +10 -9
  200. package/node_modules/yaml/dist/nodes/Node.d.ts +5 -18
  201. package/node_modules/yaml/dist/nodes/Node.js +25 -51
  202. package/node_modules/yaml/dist/nodes/Pair.d.ts +2 -2
  203. package/node_modules/yaml/dist/nodes/Pair.js +4 -4
  204. package/node_modules/yaml/dist/nodes/Scalar.js +2 -1
  205. package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +7 -1
  206. package/node_modules/yaml/dist/nodes/YAMLMap.js +37 -9
  207. package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +3 -1
  208. package/node_modules/yaml/dist/nodes/YAMLSeq.js +21 -5
  209. package/node_modules/yaml/dist/nodes/addPairToJSMap.js +7 -7
  210. package/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
  211. package/node_modules/yaml/dist/nodes/identity.js +53 -0
  212. package/node_modules/yaml/dist/nodes/toJS.d.ts +2 -5
  213. package/node_modules/yaml/dist/nodes/toJS.js +2 -2
  214. package/node_modules/yaml/dist/public-api.d.ts +3 -3
  215. package/node_modules/yaml/dist/schema/Schema.d.ts +1 -1
  216. package/node_modules/yaml/dist/schema/Schema.js +4 -4
  217. package/node_modules/yaml/dist/schema/common/map.js +4 -29
  218. package/node_modules/yaml/dist/schema/common/seq.js +4 -20
  219. package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -1
  220. package/node_modules/yaml/dist/schema/json/schema.d.ts +1 -1
  221. package/node_modules/yaml/dist/schema/tags.d.ts +1 -1
  222. package/node_modules/yaml/dist/schema/types.d.ts +11 -3
  223. package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +4 -1
  224. package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +11 -10
  225. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +1 -1
  226. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +5 -5
  227. package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -1
  228. package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +3 -1
  229. package/node_modules/yaml/dist/schema/yaml-1.1/set.js +17 -16
  230. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +1 -1
  231. package/node_modules/yaml/dist/stringify/stringify.js +8 -8
  232. package/node_modules/yaml/dist/stringify/stringifyCollection.js +8 -8
  233. package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -3
  234. package/node_modules/yaml/dist/stringify/stringifyDocument.js +2 -2
  235. package/node_modules/yaml/dist/stringify/stringifyPair.js +9 -9
  236. package/node_modules/yaml/dist/stringify/stringifyString.js +10 -1
  237. package/node_modules/yaml/dist/test-events.js +8 -8
  238. package/node_modules/yaml/dist/util.d.ts +4 -1
  239. package/node_modules/yaml/dist/util.js +4 -0
  240. package/node_modules/yaml/dist/visit.js +18 -18
  241. package/node_modules/yaml/package.json +8 -6
  242. package/package.json +3 -3
  243. package/node_modules/yaml/util.d.ts +0 -3
@@ -28,6 +28,7 @@ function composeDoc(options, directives, { offset, start, value, end }, onError)
28
28
  !props.hasNewline)
29
29
  onError(props.end, 'MISSING_CHAR', 'Block collection cannot start on same line with directives-end marker');
30
30
  }
31
+ // @ts-expect-error If Contents is set, let's trust the user
31
32
  doc.contents = value
32
33
  ? composeNode.composeNode(ctx, value, props, onError)
33
34
  : composeNode.composeEmptyNode(ctx, props.end, start, null, props, onError);
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var Node = require('../nodes/Node.js');
3
+ var identity = require('../nodes/identity.js');
4
4
  var Scalar = require('../nodes/Scalar.js');
5
5
  var resolveBlockScalar = require('./resolve-block-scalar.js');
6
6
  var resolveFlowScalar = require('./resolve-flow-scalar.js');
@@ -16,11 +16,11 @@ function composeScalar(ctx, token, tagToken, onError) {
16
16
  ? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError)
17
17
  : token.type === 'scalar'
18
18
  ? findScalarTagByTest(ctx, value, token, onError)
19
- : ctx.schema[Node.SCALAR];
19
+ : ctx.schema[identity.SCALAR];
20
20
  let scalar;
21
21
  try {
22
22
  const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
23
- scalar = Node.isScalar(res) ? res : new Scalar.Scalar(res);
23
+ scalar = identity.isScalar(res) ? res : new Scalar.Scalar(res);
24
24
  }
25
25
  catch (error) {
26
26
  const msg = error instanceof Error ? error.message : String(error);
@@ -41,7 +41,7 @@ function composeScalar(ctx, token, tagToken, onError) {
41
41
  }
42
42
  function findScalarTagByName(schema, value, tagName, tagToken, onError) {
43
43
  if (tagName === '!')
44
- return schema[Node.SCALAR]; // non-specific tag
44
+ return schema[identity.SCALAR]; // non-specific tag
45
45
  const matchWithTest = [];
46
46
  for (const tag of schema.tags) {
47
47
  if (!tag.collection && tag.tag === tagName) {
@@ -62,13 +62,13 @@ function findScalarTagByName(schema, value, tagName, tagToken, onError) {
62
62
  return kt;
63
63
  }
64
64
  onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
65
- return schema[Node.SCALAR];
65
+ return schema[identity.SCALAR];
66
66
  }
67
67
  function findScalarTagByTest({ directives, schema }, value, token, onError) {
68
- const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[Node.SCALAR];
68
+ const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[identity.SCALAR];
69
69
  if (schema.compat) {
70
70
  const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
71
- schema[Node.SCALAR];
71
+ schema[identity.SCALAR];
72
72
  if (tag.tag !== compat.tag) {
73
73
  const ts = directives.tagString(tag.tag);
74
74
  const cs = directives.tagString(compat.tag);
@@ -1,7 +1,7 @@
1
1
  import { Directives } from '../doc/directives.js';
2
2
  import { Document } from '../doc/Document.js';
3
3
  import { ErrorCode, YAMLParseError, YAMLWarning } from '../errors.js';
4
- import { Range } from '../nodes/Node.js';
4
+ import type { ParsedNode, Range } from '../nodes/Node.js';
5
5
  import type { DocumentOptions, ParseOptions, SchemaOptions } from '../options.js';
6
6
  import type { Token } from '../parse/cst.js';
7
7
  type ErrorSource = number | [number, number] | Range | {
@@ -20,7 +20,7 @@ export type ComposeErrorHandler = (source: ErrorSource, code: ErrorCode, message
20
20
  * const docs = new Composer().compose(tokens)
21
21
  * ```
22
22
  */
23
- export declare class Composer {
23
+ export declare class Composer<Contents extends ParsedNode = ParsedNode, Strict extends boolean = true> {
24
24
  private directives;
25
25
  private doc;
26
26
  private options;
@@ -48,15 +48,15 @@ export declare class Composer {
48
48
  * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.
49
49
  * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.
50
50
  */
51
- compose(tokens: Iterable<Token>, forceDoc?: boolean, endOffset?: number): Generator<Document.Parsed<import("../nodes/Node.js").ParsedNode>, void, unknown>;
51
+ compose(tokens: Iterable<Token>, forceDoc?: boolean, endOffset?: number): Generator<Document.Parsed<Contents, Strict>, void, unknown>;
52
52
  /** Advance the composer by one CST token. */
53
- next(token: Token): Generator<Document.Parsed<import("../nodes/Node.js").ParsedNode>, void, unknown>;
53
+ next(token: Token): Generator<Document.Parsed<Contents, Strict>, void, unknown>;
54
54
  /**
55
55
  * Call at end of input to yield any remaining document.
56
56
  *
57
57
  * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.
58
58
  * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.
59
59
  */
60
- end(forceDoc?: boolean, endOffset?: number): Generator<Document.Parsed<import("../nodes/Node.js").ParsedNode>, void, unknown>;
60
+ end(forceDoc?: boolean, endOffset?: number): Generator<Document.Parsed<Contents, Strict>, void, unknown>;
61
61
  }
62
62
  export {};
@@ -3,7 +3,7 @@
3
3
  var directives = require('../doc/directives.js');
4
4
  var Document = require('../doc/Document.js');
5
5
  var errors = require('../errors.js');
6
- var Node = require('../nodes/Node.js');
6
+ var identity = require('../nodes/identity.js');
7
7
  var composeDoc = require('./compose-doc.js');
8
8
  var resolveEnd = require('./resolve-end.js');
9
9
 
@@ -83,9 +83,9 @@ class Composer {
83
83
  else if (afterEmptyLine || doc.directives.docStart || !dc) {
84
84
  doc.commentBefore = comment;
85
85
  }
86
- else if (Node.isCollection(dc) && !dc.flow && dc.items.length > 0) {
86
+ else if (identity.isCollection(dc) && !dc.flow && dc.items.length > 0) {
87
87
  let it = dc.items[0];
88
- if (Node.isPair(it))
88
+ if (identity.isPair(it))
89
89
  it = it.key;
90
90
  const cb = it.commentBefore;
91
91
  it.commentBefore = cb ? `${comment}\n${cb}` : comment;
@@ -1,6 +1,7 @@
1
1
  import type { ParsedNode } from '../nodes/Node.js';
2
2
  import { YAMLMap } from '../nodes/YAMLMap.js';
3
3
  import type { BlockMap } from '../parse/cst.js';
4
+ import { CollectionTag } from '../schema/types.js';
4
5
  import type { ComposeContext, ComposeNode } from './compose-node.js';
5
6
  import type { ComposeErrorHandler } from './composer.js';
6
- export declare function resolveBlockMap({ composeNode, composeEmptyNode }: ComposeNode, ctx: ComposeContext, bm: BlockMap, onError: ComposeErrorHandler): YAMLMap.Parsed<ParsedNode, ParsedNode | null>;
7
+ export declare function resolveBlockMap({ composeNode, composeEmptyNode }: ComposeNode, ctx: ComposeContext, bm: BlockMap, onError: ComposeErrorHandler, tag?: CollectionTag): YAMLMap.Parsed<ParsedNode, ParsedNode | null>;
@@ -8,8 +8,9 @@ var utilFlowIndentCheck = require('./util-flow-indent-check.js');
8
8
  var utilMapIncludes = require('./util-map-includes.js');
9
9
 
10
10
  const startColMsg = 'All mapping items must start at the same column';
11
- function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
12
- const map = new YAMLMap.YAMLMap(ctx.schema);
11
+ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag) {
12
+ const NodeClass = tag?.nodeClass ?? YAMLMap.YAMLMap;
13
+ const map = new NodeClass(ctx.schema);
13
14
  if (ctx.atRoot)
14
15
  ctx.atRoot = false;
15
16
  let offset = bm.offset;
@@ -1,5 +1,6 @@
1
1
  import { YAMLSeq } from '../nodes/YAMLSeq.js';
2
2
  import type { BlockSequence } from '../parse/cst.js';
3
+ import { CollectionTag } from '../schema/types.js';
3
4
  import type { ComposeContext, ComposeNode } from './compose-node.js';
4
5
  import type { ComposeErrorHandler } from './composer.js';
5
- export declare function resolveBlockSeq({ composeNode, composeEmptyNode }: ComposeNode, ctx: ComposeContext, bs: BlockSequence, onError: ComposeErrorHandler): YAMLSeq.Parsed<import("../index.js").ParsedNode>;
6
+ export declare function resolveBlockSeq({ composeNode, composeEmptyNode }: ComposeNode, ctx: ComposeContext, bs: BlockSequence, onError: ComposeErrorHandler, tag?: CollectionTag): YAMLSeq.Parsed<import("../index.js").ParsedNode>;
@@ -4,8 +4,9 @@ var YAMLSeq = require('../nodes/YAMLSeq.js');
4
4
  var resolveProps = require('./resolve-props.js');
5
5
  var utilFlowIndentCheck = require('./util-flow-indent-check.js');
6
6
 
7
- function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError) {
8
- const seq = new YAMLSeq.YAMLSeq(ctx.schema);
7
+ function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, tag) {
8
+ const NodeClass = tag?.nodeClass ?? YAMLSeq.YAMLSeq;
9
+ const seq = new NodeClass(ctx.schema);
9
10
  if (ctx.atRoot)
10
11
  ctx.atRoot = false;
11
12
  let offset = bs.offset;
@@ -1,6 +1,7 @@
1
1
  import { YAMLMap } from '../nodes/YAMLMap.js';
2
2
  import { YAMLSeq } from '../nodes/YAMLSeq.js';
3
3
  import type { FlowCollection } from '../parse/cst.js';
4
+ import { CollectionTag } from '../schema/types.js';
4
5
  import type { ComposeContext, ComposeNode } from './compose-node.js';
5
6
  import type { ComposeErrorHandler } from './composer.js';
6
- export declare function resolveFlowCollection({ composeNode, composeEmptyNode }: ComposeNode, ctx: ComposeContext, fc: FlowCollection, onError: ComposeErrorHandler): YAMLMap.Parsed<import("../nodes/Node.js").ParsedNode, import("../nodes/Node.js").ParsedNode | null> | YAMLSeq.Parsed<import("../nodes/Node.js").ParsedNode>;
7
+ export declare function resolveFlowCollection({ composeNode, composeEmptyNode }: ComposeNode, ctx: ComposeContext, fc: FlowCollection, onError: ComposeErrorHandler, tag?: CollectionTag): YAMLMap.Parsed<import("../index.js").ParsedNode, import("../index.js").ParsedNode | null> | YAMLSeq.Parsed<import("../index.js").ParsedNode>;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var Node = require('../nodes/Node.js');
3
+ var identity = require('../nodes/identity.js');
4
4
  var Pair = require('../nodes/Pair.js');
5
5
  var YAMLMap = require('../nodes/YAMLMap.js');
6
6
  var YAMLSeq = require('../nodes/YAMLSeq.js');
@@ -11,12 +11,11 @@ var utilMapIncludes = require('./util-map-includes.js');
11
11
 
12
12
  const blockMsg = 'Block collections are not allowed within flow collections';
13
13
  const isBlock = (token) => token && (token.type === 'block-map' || token.type === 'block-seq');
14
- function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError) {
14
+ function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag) {
15
15
  const isMap = fc.start.source === '{';
16
16
  const fcName = isMap ? 'flow map' : 'flow sequence';
17
- const coll = isMap
18
- ? new YAMLMap.YAMLMap(ctx.schema)
19
- : new YAMLSeq.YAMLSeq(ctx.schema);
17
+ const NodeClass = (tag?.nodeClass ?? (isMap ? YAMLMap.YAMLMap : YAMLSeq.YAMLSeq));
18
+ const coll = new NodeClass(ctx.schema);
20
19
  coll.flow = true;
21
20
  const atRoot = ctx.atRoot;
22
21
  if (atRoot)
@@ -75,7 +74,7 @@ function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onErr
75
74
  }
76
75
  if (prevItemComment) {
77
76
  let prev = coll.items[coll.items.length - 1];
78
- if (Node.isPair(prev))
77
+ if (identity.isPair(prev))
79
78
  prev = prev.value ?? prev.key;
80
79
  if (prev.comment)
81
80
  prev.comment += '\n' + prevItemComment;
@@ -1,4 +1,4 @@
1
- import { ParsedNode } from '../nodes/Node';
2
- import { Pair } from '../nodes/Pair';
3
- import { ComposeContext } from './compose-node';
1
+ import type { ParsedNode } from '../nodes/Node.js';
2
+ import type { Pair } from '../nodes/Pair.js';
3
+ import type { ComposeContext } from './compose-node.js';
4
4
  export declare function mapIncludes(ctx: ComposeContext, items: Pair<ParsedNode>[], search: ParsedNode): boolean;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var Node = require('../nodes/Node.js');
3
+ var identity = require('../nodes/identity.js');
4
4
 
5
5
  function mapIncludes(ctx, items, search) {
6
6
  const { uniqueKeys } = ctx.options;
@@ -9,8 +9,8 @@ function mapIncludes(ctx, items, search) {
9
9
  const isEqual = typeof uniqueKeys === 'function'
10
10
  ? uniqueKeys
11
11
  : (a, b) => a === b ||
12
- (Node.isScalar(a) &&
13
- Node.isScalar(b) &&
12
+ (identity.isScalar(a) &&
13
+ identity.isScalar(b) &&
14
14
  a.value === b.value &&
15
15
  !(a.value === '<<' && ctx.schema.merge));
16
16
  return items.some(pair => isEqual(pair.key, search));
@@ -1,6 +1,7 @@
1
1
  import type { YAMLError, YAMLWarning } from '../errors.js';
2
2
  import { Alias } from '../nodes/Alias.js';
3
- import { Node, NodeType, NODE_TYPE, ParsedNode, Range } from '../nodes/Node.js';
3
+ import { NODE_TYPE } from '../nodes/identity.js';
4
+ import type { Node, NodeType, ParsedNode, Range } from '../nodes/Node.js';
4
5
  import { Pair } from '../nodes/Pair.js';
5
6
  import type { Scalar } from '../nodes/Scalar.js';
6
7
  import type { YAMLMap } from '../nodes/YAMLMap.js';
@@ -10,20 +11,21 @@ import { Schema } from '../schema/Schema.js';
10
11
  import { Directives } from './directives.js';
11
12
  export type Replacer = any[] | ((key: any, value: any) => unknown);
12
13
  export declare namespace Document {
13
- interface Parsed<T extends ParsedNode = ParsedNode> extends Document<T> {
14
+ /** @ts-ignore The typing of directives fails in TS <= 4.2 */
15
+ interface Parsed<Contents extends ParsedNode = ParsedNode, Strict extends boolean = true> extends Document<Contents, Strict> {
14
16
  directives: Directives;
15
17
  range: Range;
16
18
  }
17
19
  }
18
- export declare class Document<T extends Node = Node> {
20
+ export declare class Document<Contents extends Node = Node, Strict extends boolean = true> {
19
21
  readonly [NODE_TYPE]: symbol;
20
22
  /** A comment before this Document */
21
23
  commentBefore: string | null;
22
24
  /** A comment immediately after this Document */
23
25
  comment: string | null;
24
26
  /** The document contents. */
25
- contents: T | null;
26
- directives?: Directives;
27
+ contents: Strict extends true ? Contents | null : Contents;
28
+ directives: Strict extends true ? Directives | undefined : Directives;
27
29
  /** Errors encountered during parsing. */
28
30
  errors: YAMLError[];
29
31
  options: Required<Omit<ParseOptions & DocumentOptions, '_directives' | 'lineCounter' | 'version'>>;
@@ -49,7 +51,7 @@ export declare class Document<T extends Node = Node> {
49
51
  *
50
52
  * Custom Node values that inherit from `Object` still refer to their original instances.
51
53
  */
52
- clone(): Document<T>;
54
+ clone(): Document<Contents, Strict>;
53
55
  /** Adds a value to the document. */
54
56
  add(value: any): void;
55
57
  /** Adds a value to the document. */
@@ -63,7 +65,7 @@ export declare class Document<T extends Node = Node> {
63
65
  * `name` will be used as a prefix for a new unique anchor.
64
66
  * If `name` is undefined, the generated anchor will use 'a' as a prefix.
65
67
  */
66
- createAlias(node: Scalar | YAMLMap | YAMLSeq, name?: string): Alias;
68
+ createAlias(node: Strict extends true ? Scalar | YAMLMap | YAMLSeq : Node, name?: string): Alias;
67
69
  /**
68
70
  * Convert any value into a `Node` using the current schema, recursively
69
71
  * turning objects into collections.
@@ -90,13 +92,13 @@ export declare class Document<T extends Node = Node> {
90
92
  * scalar values from their surrounding node; to disable set `keepScalar` to
91
93
  * `true` (collections are always returned intact).
92
94
  */
93
- get(key: unknown, keepScalar?: boolean): unknown;
95
+ get(key: unknown, keepScalar?: boolean): Strict extends true ? unknown : any;
94
96
  /**
95
97
  * Returns item at `path`, or `undefined` if not found. By default unwraps
96
98
  * scalar values from their surrounding node; to disable set `keepScalar` to
97
99
  * `true` (collections are always returned intact).
98
100
  */
99
- getIn(path: Iterable<unknown> | null, keepScalar?: boolean): unknown;
101
+ getIn(path: Iterable<unknown> | null, keepScalar?: boolean): Strict extends true ? unknown : any;
100
102
  /**
101
103
  * Checks if the document includes a value with the key `key`.
102
104
  */
@@ -2,11 +2,10 @@
2
2
 
3
3
  var Alias = require('../nodes/Alias.js');
4
4
  var Collection = require('../nodes/Collection.js');
5
- var Node = require('../nodes/Node.js');
5
+ var identity = require('../nodes/identity.js');
6
6
  var Pair = require('../nodes/Pair.js');
7
7
  var toJS = require('../nodes/toJS.js');
8
8
  var Schema = require('../schema/Schema.js');
9
- var stringify = require('../stringify/stringify.js');
10
9
  var stringifyDocument = require('../stringify/stringifyDocument.js');
11
10
  var anchors = require('./anchors.js');
12
11
  var applyReviver = require('./applyReviver.js');
@@ -23,7 +22,7 @@ class Document {
23
22
  this.errors = [];
24
23
  /** Warnings encountered during parsing. */
25
24
  this.warnings = [];
26
- Object.defineProperty(this, Node.NODE_TYPE, { value: Node.DOC });
25
+ Object.defineProperty(this, identity.NODE_TYPE, { value: identity.DOC });
27
26
  let _replacer = null;
28
27
  if (typeof replacer === 'function' || Array.isArray(replacer)) {
29
28
  _replacer = replacer;
@@ -51,11 +50,9 @@ class Document {
51
50
  else
52
51
  this.directives = new directives.Directives({ version });
53
52
  this.setSchema(version, options);
54
- if (value === undefined)
55
- this.contents = null;
56
- else {
57
- this.contents = this.createNode(value, _replacer, options);
58
- }
53
+ // @ts-expect-error We can't really know that this matches Contents.
54
+ this.contents =
55
+ value === undefined ? null : this.createNode(value, _replacer, options);
59
56
  }
60
57
  /**
61
58
  * Create a deep copy of this Document and its contents.
@@ -64,7 +61,7 @@ class Document {
64
61
  */
65
62
  clone() {
66
63
  const copy = Object.create(Document.prototype, {
67
- [Node.NODE_TYPE]: { value: Node.DOC }
64
+ [identity.NODE_TYPE]: { value: identity.DOC }
68
65
  });
69
66
  copy.commentBefore = this.commentBefore;
70
67
  copy.comment = this.comment;
@@ -74,7 +71,8 @@ class Document {
74
71
  if (this.directives)
75
72
  copy.directives = this.directives.clone();
76
73
  copy.schema = this.schema.clone();
77
- copy.contents = Node.isNode(this.contents)
74
+ // @ts-expect-error We can't really know that this matches Contents.
75
+ copy.contents = identity.isNode(this.contents)
78
76
  ? this.contents.clone(copy.schema)
79
77
  : this.contents;
80
78
  if (this.range)
@@ -140,7 +138,7 @@ class Document {
140
138
  sourceObjects
141
139
  };
142
140
  const node = createNode.createNode(value, tag, ctx);
143
- if (flow && Node.isCollection(node))
141
+ if (flow && identity.isCollection(node))
144
142
  node.flow = true;
145
143
  setAnchors();
146
144
  return node;
@@ -169,6 +167,7 @@ class Document {
169
167
  if (Collection.isEmptyPath(path)) {
170
168
  if (this.contents == null)
171
169
  return false;
170
+ // @ts-expect-error Presumed impossible if Strict extends false
172
171
  this.contents = null;
173
172
  return true;
174
173
  }
@@ -182,7 +181,7 @@ class Document {
182
181
  * `true` (collections are always returned intact).
183
182
  */
184
183
  get(key, keepScalar) {
185
- return Node.isCollection(this.contents)
184
+ return identity.isCollection(this.contents)
186
185
  ? this.contents.get(key, keepScalar)
187
186
  : undefined;
188
187
  }
@@ -193,10 +192,10 @@ class Document {
193
192
  */
194
193
  getIn(path, keepScalar) {
195
194
  if (Collection.isEmptyPath(path))
196
- return !keepScalar && Node.isScalar(this.contents)
195
+ return !keepScalar && identity.isScalar(this.contents)
197
196
  ? this.contents.value
198
197
  : this.contents;
199
- return Node.isCollection(this.contents)
198
+ return identity.isCollection(this.contents)
200
199
  ? this.contents.getIn(path, keepScalar)
201
200
  : undefined;
202
201
  }
@@ -204,7 +203,7 @@ class Document {
204
203
  * Checks if the document includes a value with the key `key`.
205
204
  */
206
205
  has(key) {
207
- return Node.isCollection(this.contents) ? this.contents.has(key) : false;
206
+ return identity.isCollection(this.contents) ? this.contents.has(key) : false;
208
207
  }
209
208
  /**
210
209
  * Checks if the document includes a value at `path`.
@@ -212,7 +211,7 @@ class Document {
212
211
  hasIn(path) {
213
212
  if (Collection.isEmptyPath(path))
214
213
  return this.contents !== undefined;
215
- return Node.isCollection(this.contents) ? this.contents.hasIn(path) : false;
214
+ return identity.isCollection(this.contents) ? this.contents.hasIn(path) : false;
216
215
  }
217
216
  /**
218
217
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -220,6 +219,7 @@ class Document {
220
219
  */
221
220
  set(key, value) {
222
221
  if (this.contents == null) {
222
+ // @ts-expect-error We can't really know that this matches Contents.
223
223
  this.contents = Collection.collectionFromPath(this.schema, [key], value);
224
224
  }
225
225
  else if (assertCollection(this.contents)) {
@@ -231,9 +231,12 @@ class Document {
231
231
  * boolean to add/remove the item from the set.
232
232
  */
233
233
  setIn(path, value) {
234
- if (Collection.isEmptyPath(path))
234
+ if (Collection.isEmptyPath(path)) {
235
+ // @ts-expect-error We can't really know that this matches Contents.
235
236
  this.contents = value;
237
+ }
236
238
  else if (this.contents == null) {
239
+ // @ts-expect-error We can't really know that this matches Contents.
237
240
  this.contents = Collection.collectionFromPath(this.schema, Array.from(path), value);
238
241
  }
239
242
  else if (assertCollection(this.contents)) {
@@ -293,8 +296,7 @@ class Document {
293
296
  keep: !json,
294
297
  mapAsMap: mapAsMap === true,
295
298
  mapKeyWarned: false,
296
- maxAliasCount: typeof maxAliasCount === 'number' ? maxAliasCount : 100,
297
- stringify: stringify.stringify
299
+ maxAliasCount: typeof maxAliasCount === 'number' ? maxAliasCount : 100
298
300
  };
299
301
  const res = toJS.toJS(this.contents, jsonArg ?? '', ctx);
300
302
  if (typeof onAnchor === 'function')
@@ -326,7 +328,7 @@ class Document {
326
328
  }
327
329
  }
328
330
  function assertCollection(contents) {
329
- if (Node.isCollection(contents))
331
+ if (identity.isCollection(contents))
330
332
  return true;
331
333
  throw new Error('Expected a YAML collection as document contents');
332
334
  }
@@ -1,4 +1,4 @@
1
- import { Node } from '../nodes/Node.js';
1
+ import type { Node } from '../nodes/Node.js';
2
2
  import type { Document } from './Document.js';
3
3
  /**
4
4
  * Verify that the input string is a valid anchor.
@@ -6,10 +6,10 @@ import type { Document } from './Document.js';
6
6
  * Will throw on errors.
7
7
  */
8
8
  export declare function anchorIsValid(anchor: string): true;
9
- export declare function anchorNames(root: Document | Node): Set<string>;
9
+ export declare function anchorNames(root: Document<Node, boolean> | Node): Set<string>;
10
10
  /** Find a new anchor name with the given `prefix` and a one-indexed suffix. */
11
11
  export declare function findNewAnchor(prefix: string, exclude: Set<string>): string;
12
- export declare function createNodeAnchors(doc: Document, prefix: string): {
12
+ export declare function createNodeAnchors(doc: Document<Node, boolean>, prefix: string): {
13
13
  onAnchor: (source: unknown) => string;
14
14
  /**
15
15
  * With circular references, the source node is only resolved after all
@@ -19,6 +19,6 @@ export declare function createNodeAnchors(doc: Document, prefix: string): {
19
19
  setAnchors: () => void;
20
20
  sourceObjects: Map<unknown, {
21
21
  anchor: string | null;
22
- node: Node<unknown> | null;
22
+ node: Node | null;
23
23
  }>;
24
24
  };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var Node = require('../nodes/Node.js');
3
+ var identity = require('../nodes/identity.js');
4
4
  var visit = require('../visit.js');
5
5
 
6
6
  /**
@@ -57,7 +57,7 @@ function createNodeAnchors(doc, prefix) {
57
57
  const ref = sourceObjects.get(source);
58
58
  if (typeof ref === 'object' &&
59
59
  ref.anchor &&
60
- (Node.isScalar(ref.node) || Node.isCollection(ref.node))) {
60
+ (identity.isScalar(ref.node) || identity.isCollection(ref.node))) {
61
61
  ref.node.anchor = ref.anchor;
62
62
  }
63
63
  else {
@@ -1,4 +1,4 @@
1
- import { Node } from '../nodes/Node.js';
1
+ import type { Node } from '../nodes/Node.js';
2
2
  import type { Schema } from '../schema/Schema.js';
3
3
  import type { CollectionTag, ScalarTag } from '../schema/types.js';
4
4
  import type { Replacer } from './Document.js';
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var Alias = require('../nodes/Alias.js');
4
- var Node = require('../nodes/Node.js');
4
+ var identity = require('../nodes/identity.js');
5
5
  var Scalar = require('../nodes/Scalar.js');
6
6
 
7
7
  const defaultTagPrefix = 'tag:yaml.org,2002:';
@@ -16,12 +16,12 @@ function findTagObject(value, tagName, tags) {
16
16
  return tags.find(t => t.identify?.(value) && !t.format);
17
17
  }
18
18
  function createNode(value, tagName, ctx) {
19
- if (Node.isDocument(value))
19
+ if (identity.isDocument(value))
20
20
  value = value.contents;
21
- if (Node.isNode(value))
21
+ if (identity.isNode(value))
22
22
  return value;
23
- if (Node.isPair(value)) {
24
- const map = ctx.schema[Node.MAP].createNode?.(ctx.schema, null, ctx);
23
+ if (identity.isPair(value)) {
24
+ const map = ctx.schema[identity.MAP].createNode?.(ctx.schema, null, ctx);
25
25
  map.items.push(value);
26
26
  return map;
27
27
  }
@@ -65,10 +65,10 @@ function createNode(value, tagName, ctx) {
65
65
  }
66
66
  tagObj =
67
67
  value instanceof Map
68
- ? schema[Node.MAP]
68
+ ? schema[identity.MAP]
69
69
  : Symbol.iterator in Object(value)
70
- ? schema[Node.SEQ]
71
- : schema[Node.MAP];
70
+ ? schema[identity.SEQ]
71
+ : schema[identity.MAP];
72
72
  }
73
73
  if (onTagObj) {
74
74
  onTagObj(tagObj);
@@ -76,9 +76,13 @@ function createNode(value, tagName, ctx) {
76
76
  }
77
77
  const node = tagObj?.createNode
78
78
  ? tagObj.createNode(ctx.schema, value, ctx)
79
- : new Scalar.Scalar(value);
79
+ : typeof tagObj?.nodeClass?.from === 'function'
80
+ ? tagObj.nodeClass.from(ctx.schema, value, ctx)
81
+ : new Scalar.Scalar(value);
80
82
  if (tagName)
81
83
  node.tag = tagName;
84
+ else if (!tagObj.default)
85
+ node.tag = tagObj.tag;
82
86
  if (ref)
83
87
  ref.node = node;
84
88
  return node;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var Node = require('../nodes/Node.js');
3
+ var identity = require('../nodes/identity.js');
4
4
  var visit = require('../visit.js');
5
5
 
6
6
  const escapeChars = {
@@ -146,10 +146,10 @@ class Directives {
146
146
  : [];
147
147
  const tagEntries = Object.entries(this.tags);
148
148
  let tagNames;
149
- if (doc && tagEntries.length > 0 && Node.isNode(doc.contents)) {
149
+ if (doc && tagEntries.length > 0 && identity.isNode(doc.contents)) {
150
150
  const tags = {};
151
151
  visit.visit(doc.contents, (_key, node) => {
152
- if (Node.isNode(node) && node.tag)
152
+ if (identity.isNode(node) && node.tag)
153
153
  tags[node.tag] = true;
154
154
  });
155
155
  tagNames = Object.keys(tags);
@@ -1,5 +1,5 @@
1
1
  import type { LineCounter } from './parse/line-counter';
2
- export type ErrorCode = 'ALIAS_PROPS' | 'BAD_ALIAS' | 'BAD_DIRECTIVE' | 'BAD_DQ_ESCAPE' | 'BAD_INDENT' | 'BAD_PROP_ORDER' | 'BAD_SCALAR_START' | 'BLOCK_AS_IMPLICIT_KEY' | 'BLOCK_IN_FLOW' | 'DUPLICATE_KEY' | 'IMPOSSIBLE' | 'KEY_OVER_1024_CHARS' | 'MISSING_CHAR' | 'MULTILINE_IMPLICIT_KEY' | 'MULTIPLE_ANCHORS' | 'MULTIPLE_DOCS' | 'MULTIPLE_TAGS' | 'TAB_AS_INDENT' | 'TAG_RESOLVE_FAILED' | 'UNEXPECTED_TOKEN';
2
+ export type ErrorCode = 'ALIAS_PROPS' | 'BAD_ALIAS' | 'BAD_DIRECTIVE' | 'BAD_DQ_ESCAPE' | 'BAD_INDENT' | 'BAD_PROP_ORDER' | 'BAD_SCALAR_START' | 'BLOCK_AS_IMPLICIT_KEY' | 'BLOCK_IN_FLOW' | 'DUPLICATE_KEY' | 'IMPOSSIBLE' | 'KEY_OVER_1024_CHARS' | 'MISSING_CHAR' | 'MULTILINE_IMPLICIT_KEY' | 'MULTIPLE_ANCHORS' | 'MULTIPLE_DOCS' | 'MULTIPLE_TAGS' | 'TAB_AS_INDENT' | 'TAG_RESOLVE_FAILED' | 'UNEXPECTED_TOKEN' | 'BAD_COLLECTION_TYPE';
3
3
  export type LinePos = {
4
4
  line: number;
5
5
  col: number;
@@ -3,7 +3,8 @@ export { Document } from './doc/Document.js';
3
3
  export { Schema } from './schema/Schema.js';
4
4
  export { ErrorCode, YAMLError, YAMLParseError, YAMLWarning } from './errors.js';
5
5
  export { Alias } from './nodes/Alias.js';
6
- export { isAlias, isCollection, isDocument, isMap, isNode, isPair, isScalar, isSeq, Node, ParsedNode, Range } from './nodes/Node.js';
6
+ export { isAlias, isCollection, isDocument, isMap, isNode, isPair, isScalar, isSeq } from './nodes/identity.js';
7
+ export { Node, ParsedNode, Range } from './nodes/Node.js';
7
8
  export { Pair } from './nodes/Pair.js';
8
9
  export { Scalar } from './nodes/Scalar.js';
9
10
  export { YAMLMap } from './nodes/YAMLMap.js';
@@ -5,7 +5,7 @@ var Document = require('./doc/Document.js');
5
5
  var Schema = require('./schema/Schema.js');
6
6
  var errors = require('./errors.js');
7
7
  var Alias = require('./nodes/Alias.js');
8
- var Node = require('./nodes/Node.js');
8
+ var identity = require('./nodes/identity.js');
9
9
  var Pair = require('./nodes/Pair.js');
10
10
  var Scalar = require('./nodes/Scalar.js');
11
11
  var YAMLMap = require('./nodes/YAMLMap.js');
@@ -26,14 +26,14 @@ exports.YAMLError = errors.YAMLError;
26
26
  exports.YAMLParseError = errors.YAMLParseError;
27
27
  exports.YAMLWarning = errors.YAMLWarning;
28
28
  exports.Alias = Alias.Alias;
29
- exports.isAlias = Node.isAlias;
30
- exports.isCollection = Node.isCollection;
31
- exports.isDocument = Node.isDocument;
32
- exports.isMap = Node.isMap;
33
- exports.isNode = Node.isNode;
34
- exports.isPair = Node.isPair;
35
- exports.isScalar = Node.isScalar;
36
- exports.isSeq = Node.isSeq;
29
+ exports.isAlias = identity.isAlias;
30
+ exports.isCollection = identity.isCollection;
31
+ exports.isDocument = identity.isDocument;
32
+ exports.isMap = identity.isMap;
33
+ exports.isNode = identity.isNode;
34
+ exports.isPair = identity.isPair;
35
+ exports.isScalar = identity.isScalar;
36
+ exports.isSeq = identity.isSeq;
37
37
  exports.Pair = Pair.Pair;
38
38
  exports.Scalar = Scalar.Scalar;
39
39
  exports.YAMLMap = YAMLMap.YAMLMap;