@kubb/agent 4.27.2 → 4.28.0
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.
- package/.output/nitro.json +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +330 -194
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +10 -5
- package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
- package/.output/server/index.mjs +11 -6
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/anymatch/index.js +104 -0
- package/.output/server/node_modules/anymatch/package.json +48 -0
- package/.output/server/node_modules/chokidar/handler.js +632 -0
- package/.output/server/node_modules/chokidar/index.js +822 -0
- package/.output/server/node_modules/chokidar/package.json +63 -0
- package/.output/server/node_modules/normalize-path/index.js +35 -0
- package/.output/server/node_modules/normalize-path/package.json +77 -0
- package/.output/server/node_modules/picomatch/index.js +1 -15
- package/.output/server/node_modules/picomatch/lib/constants.js +5 -6
- package/.output/server/node_modules/picomatch/lib/parse.js +9 -3
- package/.output/server/node_modules/picomatch/lib/picomatch.js +4 -3
- package/.output/server/node_modules/picomatch/lib/utils.js +16 -24
- package/.output/server/node_modules/picomatch/package.json +5 -7
- package/.output/server/node_modules/readdirp/index.js +272 -0
- package/.output/server/node_modules/readdirp/package.json +66 -0
- package/.output/server/package.json +6 -10
- package/LICENSE +21 -0
- package/README.md +98 -42
- package/package.json +17 -24
- package/.output/server/node_modules/@redocly/ajv/dist/2020.js +0 -55
- package/.output/server/node_modules/@redocly/ajv/dist/ajv.js +0 -50
- package/.output/server/node_modules/@redocly/ajv/dist/compile/codegen/code.js +0 -156
- package/.output/server/node_modules/@redocly/ajv/dist/compile/codegen/index.js +0 -697
- package/.output/server/node_modules/@redocly/ajv/dist/compile/codegen/scope.js +0 -143
- package/.output/server/node_modules/@redocly/ajv/dist/compile/errors.js +0 -123
- package/.output/server/node_modules/@redocly/ajv/dist/compile/index.js +0 -249
- package/.output/server/node_modules/@redocly/ajv/dist/compile/names.js +0 -29
- package/.output/server/node_modules/@redocly/ajv/dist/compile/ref_error.js +0 -12
- package/.output/server/node_modules/@redocly/ajv/dist/compile/resolve.js +0 -155
- package/.output/server/node_modules/@redocly/ajv/dist/compile/rules.js +0 -26
- package/.output/server/node_modules/@redocly/ajv/dist/compile/util.js +0 -178
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/applicability.js +0 -19
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/boolSchema.js +0 -50
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/dataType.js +0 -203
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/defaults.js +0 -35
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/index.js +0 -534
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/keyword.js +0 -124
- package/.output/server/node_modules/@redocly/ajv/dist/compile/validate/subschema.js +0 -81
- package/.output/server/node_modules/@redocly/ajv/dist/core.js +0 -632
- package/.output/server/node_modules/@redocly/ajv/dist/draft4.js +0 -56
- package/.output/server/node_modules/@redocly/ajv/dist/refs/data.json +0 -13
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/index.js +0 -30
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/applicator.json +0 -48
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/content.json +0 -17
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/core.json +0 -51
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.json +0 -14
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/meta-data.json +0 -37
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.json +0 -15
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/meta/validation.json +0 -90
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-2020-12/schema.json +0 -55
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-draft-04.json +0 -138
- package/.output/server/node_modules/@redocly/ajv/dist/refs/json-schema-draft-07.json +0 -151
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/equal.js +0 -7
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/ucs2length.js +0 -24
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/uri.js +0 -6
- package/.output/server/node_modules/@redocly/ajv/dist/runtime/validation_error.js +0 -11
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/additionalItems.js +0 -49
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/additionalProperties.js +0 -107
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/allOf.js +0 -23
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/anyOf.js +0 -12
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/contains.js +0 -95
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/dependencies.js +0 -85
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/dependentSchemas.js +0 -11
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/if.js +0 -66
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/index.js +0 -44
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/items.js +0 -52
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/items2020.js +0 -30
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/not.js +0 -26
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/oneOf.js +0 -60
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/patternProperties.js +0 -75
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/prefixItems.js +0 -12
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/properties.js +0 -55
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/propertyNames.js +0 -38
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/applicator/thenElse.js +0 -13
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/code.js +0 -138
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/core/id.js +0 -10
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/core/index.js +0 -16
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/core/ref.js +0 -132
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/discriminator/index.js +0 -139
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/discriminator/types.js +0 -9
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/draft2020.js +0 -23
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/draft4.js +0 -29
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/draft7.js +0 -17
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +0 -30
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/dynamicRef.js +0 -51
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/index.js +0 -9
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +0 -16
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/dynamic/recursiveRef.js +0 -10
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/format/format.js +0 -92
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/format/index.js +0 -6
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/metadata.js +0 -26
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/next.js +0 -8
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/oasContext.js +0 -26
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/index.js +0 -7
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +0 -40
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +0 -84
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/const.js +0 -25
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/dependentRequired.js +0 -12
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/draft04/limitNumber.js +0 -43
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/draft04/limitNumberExclusive.js +0 -19
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/enum.js +0 -48
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/index.js +0 -37
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitContains.js +0 -15
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitItems.js +0 -24
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitLength.js +0 -27
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitNumber.js +0 -27
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/limitProperties.js +0 -24
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/multipleOf.js +0 -26
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/pattern.js +0 -24
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/readOnly.js +0 -20
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/required.js +0 -86
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/uniqueItems.js +0 -64
- package/.output/server/node_modules/@redocly/ajv/dist/vocabularies/validation/writeOnly.js +0 -20
- package/.output/server/node_modules/@redocly/ajv/package.json +0 -130
- package/.output/server/node_modules/@redocly/config/lib/common.js +0 -90
- package/.output/server/node_modules/@redocly/config/lib/constants.js +0 -73
- package/.output/server/node_modules/@redocly/config/lib/default-theme-config-schema.js +0 -54
- package/.output/server/node_modules/@redocly/config/lib/entities-catalog-config-schema.js +0 -186
- package/.output/server/node_modules/@redocly/config/lib/entities-catalog-entity-file-schema.js +0 -283
- package/.output/server/node_modules/@redocly/config/lib/ex-theme-config-schemas.js +0 -661
- package/.output/server/node_modules/@redocly/config/lib/feedback-config-schema.js +0 -88
- package/.output/server/node_modules/@redocly/config/lib/graphql-config-schema.js +0 -157
- package/.output/server/node_modules/@redocly/config/lib/index.js +0 -38
- package/.output/server/node_modules/@redocly/config/lib/product-override-schema.js +0 -43
- package/.output/server/node_modules/@redocly/config/lib/redoc-config-schema.js +0 -120
- package/.output/server/node_modules/@redocly/config/lib/reference-docs-config-schema.js +0 -518
- package/.output/server/node_modules/@redocly/config/lib/remove-property-recursively.js +0 -25
- package/.output/server/node_modules/@redocly/config/lib/reunite-config-schema.js +0 -103
- package/.output/server/node_modules/@redocly/config/lib/root-config-schema.js +0 -551
- package/.output/server/node_modules/@redocly/config/lib/scorecards-config-schema.js +0 -244
- package/.output/server/node_modules/@redocly/config/lib/types/api-functions-types.js +0 -3
- package/.output/server/node_modules/@redocly/config/lib/types/catalog-entity-types.js +0 -3
- package/.output/server/node_modules/@redocly/config/lib/types/code-walkthrough-types.js +0 -3
- package/.output/server/node_modules/@redocly/config/lib/types/config-types.js +0 -3
- package/.output/server/node_modules/@redocly/config/lib/types/index.js +0 -21
- package/.output/server/node_modules/@redocly/config/lib/types/portal-shared-types.js +0 -18
- package/.output/server/node_modules/@redocly/config/package.json +0 -28
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-document.js +0 -85
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle-visitor.js +0 -257
- package/.output/server/node_modules/@redocly/openapi-core/lib/bundle/bundle.js +0 -74
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/all.js +0 -310
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/builtIn.js +0 -58
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/bundle-extends.js +0 -27
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/config-resolvers.js +0 -335
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/config.js +0 -338
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/constants.js +0 -13
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/get-resolve-config.js +0 -9
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/group-assertion-rules.js +0 -51
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/index.js +0 -8
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/load.js +0 -98
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/minimal.js +0 -289
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/recommended-strict.js +0 -289
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/recommended.js +0 -289
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/rules.js +0 -35
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/spec.js +0 -289
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/types.js +0 -2
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/utils.js +0 -129
- package/.output/server/node_modules/@redocly/openapi-core/lib/config/visitors.js +0 -88
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/arazzo/index.js +0 -2
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/async2/index.js +0 -2
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/async3/index.js +0 -2
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-helper.js +0 -65
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-in.js +0 -14
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-out.js +0 -14
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/info-description-override.js +0 -21
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/info-override.js +0 -14
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/media-type-examples-override.js +0 -58
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/operation-description-override.js +0 -27
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/remove-x-internal.js +0 -68
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/tag-description-override.js +0 -23
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/index.js +0 -19
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/remove-unused-components.js +0 -88
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/index.js +0 -21
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/remove-unused-components.js +0 -116
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/openrpc/index.js +0 -2
- package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/overlay1/index.js +0 -2
- package/.output/server/node_modules/@redocly/openapi-core/lib/detect-spec.js +0 -79
- package/.output/server/node_modules/@redocly/openapi-core/lib/env.js +0 -5
- package/.output/server/node_modules/@redocly/openapi-core/lib/errors/yaml-parse-error.js +0 -14
- package/.output/server/node_modules/@redocly/openapi-core/lib/format/codeframes.js +0 -177
- package/.output/server/node_modules/@redocly/openapi-core/lib/format/format.js +0 -365
- package/.output/server/node_modules/@redocly/openapi-core/lib/index.js +0 -49
- package/.output/server/node_modules/@redocly/openapi-core/lib/js-yaml/index.js +0 -11
- package/.output/server/node_modules/@redocly/openapi-core/lib/lint-entity.js +0 -171
- package/.output/server/node_modules/@redocly/openapi-core/lib/lint.js +0 -123
- package/.output/server/node_modules/@redocly/openapi-core/lib/logger.js +0 -56
- package/.output/server/node_modules/@redocly/openapi-core/lib/oas-types.js +0 -35
- package/.output/server/node_modules/@redocly/openapi-core/lib/ref-utils.js +0 -106
- package/.output/server/node_modules/@redocly/openapi-core/lib/resolve.js +0 -326
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/ajv.js +0 -106
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/criteria-unique.js +0 -68
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/index.js +0 -52
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/outputs-defined.js +0 -139
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/parameters-unique.js +0 -27
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/requestBody-replacements-unique.js +0 -30
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/sourceDescription-type.js +0 -19
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/sourceDescriptions-name-unique.js +0 -21
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/sourceDescriptions-not-empty.js +0 -15
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/step-onFailure-unique.js +0 -27
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/step-onSuccess-unique.js +0 -27
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/stepId-unique.js +0 -23
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/workflow-dependsOn.js +0 -53
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/arazzo/workflowId-unique.js +0 -19
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/channels-kebab-case.js +0 -16
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/index.js +0 -32
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async2/no-channel-trailing-slash.js +0 -13
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/channels-kebab-case.js +0 -16
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/index.js +0 -32
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/async3/no-channel-trailing-slash.js +0 -13
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/catalog-entity/entity-key-valid.js +0 -39
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/assertions/asserts.js +0 -269
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/assertions/index.js +0 -22
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/assertions/utils.js +0 -215
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/info-contact.js +0 -14
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/info-license-strict.js +0 -23
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/info-license.js +0 -14
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-ambiguous-paths.js +0 -42
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-duplicated-tag-names.js +0 -21
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-enum-type-mismatch.js +0 -38
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-http-verbs-in-paths.js +0 -31
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-identical-paths.js +0 -21
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-invalid-parameter-examples.js +0 -32
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-invalid-schema-examples.js +0 -34
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-path-trailing-slash.js +0 -13
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-required-schema-properties-undefined.js +0 -78
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-schema-type-mismatch.js +0 -19
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/no-unresolved-refs.js +0 -42
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-2xx-response.js +0 -20
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-4xx-response.js +0 -20
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-description.js +0 -9
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-operationId-unique.js +0 -17
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-operationId-url-safe.js +0 -15
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-operationId.js +0 -13
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-parameters-unique.js +0 -37
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-singular-tag.js +0 -13
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-summary.js +0 -9
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/operation-tag-defined.js +0 -27
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/parameter-description.js +0 -19
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-declaration-must-exist.js +0 -13
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-http-verbs-order.js +0 -23
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-not-include-query.js +0 -15
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-params-defined.js +0 -125
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/path-segment-plural.js +0 -30
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/paths-kebab-case.js +0 -17
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/required-string-property-missing-min-length.js +0 -34
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/response-contains-header.js +0 -26
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/scalar-property-missing-example.js +0 -39
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/security-defined.js +0 -62
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/spec-strict-refs.js +0 -27
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/struct.js +0 -150
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/tag-description.js +0 -9
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/common/tags-alphabetical.js +0 -18
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/boolean-parameter-prefixes.js +0 -19
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/index.js +0 -93
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/request-mime-type.js +0 -14
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/response-contains-property.js +0 -34
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas2/response-mime-type.js +0 -14
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/array-parameter-serialization.js +0 -26
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/boolean-parameter-prefixes.js +0 -21
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/component-name-unique.js +0 -130
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/index.js +0 -129
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-empty-servers.js +0 -20
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-example-value-and-externalValue.js +0 -13
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-invalid-media-type-examples.js +0 -59
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-server-example.com.js +0 -15
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-server-trailing-slash.js +0 -15
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-server-variables-empty-enum.js +0 -58
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-undefined-server-variable.js +0 -28
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/no-unused-components.js +0 -83
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/nullable-type-sibling.js +0 -15
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/operation-4xx-problem-details-rfc7807.js +0 -33
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/request-mime-type.js +0 -28
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/response-contains-property.js +0 -36
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/response-mime-type.js +0 -28
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-components-invalid-map-name.js +0 -59
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-discriminator-defaultMapping.js +0 -32
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-example-values.js +0 -31
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-no-invalid-encoding-combinations.js +0 -16
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-no-invalid-tag-parents.js +0 -38
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/oas3/spec-querystring-parameters.js +0 -65
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/index.js +0 -20
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/no-unused-components.js +0 -82
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/spec-no-duplicated-method-params.js +0 -28
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/openrpc/spec-no-required-params-after-optional.js +0 -31
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/other/stats.js +0 -74
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/overlay1/index.js +0 -12
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/no-criteria-xpath.js +0 -20
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/no-x-security-both-scheme-and-scheme-name.js +0 -30
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/no-x-security-scheme-name-without-openapi.js +0 -25
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/respect-supported-versions.js +0 -18
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/x-security-scheme-name-reference.js +0 -35
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/respect/x-security-scheme-required-values.js +0 -60
- package/.output/server/node_modules/@redocly/openapi-core/lib/rules/utils.js +0 -172
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/arazzo.js +0 -482
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/asyncapi2.js +0 -1157
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/asyncapi3.js +0 -511
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/entity.js +0 -32
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/index.js +0 -90
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/json-schema-adapter.js +0 -174
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/json-schema-draft7.shared.js +0 -101
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas2.js +0 -454
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas3.js +0 -828
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas3_1.js +0 -292
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/oas3_2.js +0 -306
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/openrpc.js +0 -360
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/overlay.js +0 -61
- package/.output/server/node_modules/@redocly/openapi-core/lib/types/redocly-yaml.js +0 -555
- package/.output/server/node_modules/@redocly/openapi-core/lib/typings/arazzo.js +0 -3
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/assign-config.js +0 -28
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/dequal.js +0 -36
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/does-yaml-file-exist.js +0 -7
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/error.js +0 -3
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/get-intersection-length.js +0 -11
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/get-matching-status-code-range.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/get-own.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/identity.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-custom-rule-id.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-defined.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-empty-array.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-empty-object.js +0 -5
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-not-empty-array.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-not-empty-object.js +0 -6
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-not-string.js +0 -5
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-ordered.js +0 -27
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-path-parameter.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-plain-object.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-string.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/is-truthy.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/keys-of.js +0 -6
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/make-ref-id.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/next-tick.js +0 -6
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/oas-has-component.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/omit.js +0 -8
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/pause.js +0 -4
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/pluralize.js +0 -8
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/read-file-from-url.js +0 -26
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/regex-from-string.js +0 -5
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/scorecards.js +0 -99
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/slash.js +0 -11
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/split-camel-case-into-words.js +0 -13
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/stack.js +0 -7
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/validate-mime-type.js +0 -31
- package/.output/server/node_modules/@redocly/openapi-core/lib/utils/yaml-fs-helper.js +0 -23
- package/.output/server/node_modules/@redocly/openapi-core/lib/visitors.js +0 -177
- package/.output/server/node_modules/@redocly/openapi-core/lib/walk.js +0 -303
- package/.output/server/node_modules/@redocly/openapi-core/package.json +0 -74
- package/.output/server/node_modules/ajv-formats/dist/formats.js +0 -208
- package/.output/server/node_modules/ajv-formats/dist/index.js +0 -37
- package/.output/server/node_modules/ajv-formats/dist/limit.js +0 -69
- package/.output/server/node_modules/ajv-formats/package.json +0 -74
- package/.output/server/node_modules/colorette/index.js +0 -82
- package/.output/server/node_modules/colorette/package.json +0 -39
- package/.output/server/node_modules/js-levenshtein/index.js +0 -105
- package/.output/server/node_modules/js-levenshtein/package.json +0 -49
- package/.output/server/node_modules/pluralize/package.json +0 -40
- package/.output/server/node_modules/pluralize/pluralize.js +0 -503
- package/.output/server/node_modules/yaml-ast-parser/dist/src/common.js +0 -45
- package/.output/server/node_modules/yaml-ast-parser/dist/src/dumper.js +0 -644
- package/.output/server/node_modules/yaml-ast-parser/dist/src/exception.js +0 -40
- package/.output/server/node_modules/yaml-ast-parser/dist/src/index.js +0 -22
- package/.output/server/node_modules/yaml-ast-parser/dist/src/loader.js +0 -1416
- package/.output/server/node_modules/yaml-ast-parser/dist/src/mark.js +0 -62
- package/.output/server/node_modules/yaml-ast-parser/dist/src/scalarInference.js +0 -82
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/core.js +0 -8
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/default_full.js +0 -14
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/default_safe.js +0 -19
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/failsafe.js +0 -10
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema/json.js +0 -14
- package/.output/server/node_modules/yaml-ast-parser/dist/src/schema.js +0 -78
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/binary.js +0 -92
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/bool.js +0 -32
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/float.js +0 -95
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/int.js +0 -155
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/js/regexp.js +0 -64
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/js/undefined.js +0 -22
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/map.js +0 -7
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/merge.js +0 -10
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/null.js +0 -30
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/omap.js +0 -46
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/pairs.js +0 -55
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/seq.js +0 -7
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/set.js +0 -22
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/str.js +0 -7
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type/timestamp.js +0 -70
- package/.output/server/node_modules/yaml-ast-parser/dist/src/type.js +0 -54
- package/.output/server/node_modules/yaml-ast-parser/dist/src/yamlAST.js +0 -82
- package/.output/server/node_modules/yaml-ast-parser/package.json +0 -39
|
@@ -1,1416 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var ast = require("./yamlAST");
|
|
4
|
-
'use strict';
|
|
5
|
-
var common = require("./common");
|
|
6
|
-
var YAMLException = require("./exception");
|
|
7
|
-
var Mark = require("./mark");
|
|
8
|
-
var DEFAULT_SAFE_SCHEMA = require("./schema/default_safe");
|
|
9
|
-
var DEFAULT_FULL_SCHEMA = require("./schema/default_full");
|
|
10
|
-
var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
11
|
-
var CONTEXT_FLOW_IN = 1;
|
|
12
|
-
var CONTEXT_FLOW_OUT = 2;
|
|
13
|
-
var CONTEXT_BLOCK_IN = 3;
|
|
14
|
-
var CONTEXT_BLOCK_OUT = 4;
|
|
15
|
-
var CHOMPING_CLIP = 1;
|
|
16
|
-
var CHOMPING_STRIP = 2;
|
|
17
|
-
var CHOMPING_KEEP = 3;
|
|
18
|
-
var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
|
|
19
|
-
var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
|
20
|
-
var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
|
|
21
|
-
var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
|
|
22
|
-
var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
|
23
|
-
function is_EOL(c) {
|
|
24
|
-
return (c === 0x0A) || (c === 0x0D);
|
|
25
|
-
}
|
|
26
|
-
function is_WHITE_SPACE(c) {
|
|
27
|
-
return (c === 0x09) || (c === 0x20);
|
|
28
|
-
}
|
|
29
|
-
function is_WS_OR_EOL(c) {
|
|
30
|
-
return (c === 0x09) ||
|
|
31
|
-
(c === 0x20) ||
|
|
32
|
-
(c === 0x0A) ||
|
|
33
|
-
(c === 0x0D);
|
|
34
|
-
}
|
|
35
|
-
function is_FLOW_INDICATOR(c) {
|
|
36
|
-
return 0x2C === c ||
|
|
37
|
-
0x5B === c ||
|
|
38
|
-
0x5D === c ||
|
|
39
|
-
0x7B === c ||
|
|
40
|
-
0x7D === c;
|
|
41
|
-
}
|
|
42
|
-
function fromHexCode(c) {
|
|
43
|
-
var lc;
|
|
44
|
-
if ((0x30 <= c) && (c <= 0x39)) {
|
|
45
|
-
return c - 0x30;
|
|
46
|
-
}
|
|
47
|
-
lc = c | 0x20;
|
|
48
|
-
if ((0x61 <= lc) && (lc <= 0x66)) {
|
|
49
|
-
return lc - 0x61 + 10;
|
|
50
|
-
}
|
|
51
|
-
return -1;
|
|
52
|
-
}
|
|
53
|
-
function escapedHexLen(c) {
|
|
54
|
-
if (c === 0x78) {
|
|
55
|
-
return 2;
|
|
56
|
-
}
|
|
57
|
-
if (c === 0x75) {
|
|
58
|
-
return 4;
|
|
59
|
-
}
|
|
60
|
-
if (c === 0x55) {
|
|
61
|
-
return 8;
|
|
62
|
-
}
|
|
63
|
-
return 0;
|
|
64
|
-
}
|
|
65
|
-
function fromDecimalCode(c) {
|
|
66
|
-
if ((0x30 <= c) && (c <= 0x39)) {
|
|
67
|
-
return c - 0x30;
|
|
68
|
-
}
|
|
69
|
-
return -1;
|
|
70
|
-
}
|
|
71
|
-
function simpleEscapeSequence(c) {
|
|
72
|
-
return (c === 0x30) ? '\x00' :
|
|
73
|
-
(c === 0x61) ? '\x07' :
|
|
74
|
-
(c === 0x62) ? '\x08' :
|
|
75
|
-
(c === 0x74) ? '\x09' :
|
|
76
|
-
(c === 0x09) ? '\x09' :
|
|
77
|
-
(c === 0x6E) ? '\x0A' :
|
|
78
|
-
(c === 0x76) ? '\x0B' :
|
|
79
|
-
(c === 0x66) ? '\x0C' :
|
|
80
|
-
(c === 0x72) ? '\x0D' :
|
|
81
|
-
(c === 0x65) ? '\x1B' :
|
|
82
|
-
(c === 0x20) ? ' ' :
|
|
83
|
-
(c === 0x22) ? '\x22' :
|
|
84
|
-
(c === 0x2F) ? '/' :
|
|
85
|
-
(c === 0x5C) ? '\x5C' :
|
|
86
|
-
(c === 0x4E) ? '\x85' :
|
|
87
|
-
(c === 0x5F) ? '\xA0' :
|
|
88
|
-
(c === 0x4C) ? '\u2028' :
|
|
89
|
-
(c === 0x50) ? '\u2029' : '';
|
|
90
|
-
}
|
|
91
|
-
function charFromCodepoint(c) {
|
|
92
|
-
if (c <= 0xFFFF) {
|
|
93
|
-
return String.fromCharCode(c);
|
|
94
|
-
}
|
|
95
|
-
return String.fromCharCode(((c - 0x010000) >> 10) + 0xD800, ((c - 0x010000) & 0x03FF) + 0xDC00);
|
|
96
|
-
}
|
|
97
|
-
var simpleEscapeCheck = new Array(256);
|
|
98
|
-
var simpleEscapeMap = new Array(256);
|
|
99
|
-
var customEscapeCheck = new Array(256);
|
|
100
|
-
var customEscapeMap = new Array(256);
|
|
101
|
-
for (var i = 0; i < 256; i++) {
|
|
102
|
-
customEscapeMap[i] = simpleEscapeMap[i] = simpleEscapeSequence(i);
|
|
103
|
-
simpleEscapeCheck[i] = simpleEscapeMap[i] ? 1 : 0;
|
|
104
|
-
customEscapeCheck[i] = 1;
|
|
105
|
-
if (!simpleEscapeCheck[i]) {
|
|
106
|
-
customEscapeMap[i] = '\\' + String.fromCharCode(i);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
var State = (function () {
|
|
110
|
-
function State(input, options) {
|
|
111
|
-
this.errorMap = {};
|
|
112
|
-
this.errors = [];
|
|
113
|
-
this.lines = [];
|
|
114
|
-
this.input = input;
|
|
115
|
-
this.filename = options['filename'] || null;
|
|
116
|
-
this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
|
|
117
|
-
this.onWarning = options['onWarning'] || null;
|
|
118
|
-
this.legacy = options['legacy'] || false;
|
|
119
|
-
this.allowAnyEscape = options['allowAnyEscape'] || false;
|
|
120
|
-
this.ignoreDuplicateKeys = options['ignoreDuplicateKeys'] || false;
|
|
121
|
-
this.implicitTypes = this.schema.compiledImplicit;
|
|
122
|
-
this.typeMap = this.schema.compiledTypeMap;
|
|
123
|
-
this.length = input.length;
|
|
124
|
-
this.position = 0;
|
|
125
|
-
this.line = 0;
|
|
126
|
-
this.lineStart = 0;
|
|
127
|
-
this.lineIndent = 0;
|
|
128
|
-
this.documents = [];
|
|
129
|
-
}
|
|
130
|
-
return State;
|
|
131
|
-
}());
|
|
132
|
-
function generateError(state, message, isWarning) {
|
|
133
|
-
if (isWarning === void 0) { isWarning = false; }
|
|
134
|
-
return new YAMLException(message, new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart)), isWarning);
|
|
135
|
-
}
|
|
136
|
-
function throwErrorFromPosition(state, position, message, isWarning, toLineEnd) {
|
|
137
|
-
if (isWarning === void 0) { isWarning = false; }
|
|
138
|
-
if (toLineEnd === void 0) { toLineEnd = false; }
|
|
139
|
-
var line = positionToLine(state, position);
|
|
140
|
-
if (!line) {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
var hash = message + position;
|
|
144
|
-
if (state.errorMap[hash]) {
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
var mark = new Mark(state.filename, state.input, position, line.line, (position - line.start));
|
|
148
|
-
if (toLineEnd) {
|
|
149
|
-
mark.toLineEnd = true;
|
|
150
|
-
}
|
|
151
|
-
var error = new YAMLException(message, mark, isWarning);
|
|
152
|
-
state.errors.push(error);
|
|
153
|
-
}
|
|
154
|
-
function throwError(state, message) {
|
|
155
|
-
var error = generateError(state, message);
|
|
156
|
-
var hash = error.message + error.mark.position;
|
|
157
|
-
if (state.errorMap[hash]) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
state.errors.push(error);
|
|
161
|
-
state.errorMap[hash] = 1;
|
|
162
|
-
var or = state.position;
|
|
163
|
-
while (true) {
|
|
164
|
-
if (state.position >= state.input.length - 1) {
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
var c = state.input.charAt(state.position);
|
|
168
|
-
if (c == '\n') {
|
|
169
|
-
state.position--;
|
|
170
|
-
if (state.position == or) {
|
|
171
|
-
state.position += 1;
|
|
172
|
-
}
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
if (c == '\r') {
|
|
176
|
-
state.position--;
|
|
177
|
-
if (state.position == or) {
|
|
178
|
-
state.position += 1;
|
|
179
|
-
}
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
state.position++;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
function throwWarning(state, message) {
|
|
186
|
-
var error = generateError(state, message);
|
|
187
|
-
if (state.onWarning) {
|
|
188
|
-
state.onWarning.call(null, error);
|
|
189
|
-
}
|
|
190
|
-
else {
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
var directiveHandlers = {
|
|
194
|
-
YAML: function handleYamlDirective(state, name, args) {
|
|
195
|
-
var match, major, minor;
|
|
196
|
-
if (null !== state.version) {
|
|
197
|
-
throwError(state, 'duplication of %YAML directive');
|
|
198
|
-
}
|
|
199
|
-
if (1 !== args.length) {
|
|
200
|
-
throwError(state, 'YAML directive accepts exactly one argument');
|
|
201
|
-
}
|
|
202
|
-
match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
|
|
203
|
-
if (null === match) {
|
|
204
|
-
throwError(state, 'ill-formed argument of the YAML directive');
|
|
205
|
-
}
|
|
206
|
-
major = parseInt(match[1], 10);
|
|
207
|
-
minor = parseInt(match[2], 10);
|
|
208
|
-
if (1 !== major) {
|
|
209
|
-
throwError(state, 'found incompatible YAML document (version 1.2 is required)');
|
|
210
|
-
}
|
|
211
|
-
state.version = args[0];
|
|
212
|
-
state.checkLineBreaks = (minor < 2);
|
|
213
|
-
if (2 !== minor) {
|
|
214
|
-
throwError(state, 'found incompatible YAML document (version 1.2 is required)');
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
TAG: function handleTagDirective(state, name, args) {
|
|
218
|
-
var handle, prefix;
|
|
219
|
-
if (2 !== args.length) {
|
|
220
|
-
throwError(state, 'TAG directive accepts exactly two arguments');
|
|
221
|
-
}
|
|
222
|
-
handle = args[0];
|
|
223
|
-
prefix = args[1];
|
|
224
|
-
if (!PATTERN_TAG_HANDLE.test(handle)) {
|
|
225
|
-
throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
|
|
226
|
-
}
|
|
227
|
-
if (_hasOwnProperty.call(state.tagMap, handle)) {
|
|
228
|
-
throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
|
|
229
|
-
}
|
|
230
|
-
if (!PATTERN_TAG_URI.test(prefix)) {
|
|
231
|
-
throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
|
|
232
|
-
}
|
|
233
|
-
state.tagMap[handle] = prefix;
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
function captureSegment(state, start, end, checkJson) {
|
|
237
|
-
var _position, _length, _character, _result;
|
|
238
|
-
var scalar = state.result;
|
|
239
|
-
if (scalar.startPosition == -1) {
|
|
240
|
-
scalar.startPosition = start;
|
|
241
|
-
}
|
|
242
|
-
if (start <= end) {
|
|
243
|
-
_result = state.input.slice(start, end);
|
|
244
|
-
if (checkJson) {
|
|
245
|
-
for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
|
|
246
|
-
_character = _result.charCodeAt(_position);
|
|
247
|
-
if (!(0x09 === _character ||
|
|
248
|
-
0x20 <= _character && _character <= 0x10FFFF)) {
|
|
249
|
-
throwError(state, 'expected valid JSON character');
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
else if (PATTERN_NON_PRINTABLE.test(_result)) {
|
|
254
|
-
throwError(state, 'the stream contains non-printable characters');
|
|
255
|
-
}
|
|
256
|
-
scalar.value += _result;
|
|
257
|
-
scalar.endPosition = end;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
function mergeMappings(state, destination, source) {
|
|
261
|
-
var sourceKeys, key, index, quantity;
|
|
262
|
-
if (!common.isObject(source)) {
|
|
263
|
-
throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
|
|
264
|
-
}
|
|
265
|
-
sourceKeys = Object.keys(source);
|
|
266
|
-
for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
|
|
267
|
-
key = sourceKeys[index];
|
|
268
|
-
if (!_hasOwnProperty.call(destination, key)) {
|
|
269
|
-
destination[key] = source[key];
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
function storeMappingPair(state, _result, keyTag, keyNode, valueNode) {
|
|
274
|
-
var index, quantity;
|
|
275
|
-
if (keyNode == null) {
|
|
276
|
-
return;
|
|
277
|
-
}
|
|
278
|
-
if (null === _result) {
|
|
279
|
-
_result = {
|
|
280
|
-
startPosition: keyNode.startPosition,
|
|
281
|
-
endPosition: valueNode.endPosition,
|
|
282
|
-
parent: null,
|
|
283
|
-
errors: [],
|
|
284
|
-
mappings: [], kind: ast.Kind.MAP
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
var mapping = ast.newMapping(keyNode, valueNode);
|
|
288
|
-
mapping.parent = _result;
|
|
289
|
-
keyNode.parent = mapping;
|
|
290
|
-
if (valueNode != null) {
|
|
291
|
-
valueNode.parent = mapping;
|
|
292
|
-
}
|
|
293
|
-
!state.ignoreDuplicateKeys && _result.mappings.forEach(function (sibling) {
|
|
294
|
-
if (sibling.key && sibling.key.value === (mapping.key && mapping.key.value)) {
|
|
295
|
-
throwErrorFromPosition(state, mapping.key.startPosition, 'duplicate key');
|
|
296
|
-
throwErrorFromPosition(state, sibling.key.startPosition, 'duplicate key');
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
_result.mappings.push(mapping);
|
|
300
|
-
_result.endPosition = valueNode ? valueNode.endPosition : keyNode.endPosition + 1;
|
|
301
|
-
return _result;
|
|
302
|
-
}
|
|
303
|
-
function readLineBreak(state) {
|
|
304
|
-
var ch;
|
|
305
|
-
ch = state.input.charCodeAt(state.position);
|
|
306
|
-
if (0x0A === ch) {
|
|
307
|
-
state.position++;
|
|
308
|
-
}
|
|
309
|
-
else if (0x0D === ch) {
|
|
310
|
-
state.position++;
|
|
311
|
-
if (0x0A === state.input.charCodeAt(state.position)) {
|
|
312
|
-
state.position++;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
else {
|
|
316
|
-
throwError(state, 'a line break is expected');
|
|
317
|
-
}
|
|
318
|
-
state.line += 1;
|
|
319
|
-
state.lineStart = state.position;
|
|
320
|
-
state.lines.push({
|
|
321
|
-
start: state.lineStart,
|
|
322
|
-
line: state.line
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
var Line = (function () {
|
|
326
|
-
function Line() {
|
|
327
|
-
}
|
|
328
|
-
return Line;
|
|
329
|
-
}());
|
|
330
|
-
function positionToLine(state, position) {
|
|
331
|
-
var line;
|
|
332
|
-
for (var i = 0; i < state.lines.length; i++) {
|
|
333
|
-
if (state.lines[i].start > position) {
|
|
334
|
-
break;
|
|
335
|
-
}
|
|
336
|
-
line = state.lines[i];
|
|
337
|
-
}
|
|
338
|
-
if (!line) {
|
|
339
|
-
return {
|
|
340
|
-
start: 0,
|
|
341
|
-
line: 0
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
return line;
|
|
345
|
-
}
|
|
346
|
-
function skipSeparationSpace(state, allowComments, checkIndent) {
|
|
347
|
-
var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
|
|
348
|
-
while (0 !== ch) {
|
|
349
|
-
while (is_WHITE_SPACE(ch)) {
|
|
350
|
-
if (ch === 0x09) {
|
|
351
|
-
state.errors.push(generateError(state, "Using tabs can lead to unpredictable results", true));
|
|
352
|
-
}
|
|
353
|
-
ch = state.input.charCodeAt(++state.position);
|
|
354
|
-
}
|
|
355
|
-
if (allowComments && 0x23 === ch) {
|
|
356
|
-
do {
|
|
357
|
-
ch = state.input.charCodeAt(++state.position);
|
|
358
|
-
} while (ch !== 0x0A && ch !== 0x0D && 0 !== ch);
|
|
359
|
-
}
|
|
360
|
-
if (is_EOL(ch)) {
|
|
361
|
-
readLineBreak(state);
|
|
362
|
-
ch = state.input.charCodeAt(state.position);
|
|
363
|
-
lineBreaks++;
|
|
364
|
-
state.lineIndent = 0;
|
|
365
|
-
while (0x20 === ch) {
|
|
366
|
-
state.lineIndent++;
|
|
367
|
-
ch = state.input.charCodeAt(++state.position);
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
else {
|
|
371
|
-
break;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) {
|
|
375
|
-
throwWarning(state, 'deficient indentation');
|
|
376
|
-
}
|
|
377
|
-
return lineBreaks;
|
|
378
|
-
}
|
|
379
|
-
function testDocumentSeparator(state) {
|
|
380
|
-
var _position = state.position, ch;
|
|
381
|
-
ch = state.input.charCodeAt(_position);
|
|
382
|
-
if ((0x2D === ch || 0x2E === ch) &&
|
|
383
|
-
state.input.charCodeAt(_position + 1) === ch &&
|
|
384
|
-
state.input.charCodeAt(_position + 2) === ch) {
|
|
385
|
-
_position += 3;
|
|
386
|
-
ch = state.input.charCodeAt(_position);
|
|
387
|
-
if (ch === 0 || is_WS_OR_EOL(ch)) {
|
|
388
|
-
return true;
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
return false;
|
|
392
|
-
}
|
|
393
|
-
function writeFoldedLines(state, scalar, count) {
|
|
394
|
-
if (1 === count) {
|
|
395
|
-
scalar.value += ' ';
|
|
396
|
-
}
|
|
397
|
-
else if (count > 1) {
|
|
398
|
-
scalar.value += common.repeat('\n', count - 1);
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
function readPlainScalar(state, nodeIndent, withinFlowCollection) {
|
|
402
|
-
var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
|
|
403
|
-
var state_result = ast.newScalar();
|
|
404
|
-
state_result.plainScalar = true;
|
|
405
|
-
state.result = state_result;
|
|
406
|
-
ch = state.input.charCodeAt(state.position);
|
|
407
|
-
if (is_WS_OR_EOL(ch) ||
|
|
408
|
-
is_FLOW_INDICATOR(ch) ||
|
|
409
|
-
0x23 === ch ||
|
|
410
|
-
0x26 === ch ||
|
|
411
|
-
0x2A === ch ||
|
|
412
|
-
0x21 === ch ||
|
|
413
|
-
0x7C === ch ||
|
|
414
|
-
0x3E === ch ||
|
|
415
|
-
0x27 === ch ||
|
|
416
|
-
0x22 === ch ||
|
|
417
|
-
0x25 === ch ||
|
|
418
|
-
0x40 === ch ||
|
|
419
|
-
0x60 === ch) {
|
|
420
|
-
return false;
|
|
421
|
-
}
|
|
422
|
-
if (0x3F === ch || 0x2D === ch) {
|
|
423
|
-
following = state.input.charCodeAt(state.position + 1);
|
|
424
|
-
if (is_WS_OR_EOL(following) ||
|
|
425
|
-
withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
|
426
|
-
return false;
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
state.kind = 'scalar';
|
|
430
|
-
captureStart = captureEnd = state.position;
|
|
431
|
-
hasPendingContent = false;
|
|
432
|
-
while (0 !== ch) {
|
|
433
|
-
if (0x3A === ch) {
|
|
434
|
-
following = state.input.charCodeAt(state.position + 1);
|
|
435
|
-
if (is_WS_OR_EOL(following) ||
|
|
436
|
-
withinFlowCollection && is_FLOW_INDICATOR(following)) {
|
|
437
|
-
break;
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
else if (0x23 === ch) {
|
|
441
|
-
preceding = state.input.charCodeAt(state.position - 1);
|
|
442
|
-
if (is_WS_OR_EOL(preceding)) {
|
|
443
|
-
break;
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
|
|
447
|
-
withinFlowCollection && is_FLOW_INDICATOR(ch)) {
|
|
448
|
-
break;
|
|
449
|
-
}
|
|
450
|
-
else if (is_EOL(ch)) {
|
|
451
|
-
_line = state.line;
|
|
452
|
-
_lineStart = state.lineStart;
|
|
453
|
-
_lineIndent = state.lineIndent;
|
|
454
|
-
skipSeparationSpace(state, false, -1);
|
|
455
|
-
if (state.lineIndent >= nodeIndent) {
|
|
456
|
-
hasPendingContent = true;
|
|
457
|
-
ch = state.input.charCodeAt(state.position);
|
|
458
|
-
continue;
|
|
459
|
-
}
|
|
460
|
-
else {
|
|
461
|
-
state.position = captureEnd;
|
|
462
|
-
state.line = _line;
|
|
463
|
-
state.lineStart = _lineStart;
|
|
464
|
-
state.lineIndent = _lineIndent;
|
|
465
|
-
break;
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
if (hasPendingContent) {
|
|
469
|
-
captureSegment(state, captureStart, captureEnd, false);
|
|
470
|
-
writeFoldedLines(state, state_result, state.line - _line);
|
|
471
|
-
captureStart = captureEnd = state.position;
|
|
472
|
-
hasPendingContent = false;
|
|
473
|
-
}
|
|
474
|
-
if (!is_WHITE_SPACE(ch)) {
|
|
475
|
-
captureEnd = state.position + 1;
|
|
476
|
-
}
|
|
477
|
-
ch = state.input.charCodeAt(++state.position);
|
|
478
|
-
if (state.position >= state.input.length) {
|
|
479
|
-
return false;
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
captureSegment(state, captureStart, captureEnd, false);
|
|
483
|
-
if (state.result.startPosition != -1) {
|
|
484
|
-
state_result.rawValue = state.input.substring(state_result.startPosition, state_result.endPosition);
|
|
485
|
-
return true;
|
|
486
|
-
}
|
|
487
|
-
state.kind = _kind;
|
|
488
|
-
state.result = _result;
|
|
489
|
-
return false;
|
|
490
|
-
}
|
|
491
|
-
function readSingleQuotedScalar(state, nodeIndent) {
|
|
492
|
-
var ch, captureStart, captureEnd;
|
|
493
|
-
ch = state.input.charCodeAt(state.position);
|
|
494
|
-
if (0x27 !== ch) {
|
|
495
|
-
return false;
|
|
496
|
-
}
|
|
497
|
-
var scalar = ast.newScalar();
|
|
498
|
-
scalar.singleQuoted = true;
|
|
499
|
-
state.kind = 'scalar';
|
|
500
|
-
state.result = scalar;
|
|
501
|
-
scalar.startPosition = state.position;
|
|
502
|
-
state.position++;
|
|
503
|
-
captureStart = captureEnd = state.position;
|
|
504
|
-
while (0 !== (ch = state.input.charCodeAt(state.position))) {
|
|
505
|
-
if (0x27 === ch) {
|
|
506
|
-
captureSegment(state, captureStart, state.position, true);
|
|
507
|
-
ch = state.input.charCodeAt(++state.position);
|
|
508
|
-
scalar.endPosition = state.position;
|
|
509
|
-
if (0x27 === ch) {
|
|
510
|
-
captureStart = captureEnd = state.position;
|
|
511
|
-
state.position++;
|
|
512
|
-
}
|
|
513
|
-
else {
|
|
514
|
-
return true;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
else if (is_EOL(ch)) {
|
|
518
|
-
captureSegment(state, captureStart, captureEnd, true);
|
|
519
|
-
writeFoldedLines(state, scalar, skipSeparationSpace(state, false, nodeIndent));
|
|
520
|
-
captureStart = captureEnd = state.position;
|
|
521
|
-
}
|
|
522
|
-
else if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
523
|
-
throwError(state, 'unexpected end of the document within a single quoted scalar');
|
|
524
|
-
}
|
|
525
|
-
else {
|
|
526
|
-
state.position++;
|
|
527
|
-
captureEnd = state.position;
|
|
528
|
-
scalar.endPosition = state.position;
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
throwError(state, 'unexpected end of the stream within a single quoted scalar');
|
|
532
|
-
}
|
|
533
|
-
function readDoubleQuotedScalar(state, nodeIndent) {
|
|
534
|
-
var captureStart, captureEnd, hexLength, hexResult, tmp, tmpEsc, ch;
|
|
535
|
-
ch = state.input.charCodeAt(state.position);
|
|
536
|
-
if (0x22 !== ch) {
|
|
537
|
-
return false;
|
|
538
|
-
}
|
|
539
|
-
state.kind = 'scalar';
|
|
540
|
-
var scalar = ast.newScalar();
|
|
541
|
-
scalar.doubleQuoted = true;
|
|
542
|
-
state.result = scalar;
|
|
543
|
-
scalar.startPosition = state.position;
|
|
544
|
-
state.position++;
|
|
545
|
-
captureStart = captureEnd = state.position;
|
|
546
|
-
while (0 !== (ch = state.input.charCodeAt(state.position))) {
|
|
547
|
-
if (0x22 === ch) {
|
|
548
|
-
captureSegment(state, captureStart, state.position, true);
|
|
549
|
-
state.position++;
|
|
550
|
-
scalar.endPosition = state.position;
|
|
551
|
-
scalar.rawValue = state.input.substring(scalar.startPosition, scalar.endPosition);
|
|
552
|
-
return true;
|
|
553
|
-
}
|
|
554
|
-
else if (0x5C === ch) {
|
|
555
|
-
captureSegment(state, captureStart, state.position, true);
|
|
556
|
-
ch = state.input.charCodeAt(++state.position);
|
|
557
|
-
if (is_EOL(ch)) {
|
|
558
|
-
skipSeparationSpace(state, false, nodeIndent);
|
|
559
|
-
}
|
|
560
|
-
else if (ch < 256 && (state.allowAnyEscape ? customEscapeCheck[ch] : simpleEscapeCheck[ch])) {
|
|
561
|
-
scalar.value += (state.allowAnyEscape ? customEscapeMap[ch] : simpleEscapeMap[ch]);
|
|
562
|
-
state.position++;
|
|
563
|
-
}
|
|
564
|
-
else if ((tmp = escapedHexLen(ch)) > 0) {
|
|
565
|
-
hexLength = tmp;
|
|
566
|
-
hexResult = 0;
|
|
567
|
-
for (; hexLength > 0; hexLength--) {
|
|
568
|
-
ch = state.input.charCodeAt(++state.position);
|
|
569
|
-
if ((tmp = fromHexCode(ch)) >= 0) {
|
|
570
|
-
hexResult = (hexResult << 4) + tmp;
|
|
571
|
-
}
|
|
572
|
-
else {
|
|
573
|
-
throwError(state, 'expected hexadecimal character');
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
scalar.value += charFromCodepoint(hexResult);
|
|
577
|
-
state.position++;
|
|
578
|
-
}
|
|
579
|
-
else {
|
|
580
|
-
throwError(state, 'unknown escape sequence');
|
|
581
|
-
}
|
|
582
|
-
captureStart = captureEnd = state.position;
|
|
583
|
-
}
|
|
584
|
-
else if (is_EOL(ch)) {
|
|
585
|
-
captureSegment(state, captureStart, captureEnd, true);
|
|
586
|
-
writeFoldedLines(state, scalar, skipSeparationSpace(state, false, nodeIndent));
|
|
587
|
-
captureStart = captureEnd = state.position;
|
|
588
|
-
}
|
|
589
|
-
else if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
590
|
-
throwError(state, 'unexpected end of the document within a double quoted scalar');
|
|
591
|
-
}
|
|
592
|
-
else {
|
|
593
|
-
state.position++;
|
|
594
|
-
captureEnd = state.position;
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
throwError(state, 'unexpected end of the stream within a double quoted scalar');
|
|
598
|
-
}
|
|
599
|
-
function readFlowCollection(state, nodeIndent) {
|
|
600
|
-
var readNext = true, _line, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, keyNode, keyTag, valueNode, ch;
|
|
601
|
-
ch = state.input.charCodeAt(state.position);
|
|
602
|
-
if (ch === 0x5B) {
|
|
603
|
-
terminator = 0x5D;
|
|
604
|
-
isMapping = false;
|
|
605
|
-
_result = ast.newItems();
|
|
606
|
-
_result.startPosition = state.position;
|
|
607
|
-
}
|
|
608
|
-
else if (ch === 0x7B) {
|
|
609
|
-
terminator = 0x7D;
|
|
610
|
-
isMapping = true;
|
|
611
|
-
_result = ast.newMap();
|
|
612
|
-
_result.startPosition = state.position;
|
|
613
|
-
}
|
|
614
|
-
else {
|
|
615
|
-
return false;
|
|
616
|
-
}
|
|
617
|
-
if (null !== state.anchor) {
|
|
618
|
-
_result.anchorId = state.anchor;
|
|
619
|
-
state.anchorMap[state.anchor] = _result;
|
|
620
|
-
}
|
|
621
|
-
ch = state.input.charCodeAt(++state.position);
|
|
622
|
-
while (0 !== ch) {
|
|
623
|
-
skipSeparationSpace(state, true, nodeIndent);
|
|
624
|
-
ch = state.input.charCodeAt(state.position);
|
|
625
|
-
if (ch === terminator) {
|
|
626
|
-
state.position++;
|
|
627
|
-
state.tag = _tag;
|
|
628
|
-
state.anchor = _anchor;
|
|
629
|
-
state.kind = isMapping ? 'mapping' : 'sequence';
|
|
630
|
-
state.result = _result;
|
|
631
|
-
_result.endPosition = state.position;
|
|
632
|
-
return true;
|
|
633
|
-
}
|
|
634
|
-
else if (!readNext) {
|
|
635
|
-
var p = state.position;
|
|
636
|
-
throwError(state, 'missed comma between flow collection entries');
|
|
637
|
-
state.position = p + 1;
|
|
638
|
-
}
|
|
639
|
-
keyTag = keyNode = valueNode = null;
|
|
640
|
-
isPair = isExplicitPair = false;
|
|
641
|
-
if (0x3F === ch) {
|
|
642
|
-
following = state.input.charCodeAt(state.position + 1);
|
|
643
|
-
if (is_WS_OR_EOL(following)) {
|
|
644
|
-
isPair = isExplicitPair = true;
|
|
645
|
-
state.position++;
|
|
646
|
-
skipSeparationSpace(state, true, nodeIndent);
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
_line = state.line;
|
|
650
|
-
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
651
|
-
keyTag = state.tag;
|
|
652
|
-
keyNode = state.result;
|
|
653
|
-
skipSeparationSpace(state, true, nodeIndent);
|
|
654
|
-
ch = state.input.charCodeAt(state.position);
|
|
655
|
-
if ((isExplicitPair || state.line === _line) && 0x3A === ch) {
|
|
656
|
-
isPair = true;
|
|
657
|
-
ch = state.input.charCodeAt(++state.position);
|
|
658
|
-
skipSeparationSpace(state, true, nodeIndent);
|
|
659
|
-
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
|
|
660
|
-
valueNode = state.result;
|
|
661
|
-
}
|
|
662
|
-
if (isMapping) {
|
|
663
|
-
storeMappingPair(state, _result, keyTag, keyNode, valueNode);
|
|
664
|
-
}
|
|
665
|
-
else if (isPair) {
|
|
666
|
-
var mp = storeMappingPair(state, null, keyTag, keyNode, valueNode);
|
|
667
|
-
mp.parent = _result;
|
|
668
|
-
_result.items.push(mp);
|
|
669
|
-
}
|
|
670
|
-
else {
|
|
671
|
-
if (keyNode) {
|
|
672
|
-
keyNode.parent = _result;
|
|
673
|
-
}
|
|
674
|
-
_result.items.push(keyNode);
|
|
675
|
-
}
|
|
676
|
-
_result.endPosition = state.position + 1;
|
|
677
|
-
skipSeparationSpace(state, true, nodeIndent);
|
|
678
|
-
ch = state.input.charCodeAt(state.position);
|
|
679
|
-
if (0x2C === ch) {
|
|
680
|
-
readNext = true;
|
|
681
|
-
ch = state.input.charCodeAt(++state.position);
|
|
682
|
-
}
|
|
683
|
-
else {
|
|
684
|
-
readNext = false;
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
throwError(state, 'unexpected end of the stream within a flow collection');
|
|
688
|
-
}
|
|
689
|
-
function readBlockScalar(state, nodeIndent) {
|
|
690
|
-
var captureStart, folding, chomping = CHOMPING_CLIP, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
|
|
691
|
-
ch = state.input.charCodeAt(state.position);
|
|
692
|
-
if (ch === 0x7C) {
|
|
693
|
-
folding = false;
|
|
694
|
-
}
|
|
695
|
-
else if (ch === 0x3E) {
|
|
696
|
-
folding = true;
|
|
697
|
-
}
|
|
698
|
-
else {
|
|
699
|
-
return false;
|
|
700
|
-
}
|
|
701
|
-
var sc = ast.newScalar();
|
|
702
|
-
state.kind = 'scalar';
|
|
703
|
-
state.result = sc;
|
|
704
|
-
sc.startPosition = state.position;
|
|
705
|
-
while (0 !== ch) {
|
|
706
|
-
ch = state.input.charCodeAt(++state.position);
|
|
707
|
-
if (0x2B === ch || 0x2D === ch) {
|
|
708
|
-
if (CHOMPING_CLIP === chomping) {
|
|
709
|
-
chomping = (0x2B === ch) ? CHOMPING_KEEP : CHOMPING_STRIP;
|
|
710
|
-
}
|
|
711
|
-
else {
|
|
712
|
-
throwError(state, 'repeat of a chomping mode identifier');
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
else if ((tmp = fromDecimalCode(ch)) >= 0) {
|
|
716
|
-
if (tmp === 0) {
|
|
717
|
-
throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
|
|
718
|
-
}
|
|
719
|
-
else if (!detectedIndent) {
|
|
720
|
-
textIndent = nodeIndent + tmp - 1;
|
|
721
|
-
detectedIndent = true;
|
|
722
|
-
}
|
|
723
|
-
else {
|
|
724
|
-
throwError(state, 'repeat of an indentation width identifier');
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
else {
|
|
728
|
-
break;
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
if (is_WHITE_SPACE(ch)) {
|
|
732
|
-
do {
|
|
733
|
-
ch = state.input.charCodeAt(++state.position);
|
|
734
|
-
} while (is_WHITE_SPACE(ch));
|
|
735
|
-
if (0x23 === ch) {
|
|
736
|
-
do {
|
|
737
|
-
ch = state.input.charCodeAt(++state.position);
|
|
738
|
-
} while (!is_EOL(ch) && (0 !== ch));
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
while (0 !== ch) {
|
|
742
|
-
readLineBreak(state);
|
|
743
|
-
state.lineIndent = 0;
|
|
744
|
-
ch = state.input.charCodeAt(state.position);
|
|
745
|
-
while ((!detectedIndent || state.lineIndent < textIndent) &&
|
|
746
|
-
(0x20 === ch)) {
|
|
747
|
-
state.lineIndent++;
|
|
748
|
-
ch = state.input.charCodeAt(++state.position);
|
|
749
|
-
}
|
|
750
|
-
if (!detectedIndent && state.lineIndent > textIndent) {
|
|
751
|
-
textIndent = state.lineIndent;
|
|
752
|
-
}
|
|
753
|
-
if (is_EOL(ch)) {
|
|
754
|
-
emptyLines++;
|
|
755
|
-
continue;
|
|
756
|
-
}
|
|
757
|
-
if (state.lineIndent < textIndent) {
|
|
758
|
-
if (chomping === CHOMPING_KEEP) {
|
|
759
|
-
sc.value += common.repeat('\n', emptyLines);
|
|
760
|
-
}
|
|
761
|
-
else if (chomping === CHOMPING_CLIP) {
|
|
762
|
-
if (detectedIndent) {
|
|
763
|
-
sc.value += '\n';
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
break;
|
|
767
|
-
}
|
|
768
|
-
if (folding) {
|
|
769
|
-
if (is_WHITE_SPACE(ch)) {
|
|
770
|
-
atMoreIndented = true;
|
|
771
|
-
sc.value += common.repeat('\n', emptyLines + 1);
|
|
772
|
-
}
|
|
773
|
-
else if (atMoreIndented) {
|
|
774
|
-
atMoreIndented = false;
|
|
775
|
-
sc.value += common.repeat('\n', emptyLines + 1);
|
|
776
|
-
}
|
|
777
|
-
else if (0 === emptyLines) {
|
|
778
|
-
if (detectedIndent) {
|
|
779
|
-
sc.value += ' ';
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
else {
|
|
783
|
-
sc.value += common.repeat('\n', emptyLines);
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
else if (detectedIndent) {
|
|
787
|
-
sc.value += common.repeat('\n', emptyLines + 1);
|
|
788
|
-
}
|
|
789
|
-
else {
|
|
790
|
-
}
|
|
791
|
-
detectedIndent = true;
|
|
792
|
-
emptyLines = 0;
|
|
793
|
-
captureStart = state.position;
|
|
794
|
-
while (!is_EOL(ch) && (0 !== ch)) {
|
|
795
|
-
ch = state.input.charCodeAt(++state.position);
|
|
796
|
-
}
|
|
797
|
-
captureSegment(state, captureStart, state.position, false);
|
|
798
|
-
}
|
|
799
|
-
sc.endPosition = state.position;
|
|
800
|
-
var i = state.position - 1;
|
|
801
|
-
var needMinus = false;
|
|
802
|
-
while (true) {
|
|
803
|
-
var c = state.input[i];
|
|
804
|
-
if (c == '\r' || c == '\n') {
|
|
805
|
-
if (needMinus) {
|
|
806
|
-
i--;
|
|
807
|
-
}
|
|
808
|
-
break;
|
|
809
|
-
}
|
|
810
|
-
if (c != ' ' && c != '\t') {
|
|
811
|
-
break;
|
|
812
|
-
}
|
|
813
|
-
i--;
|
|
814
|
-
}
|
|
815
|
-
sc.endPosition = i;
|
|
816
|
-
sc.rawValue = state.input.substring(sc.startPosition, sc.endPosition);
|
|
817
|
-
return true;
|
|
818
|
-
}
|
|
819
|
-
function readBlockSequence(state, nodeIndent) {
|
|
820
|
-
var _line, _tag = state.tag, _anchor = state.anchor, _result = ast.newItems(), following, detected = false, ch;
|
|
821
|
-
if (null !== state.anchor) {
|
|
822
|
-
_result.anchorId = state.anchor;
|
|
823
|
-
state.anchorMap[state.anchor] = _result;
|
|
824
|
-
}
|
|
825
|
-
_result.startPosition = state.position;
|
|
826
|
-
ch = state.input.charCodeAt(state.position);
|
|
827
|
-
while (0 !== ch) {
|
|
828
|
-
if (0x2D !== ch) {
|
|
829
|
-
break;
|
|
830
|
-
}
|
|
831
|
-
following = state.input.charCodeAt(state.position + 1);
|
|
832
|
-
if (!is_WS_OR_EOL(following)) {
|
|
833
|
-
break;
|
|
834
|
-
}
|
|
835
|
-
detected = true;
|
|
836
|
-
state.position++;
|
|
837
|
-
if (skipSeparationSpace(state, true, -1)) {
|
|
838
|
-
if (state.lineIndent <= nodeIndent) {
|
|
839
|
-
_result.items.push(null);
|
|
840
|
-
ch = state.input.charCodeAt(state.position);
|
|
841
|
-
continue;
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
_line = state.line;
|
|
845
|
-
composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
|
|
846
|
-
if (state.result) {
|
|
847
|
-
state.result.parent = _result;
|
|
848
|
-
_result.items.push(state.result);
|
|
849
|
-
}
|
|
850
|
-
skipSeparationSpace(state, true, -1);
|
|
851
|
-
ch = state.input.charCodeAt(state.position);
|
|
852
|
-
if ((state.line === _line || state.lineIndent > nodeIndent) && (0 !== ch)) {
|
|
853
|
-
throwError(state, 'bad indentation of a sequence entry');
|
|
854
|
-
}
|
|
855
|
-
else if (state.lineIndent < nodeIndent) {
|
|
856
|
-
break;
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
_result.endPosition = state.position;
|
|
860
|
-
if (detected) {
|
|
861
|
-
state.tag = _tag;
|
|
862
|
-
state.anchor = _anchor;
|
|
863
|
-
state.kind = 'sequence';
|
|
864
|
-
state.result = _result;
|
|
865
|
-
_result.endPosition = state.position;
|
|
866
|
-
return true;
|
|
867
|
-
}
|
|
868
|
-
return false;
|
|
869
|
-
}
|
|
870
|
-
function readBlockMapping(state, nodeIndent, flowIndent) {
|
|
871
|
-
var following, allowCompact, _line, _tag = state.tag, _anchor = state.anchor, _result = ast.newMap(), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
|
|
872
|
-
_result.startPosition = state.position;
|
|
873
|
-
if (null !== state.anchor) {
|
|
874
|
-
_result.anchorId = state.anchor;
|
|
875
|
-
state.anchorMap[state.anchor] = _result;
|
|
876
|
-
}
|
|
877
|
-
ch = state.input.charCodeAt(state.position);
|
|
878
|
-
while (0 !== ch) {
|
|
879
|
-
following = state.input.charCodeAt(state.position + 1);
|
|
880
|
-
_line = state.line;
|
|
881
|
-
if ((0x3F === ch || 0x3A === ch) && is_WS_OR_EOL(following)) {
|
|
882
|
-
if (0x3F === ch) {
|
|
883
|
-
if (atExplicitKey) {
|
|
884
|
-
storeMappingPair(state, _result, keyTag, keyNode, null);
|
|
885
|
-
keyTag = keyNode = valueNode = null;
|
|
886
|
-
}
|
|
887
|
-
detected = true;
|
|
888
|
-
atExplicitKey = true;
|
|
889
|
-
allowCompact = true;
|
|
890
|
-
}
|
|
891
|
-
else if (atExplicitKey) {
|
|
892
|
-
atExplicitKey = false;
|
|
893
|
-
allowCompact = true;
|
|
894
|
-
}
|
|
895
|
-
else {
|
|
896
|
-
throwError(state, 'incomplete explicit mapping pair; a key node is missed');
|
|
897
|
-
}
|
|
898
|
-
state.position += 1;
|
|
899
|
-
ch = following;
|
|
900
|
-
}
|
|
901
|
-
else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
|
|
902
|
-
if (state.line === _line) {
|
|
903
|
-
ch = state.input.charCodeAt(state.position);
|
|
904
|
-
while (is_WHITE_SPACE(ch)) {
|
|
905
|
-
ch = state.input.charCodeAt(++state.position);
|
|
906
|
-
}
|
|
907
|
-
if (0x3A === ch) {
|
|
908
|
-
ch = state.input.charCodeAt(++state.position);
|
|
909
|
-
if (!is_WS_OR_EOL(ch)) {
|
|
910
|
-
throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
|
|
911
|
-
}
|
|
912
|
-
if (atExplicitKey) {
|
|
913
|
-
storeMappingPair(state, _result, keyTag, keyNode, null);
|
|
914
|
-
keyTag = keyNode = valueNode = null;
|
|
915
|
-
}
|
|
916
|
-
detected = true;
|
|
917
|
-
atExplicitKey = false;
|
|
918
|
-
allowCompact = false;
|
|
919
|
-
keyTag = state.tag;
|
|
920
|
-
keyNode = state.result;
|
|
921
|
-
}
|
|
922
|
-
else if (state.position == state.lineStart && testDocumentSeparator(state)) {
|
|
923
|
-
break;
|
|
924
|
-
}
|
|
925
|
-
else if (detected) {
|
|
926
|
-
throwError(state, 'can not read an implicit mapping pair; a colon is missed');
|
|
927
|
-
}
|
|
928
|
-
else {
|
|
929
|
-
state.tag = _tag;
|
|
930
|
-
state.anchor = _anchor;
|
|
931
|
-
return true;
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
else if (detected) {
|
|
935
|
-
throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
|
|
936
|
-
while (state.position > 0) {
|
|
937
|
-
ch = state.input.charCodeAt(--state.position);
|
|
938
|
-
if (is_EOL(ch)) {
|
|
939
|
-
state.position++;
|
|
940
|
-
break;
|
|
941
|
-
}
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
else {
|
|
945
|
-
state.tag = _tag;
|
|
946
|
-
state.anchor = _anchor;
|
|
947
|
-
return true;
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
else {
|
|
951
|
-
break;
|
|
952
|
-
}
|
|
953
|
-
if (state.line === _line || state.lineIndent > nodeIndent) {
|
|
954
|
-
if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
|
|
955
|
-
if (atExplicitKey) {
|
|
956
|
-
keyNode = state.result;
|
|
957
|
-
}
|
|
958
|
-
else {
|
|
959
|
-
valueNode = state.result;
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
if (!atExplicitKey) {
|
|
963
|
-
storeMappingPair(state, _result, keyTag, keyNode, valueNode);
|
|
964
|
-
keyTag = keyNode = valueNode = null;
|
|
965
|
-
}
|
|
966
|
-
skipSeparationSpace(state, true, -1);
|
|
967
|
-
ch = state.input.charCodeAt(state.position);
|
|
968
|
-
}
|
|
969
|
-
if (state.lineIndent > nodeIndent && (0 !== ch)) {
|
|
970
|
-
throwError(state, 'bad indentation of a mapping entry');
|
|
971
|
-
}
|
|
972
|
-
else if (state.lineIndent < nodeIndent) {
|
|
973
|
-
break;
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
if (atExplicitKey) {
|
|
977
|
-
storeMappingPair(state, _result, keyTag, keyNode, null);
|
|
978
|
-
}
|
|
979
|
-
if (detected) {
|
|
980
|
-
state.tag = _tag;
|
|
981
|
-
state.anchor = _anchor;
|
|
982
|
-
state.kind = 'mapping';
|
|
983
|
-
state.result = _result;
|
|
984
|
-
}
|
|
985
|
-
return detected;
|
|
986
|
-
}
|
|
987
|
-
function readTagProperty(state) {
|
|
988
|
-
var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
|
|
989
|
-
ch = state.input.charCodeAt(state.position);
|
|
990
|
-
if (0x21 !== ch) {
|
|
991
|
-
return false;
|
|
992
|
-
}
|
|
993
|
-
if (null !== state.tag) {
|
|
994
|
-
throwError(state, 'duplication of a tag property');
|
|
995
|
-
}
|
|
996
|
-
ch = state.input.charCodeAt(++state.position);
|
|
997
|
-
if (0x3C === ch) {
|
|
998
|
-
isVerbatim = true;
|
|
999
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1000
|
-
}
|
|
1001
|
-
else if (0x21 === ch) {
|
|
1002
|
-
isNamed = true;
|
|
1003
|
-
tagHandle = '!!';
|
|
1004
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1005
|
-
}
|
|
1006
|
-
else {
|
|
1007
|
-
tagHandle = '!';
|
|
1008
|
-
}
|
|
1009
|
-
_position = state.position;
|
|
1010
|
-
if (isVerbatim) {
|
|
1011
|
-
do {
|
|
1012
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1013
|
-
} while (0 !== ch && 0x3E !== ch);
|
|
1014
|
-
if (state.position < state.length) {
|
|
1015
|
-
tagName = state.input.slice(_position, state.position);
|
|
1016
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1017
|
-
}
|
|
1018
|
-
else {
|
|
1019
|
-
throwError(state, 'unexpected end of the stream within a verbatim tag');
|
|
1020
|
-
}
|
|
1021
|
-
}
|
|
1022
|
-
else {
|
|
1023
|
-
while (0 !== ch && !is_WS_OR_EOL(ch)) {
|
|
1024
|
-
if (0x21 === ch) {
|
|
1025
|
-
if (!isNamed) {
|
|
1026
|
-
tagHandle = state.input.slice(_position - 1, state.position + 1);
|
|
1027
|
-
if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
|
|
1028
|
-
throwError(state, 'named tag handle cannot contain such characters');
|
|
1029
|
-
}
|
|
1030
|
-
isNamed = true;
|
|
1031
|
-
_position = state.position + 1;
|
|
1032
|
-
}
|
|
1033
|
-
else {
|
|
1034
|
-
throwError(state, 'tag suffix cannot contain exclamation marks');
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1038
|
-
}
|
|
1039
|
-
tagName = state.input.slice(_position, state.position);
|
|
1040
|
-
if (PATTERN_FLOW_INDICATORS.test(tagName)) {
|
|
1041
|
-
throwError(state, 'tag suffix cannot contain flow indicator characters');
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
if (tagName && !PATTERN_TAG_URI.test(tagName)) {
|
|
1045
|
-
throwError(state, 'tag name cannot contain such characters: ' + tagName);
|
|
1046
|
-
}
|
|
1047
|
-
if (isVerbatim) {
|
|
1048
|
-
state.tag = tagName;
|
|
1049
|
-
}
|
|
1050
|
-
else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
|
|
1051
|
-
state.tag = state.tagMap[tagHandle] + tagName;
|
|
1052
|
-
}
|
|
1053
|
-
else if ('!' === tagHandle) {
|
|
1054
|
-
state.tag = '!' + tagName;
|
|
1055
|
-
}
|
|
1056
|
-
else if ('!!' === tagHandle) {
|
|
1057
|
-
state.tag = 'tag:yaml.org,2002:' + tagName;
|
|
1058
|
-
}
|
|
1059
|
-
else {
|
|
1060
|
-
throwError(state, 'undeclared tag handle "' + tagHandle + '"');
|
|
1061
|
-
}
|
|
1062
|
-
return true;
|
|
1063
|
-
}
|
|
1064
|
-
function readAnchorProperty(state) {
|
|
1065
|
-
var _position, ch;
|
|
1066
|
-
ch = state.input.charCodeAt(state.position);
|
|
1067
|
-
if (0x26 !== ch) {
|
|
1068
|
-
return false;
|
|
1069
|
-
}
|
|
1070
|
-
if (null !== state.anchor) {
|
|
1071
|
-
throwError(state, 'duplication of an anchor property');
|
|
1072
|
-
}
|
|
1073
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1074
|
-
_position = state.position;
|
|
1075
|
-
while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
|
1076
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1077
|
-
}
|
|
1078
|
-
if (state.position === _position) {
|
|
1079
|
-
throwError(state, 'name of an anchor node must contain at least one character');
|
|
1080
|
-
}
|
|
1081
|
-
state.anchor = state.input.slice(_position, state.position);
|
|
1082
|
-
return true;
|
|
1083
|
-
}
|
|
1084
|
-
function readAlias(state) {
|
|
1085
|
-
var _position, alias, len = state.length, input = state.input, ch;
|
|
1086
|
-
ch = state.input.charCodeAt(state.position);
|
|
1087
|
-
if (0x2A !== ch) {
|
|
1088
|
-
return false;
|
|
1089
|
-
}
|
|
1090
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1091
|
-
_position = state.position;
|
|
1092
|
-
while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
|
|
1093
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1094
|
-
}
|
|
1095
|
-
if (state.position <= _position) {
|
|
1096
|
-
throwError(state, 'name of an alias node must contain at least one character');
|
|
1097
|
-
state.position = _position + 1;
|
|
1098
|
-
}
|
|
1099
|
-
alias = state.input.slice(_position, state.position);
|
|
1100
|
-
if (!state.anchorMap.hasOwnProperty(alias)) {
|
|
1101
|
-
throwError(state, 'unidentified alias "' + alias + '"');
|
|
1102
|
-
if (state.position <= _position) {
|
|
1103
|
-
state.position = _position + 1;
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
state.result = ast.newAnchorRef(alias, _position, state.position, state.anchorMap[alias]);
|
|
1107
|
-
skipSeparationSpace(state, true, -1);
|
|
1108
|
-
return true;
|
|
1109
|
-
}
|
|
1110
|
-
function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
|
|
1111
|
-
var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, type, flowIndent, blockIndent, _result;
|
|
1112
|
-
state.tag = null;
|
|
1113
|
-
state.anchor = null;
|
|
1114
|
-
state.kind = null;
|
|
1115
|
-
state.result = null;
|
|
1116
|
-
allowBlockStyles = allowBlockScalars = allowBlockCollections =
|
|
1117
|
-
CONTEXT_BLOCK_OUT === nodeContext ||
|
|
1118
|
-
CONTEXT_BLOCK_IN === nodeContext;
|
|
1119
|
-
if (allowToSeek) {
|
|
1120
|
-
if (skipSeparationSpace(state, true, -1)) {
|
|
1121
|
-
atNewLine = true;
|
|
1122
|
-
if (state.lineIndent > parentIndent) {
|
|
1123
|
-
indentStatus = 1;
|
|
1124
|
-
}
|
|
1125
|
-
else if (state.lineIndent === parentIndent) {
|
|
1126
|
-
indentStatus = 0;
|
|
1127
|
-
}
|
|
1128
|
-
else if (state.lineIndent < parentIndent) {
|
|
1129
|
-
indentStatus = -1;
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
}
|
|
1133
|
-
var tagStart = state.position;
|
|
1134
|
-
var tagColumn = state.position - state.lineStart;
|
|
1135
|
-
if (1 === indentStatus) {
|
|
1136
|
-
while (readTagProperty(state) || readAnchorProperty(state)) {
|
|
1137
|
-
if (skipSeparationSpace(state, true, -1)) {
|
|
1138
|
-
atNewLine = true;
|
|
1139
|
-
allowBlockCollections = allowBlockStyles;
|
|
1140
|
-
if (state.lineIndent > parentIndent) {
|
|
1141
|
-
indentStatus = 1;
|
|
1142
|
-
}
|
|
1143
|
-
else if (state.lineIndent === parentIndent) {
|
|
1144
|
-
indentStatus = 0;
|
|
1145
|
-
}
|
|
1146
|
-
else if (state.lineIndent < parentIndent) {
|
|
1147
|
-
indentStatus = -1;
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
else {
|
|
1151
|
-
allowBlockCollections = false;
|
|
1152
|
-
}
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
if (allowBlockCollections) {
|
|
1156
|
-
allowBlockCollections = atNewLine || allowCompact;
|
|
1157
|
-
}
|
|
1158
|
-
if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) {
|
|
1159
|
-
if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
|
|
1160
|
-
flowIndent = parentIndent;
|
|
1161
|
-
}
|
|
1162
|
-
else {
|
|
1163
|
-
flowIndent = parentIndent + 1;
|
|
1164
|
-
}
|
|
1165
|
-
blockIndent = state.position - state.lineStart;
|
|
1166
|
-
if (1 === indentStatus) {
|
|
1167
|
-
if (allowBlockCollections &&
|
|
1168
|
-
(readBlockSequence(state, blockIndent) ||
|
|
1169
|
-
readBlockMapping(state, blockIndent, flowIndent)) ||
|
|
1170
|
-
readFlowCollection(state, flowIndent)) {
|
|
1171
|
-
hasContent = true;
|
|
1172
|
-
}
|
|
1173
|
-
else {
|
|
1174
|
-
if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
|
|
1175
|
-
readSingleQuotedScalar(state, flowIndent) ||
|
|
1176
|
-
readDoubleQuotedScalar(state, flowIndent)) {
|
|
1177
|
-
hasContent = true;
|
|
1178
|
-
}
|
|
1179
|
-
else if (readAlias(state)) {
|
|
1180
|
-
hasContent = true;
|
|
1181
|
-
if (null !== state.tag || null !== state.anchor) {
|
|
1182
|
-
throwError(state, 'alias node should not have any properties');
|
|
1183
|
-
}
|
|
1184
|
-
}
|
|
1185
|
-
else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
|
|
1186
|
-
hasContent = true;
|
|
1187
|
-
if (null === state.tag) {
|
|
1188
|
-
state.tag = '?';
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
if (null !== state.anchor) {
|
|
1192
|
-
state.anchorMap[state.anchor] = state.result;
|
|
1193
|
-
state.result.anchorId = state.anchor;
|
|
1194
|
-
}
|
|
1195
|
-
}
|
|
1196
|
-
}
|
|
1197
|
-
else if (0 === indentStatus) {
|
|
1198
|
-
hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
|
|
1199
|
-
}
|
|
1200
|
-
}
|
|
1201
|
-
if (null !== state.tag && '!' !== state.tag) {
|
|
1202
|
-
if (state.tag == "!include") {
|
|
1203
|
-
if (!state.result) {
|
|
1204
|
-
state.result = ast.newScalar();
|
|
1205
|
-
state.result.startPosition = state.position;
|
|
1206
|
-
state.result.endPosition = state.position;
|
|
1207
|
-
throwError(state, "!include without value");
|
|
1208
|
-
}
|
|
1209
|
-
state.result.kind = ast.Kind.INCLUDE_REF;
|
|
1210
|
-
}
|
|
1211
|
-
else if ('?' === state.tag) {
|
|
1212
|
-
for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
|
|
1213
|
-
type = state.implicitTypes[typeIndex];
|
|
1214
|
-
var vl = state.result['value'];
|
|
1215
|
-
if (type.resolve(vl)) {
|
|
1216
|
-
state.result.valueObject = type.construct(state.result['value']);
|
|
1217
|
-
state.tag = type.tag;
|
|
1218
|
-
if (null !== state.anchor) {
|
|
1219
|
-
state.result.anchorId = state.anchor;
|
|
1220
|
-
state.anchorMap[state.anchor] = state.result;
|
|
1221
|
-
}
|
|
1222
|
-
break;
|
|
1223
|
-
}
|
|
1224
|
-
}
|
|
1225
|
-
}
|
|
1226
|
-
else if (_hasOwnProperty.call(state.typeMap, state.tag)) {
|
|
1227
|
-
type = state.typeMap[state.tag];
|
|
1228
|
-
if (null !== state.result && type.kind !== state.kind) {
|
|
1229
|
-
throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
|
|
1230
|
-
}
|
|
1231
|
-
if (!type.resolve(state.result)) {
|
|
1232
|
-
throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
|
|
1233
|
-
}
|
|
1234
|
-
else {
|
|
1235
|
-
state.result = type.construct(state.result);
|
|
1236
|
-
if (null !== state.anchor) {
|
|
1237
|
-
state.result.anchorId = state.anchor;
|
|
1238
|
-
state.anchorMap[state.anchor] = state.result;
|
|
1239
|
-
}
|
|
1240
|
-
}
|
|
1241
|
-
}
|
|
1242
|
-
else {
|
|
1243
|
-
throwErrorFromPosition(state, tagStart, 'unknown tag <' + state.tag + '>', false, true);
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
return null !== state.tag || null !== state.anchor || hasContent;
|
|
1247
|
-
}
|
|
1248
|
-
function readDocument(state) {
|
|
1249
|
-
var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
|
|
1250
|
-
state.version = null;
|
|
1251
|
-
state.checkLineBreaks = state.legacy;
|
|
1252
|
-
state.tagMap = {};
|
|
1253
|
-
state.anchorMap = {};
|
|
1254
|
-
while (0 !== (ch = state.input.charCodeAt(state.position))) {
|
|
1255
|
-
skipSeparationSpace(state, true, -1);
|
|
1256
|
-
ch = state.input.charCodeAt(state.position);
|
|
1257
|
-
if (state.lineIndent > 0 || 0x25 !== ch) {
|
|
1258
|
-
break;
|
|
1259
|
-
}
|
|
1260
|
-
hasDirectives = true;
|
|
1261
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1262
|
-
_position = state.position;
|
|
1263
|
-
while (0 !== ch && !is_WS_OR_EOL(ch)) {
|
|
1264
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1265
|
-
}
|
|
1266
|
-
directiveName = state.input.slice(_position, state.position);
|
|
1267
|
-
directiveArgs = [];
|
|
1268
|
-
if (directiveName.length < 1) {
|
|
1269
|
-
throwError(state, 'directive name must not be less than one character in length');
|
|
1270
|
-
}
|
|
1271
|
-
while (0 !== ch) {
|
|
1272
|
-
while (is_WHITE_SPACE(ch)) {
|
|
1273
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1274
|
-
}
|
|
1275
|
-
if (0x23 === ch) {
|
|
1276
|
-
do {
|
|
1277
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1278
|
-
} while (0 !== ch && !is_EOL(ch));
|
|
1279
|
-
break;
|
|
1280
|
-
}
|
|
1281
|
-
if (is_EOL(ch)) {
|
|
1282
|
-
break;
|
|
1283
|
-
}
|
|
1284
|
-
_position = state.position;
|
|
1285
|
-
while (0 !== ch && !is_WS_OR_EOL(ch)) {
|
|
1286
|
-
ch = state.input.charCodeAt(++state.position);
|
|
1287
|
-
}
|
|
1288
|
-
directiveArgs.push(state.input.slice(_position, state.position));
|
|
1289
|
-
}
|
|
1290
|
-
if (0 !== ch) {
|
|
1291
|
-
readLineBreak(state);
|
|
1292
|
-
}
|
|
1293
|
-
if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
|
|
1294
|
-
directiveHandlers[directiveName](state, directiveName, directiveArgs);
|
|
1295
|
-
}
|
|
1296
|
-
else {
|
|
1297
|
-
throwWarning(state, 'unknown document directive "' + directiveName + '"');
|
|
1298
|
-
state.position++;
|
|
1299
|
-
}
|
|
1300
|
-
}
|
|
1301
|
-
skipSeparationSpace(state, true, -1);
|
|
1302
|
-
if (0 === state.lineIndent &&
|
|
1303
|
-
0x2D === state.input.charCodeAt(state.position) &&
|
|
1304
|
-
0x2D === state.input.charCodeAt(state.position + 1) &&
|
|
1305
|
-
0x2D === state.input.charCodeAt(state.position + 2)) {
|
|
1306
|
-
state.position += 3;
|
|
1307
|
-
skipSeparationSpace(state, true, -1);
|
|
1308
|
-
}
|
|
1309
|
-
else if (hasDirectives) {
|
|
1310
|
-
throwError(state, 'directives end mark is expected');
|
|
1311
|
-
}
|
|
1312
|
-
composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
|
|
1313
|
-
skipSeparationSpace(state, true, -1);
|
|
1314
|
-
if (state.checkLineBreaks &&
|
|
1315
|
-
PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
|
|
1316
|
-
throwWarning(state, 'non-ASCII line breaks are interpreted as content');
|
|
1317
|
-
}
|
|
1318
|
-
state.documents.push(state.result);
|
|
1319
|
-
if (state.position === state.lineStart && testDocumentSeparator(state)) {
|
|
1320
|
-
if (0x2E === state.input.charCodeAt(state.position)) {
|
|
1321
|
-
state.position += 3;
|
|
1322
|
-
skipSeparationSpace(state, true, -1);
|
|
1323
|
-
}
|
|
1324
|
-
return;
|
|
1325
|
-
}
|
|
1326
|
-
if (state.position < (state.length - 1)) {
|
|
1327
|
-
throwError(state, 'end of the stream or a document separator is expected');
|
|
1328
|
-
}
|
|
1329
|
-
else {
|
|
1330
|
-
return;
|
|
1331
|
-
}
|
|
1332
|
-
}
|
|
1333
|
-
function loadDocuments(input, options) {
|
|
1334
|
-
input = String(input);
|
|
1335
|
-
options = options || {};
|
|
1336
|
-
var inputLength = input.length;
|
|
1337
|
-
if (inputLength !== 0) {
|
|
1338
|
-
if (0x0A !== input.charCodeAt(inputLength - 1) &&
|
|
1339
|
-
0x0D !== input.charCodeAt(inputLength - 1)) {
|
|
1340
|
-
input += '\n';
|
|
1341
|
-
}
|
|
1342
|
-
if (input.charCodeAt(0) === 0xFEFF) {
|
|
1343
|
-
input = input.slice(1);
|
|
1344
|
-
}
|
|
1345
|
-
}
|
|
1346
|
-
var state = new State(input, options);
|
|
1347
|
-
state.input += '\0';
|
|
1348
|
-
while (0x20 === state.input.charCodeAt(state.position)) {
|
|
1349
|
-
state.lineIndent += 1;
|
|
1350
|
-
state.position += 1;
|
|
1351
|
-
}
|
|
1352
|
-
while (state.position < (state.length - 1)) {
|
|
1353
|
-
var q = state.position;
|
|
1354
|
-
readDocument(state);
|
|
1355
|
-
if (state.position <= q) {
|
|
1356
|
-
for (; state.position < state.length - 1; state.position++) {
|
|
1357
|
-
var c = state.input.charAt(state.position);
|
|
1358
|
-
if (c == '\n') {
|
|
1359
|
-
break;
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
}
|
|
1363
|
-
}
|
|
1364
|
-
var documents = state.documents;
|
|
1365
|
-
var docsCount = documents.length;
|
|
1366
|
-
if (docsCount > 0) {
|
|
1367
|
-
documents[docsCount - 1].endPosition = inputLength;
|
|
1368
|
-
}
|
|
1369
|
-
for (var _i = 0, documents_1 = documents; _i < documents_1.length; _i++) {
|
|
1370
|
-
var x = documents_1[_i];
|
|
1371
|
-
x.errors = state.errors;
|
|
1372
|
-
if (x.startPosition > x.endPosition) {
|
|
1373
|
-
x.startPosition = x.endPosition;
|
|
1374
|
-
}
|
|
1375
|
-
}
|
|
1376
|
-
return documents;
|
|
1377
|
-
}
|
|
1378
|
-
function loadAll(input, iterator, options) {
|
|
1379
|
-
if (options === void 0) { options = {}; }
|
|
1380
|
-
var documents = loadDocuments(input, options), index, length;
|
|
1381
|
-
for (index = 0, length = documents.length; index < length; index += 1) {
|
|
1382
|
-
iterator(documents[index]);
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1385
|
-
exports.loadAll = loadAll;
|
|
1386
|
-
function load(input, options) {
|
|
1387
|
-
if (options === void 0) { options = {}; }
|
|
1388
|
-
var documents = loadDocuments(input, options), index, length;
|
|
1389
|
-
if (0 === documents.length) {
|
|
1390
|
-
return undefined;
|
|
1391
|
-
}
|
|
1392
|
-
else if (1 === documents.length) {
|
|
1393
|
-
return documents[0];
|
|
1394
|
-
}
|
|
1395
|
-
var e = new YAMLException('expected a single document in the stream, but found more');
|
|
1396
|
-
e.mark = new Mark("", "", 0, 0, 0);
|
|
1397
|
-
e.mark.position = documents[0].endPosition;
|
|
1398
|
-
documents[0].errors.push(e);
|
|
1399
|
-
return documents[0];
|
|
1400
|
-
}
|
|
1401
|
-
exports.load = load;
|
|
1402
|
-
function safeLoadAll(input, output, options) {
|
|
1403
|
-
if (options === void 0) { options = {}; }
|
|
1404
|
-
loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
|
|
1405
|
-
}
|
|
1406
|
-
exports.safeLoadAll = safeLoadAll;
|
|
1407
|
-
function safeLoad(input, options) {
|
|
1408
|
-
if (options === void 0) { options = {}; }
|
|
1409
|
-
return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
|
|
1410
|
-
}
|
|
1411
|
-
exports.safeLoad = safeLoad;
|
|
1412
|
-
module.exports.loadAll = loadAll;
|
|
1413
|
-
module.exports.load = load;
|
|
1414
|
-
module.exports.safeLoadAll = safeLoadAll;
|
|
1415
|
-
module.exports.safeLoad = safeLoad;
|
|
1416
|
-
//# sourceMappingURL=loader.js.map
|