Galerie und tage
This commit is contained in:
501
node_modules/js-yaml/CHANGELOG.md
generated
vendored
501
node_modules/js-yaml/CHANGELOG.md
generated
vendored
@@ -1,275 +1,179 @@
|
||||
# Changelog
|
||||
3.6.1 / 2016-05-11
|
||||
------------------
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
|
||||
## [3.14.1] - 2020-12-07
|
||||
### Security
|
||||
- Fix possible code execution in (already unsafe) `.load()` (in &anchor).
|
||||
|
||||
|
||||
## [3.14.0] - 2020-05-22
|
||||
### Changed
|
||||
- Support `safe/loadAll(input, options)` variant of call.
|
||||
- CI: drop outdated nodejs versions.
|
||||
- Dev deps bump.
|
||||
|
||||
### Fixed
|
||||
- Quote `=` in plain scalars #519.
|
||||
- Check the node type for `!<?>` tag in case user manually specifies it.
|
||||
- Verify that there are no null-bytes in input.
|
||||
- Fix wrong quote position when writing condensed flow, #526.
|
||||
|
||||
|
||||
## [3.13.1] - 2019-04-05
|
||||
### Security
|
||||
- Fix possible code execution in (already unsafe) `.load()`, #480.
|
||||
|
||||
|
||||
## [3.13.0] - 2019-03-20
|
||||
### Security
|
||||
- Security fix: `safeLoad()` can hang when arrays with nested refs
|
||||
used as key. Now throws exception for nested arrays. #475.
|
||||
|
||||
|
||||
## [3.12.2] - 2019-02-26
|
||||
### Fixed
|
||||
- Fix `noArrayIndent` option for root level, #468.
|
||||
|
||||
|
||||
## [3.12.1] - 2019-01-05
|
||||
### Added
|
||||
- Added `noArrayIndent` option, #432.
|
||||
|
||||
|
||||
## [3.12.0] - 2018-06-02
|
||||
### Changed
|
||||
- Support arrow functions without a block statement, #421.
|
||||
|
||||
|
||||
## [3.11.0] - 2018-03-05
|
||||
### Added
|
||||
- Add arrow functions suport for `!!js/function`.
|
||||
|
||||
### Fixed
|
||||
- Fix dump in bin/octal/hex formats for negative integers, #399.
|
||||
|
||||
|
||||
## [3.10.0] - 2017-09-10
|
||||
### Fixed
|
||||
- Fix `condenseFlow` output (quote keys for sure, instead of spaces), #371, #370.
|
||||
- Dump astrals as codepoints instead of surrogate pair, #368.
|
||||
|
||||
|
||||
## [3.9.1] - 2017-07-08
|
||||
### Fixed
|
||||
- Ensure stack is present for custom errors in node 7.+, #351.
|
||||
|
||||
|
||||
## [3.9.0] - 2017-07-08
|
||||
### Added
|
||||
- Add `condenseFlow` option (to create pretty URL query params), #346.
|
||||
|
||||
### Fixed
|
||||
- Support array return from safeLoadAll/loadAll, #350.
|
||||
|
||||
|
||||
## [3.8.4] - 2017-05-08
|
||||
### Fixed
|
||||
- Dumper: prevent space after dash for arrays that wrap, #343.
|
||||
|
||||
|
||||
## [3.8.3] - 2017-04-05
|
||||
### Fixed
|
||||
- Should not allow numbers to begin and end with underscore, #335.
|
||||
|
||||
|
||||
## [3.8.2] - 2017-03-02
|
||||
### Fixed
|
||||
- Fix `!!float 123` (integers) parse, #333.
|
||||
- Don't allow leading zeros in floats (except 0, 0.xxx).
|
||||
- Allow positive exponent without sign in floats.
|
||||
|
||||
|
||||
## [3.8.1] - 2017-02-07
|
||||
### Changed
|
||||
- Maintenance: update browserified build.
|
||||
|
||||
|
||||
## [3.8.0] - 2017-02-07
|
||||
### Fixed
|
||||
- Fix reported position for `duplicated mapping key` errors.
|
||||
Now points to block start instead of block end.
|
||||
(#243, thanks to @shockey).
|
||||
|
||||
|
||||
## [3.7.0] - 2016-11-12
|
||||
### Added
|
||||
- Support polymorphism for tags (#300, thanks to @monken).
|
||||
|
||||
### Fixed
|
||||
- Fix parsing of quotes followed by newlines (#304, thanks to @dplepage).
|
||||
|
||||
|
||||
## [3.6.1] - 2016-05-11
|
||||
### Fixed
|
||||
- Fix output cut on a pipe, #286.
|
||||
|
||||
|
||||
## [3.6.0] - 2016-04-16
|
||||
### Fixed
|
||||
3.6.0 / 2016-04-16
|
||||
------------------
|
||||
|
||||
- Dumper rewrite, fix multiple bugs with trailing `\n`.
|
||||
Big thanks to @aepsilon!
|
||||
- Loader: fix leading/trailing newlines in block scalars, @aepsilon.
|
||||
|
||||
|
||||
## [3.5.5] - 2016-03-17
|
||||
### Fixed
|
||||
3.5.5 / 2016-03-17
|
||||
------------------
|
||||
|
||||
- Date parse fix: don't allow dates with on digit in month and day, #268.
|
||||
|
||||
|
||||
## [3.5.4] - 2016-03-09
|
||||
### Added
|
||||
3.5.4 / 2016-03-09
|
||||
------------------
|
||||
|
||||
- `noCompatMode` for dumper, to disable quoting YAML 1.1 values.
|
||||
|
||||
|
||||
## [3.5.3] - 2016-02-11
|
||||
### Changed
|
||||
3.5.3 / 2016-02-11
|
||||
------------------
|
||||
|
||||
- Maintenance release.
|
||||
|
||||
|
||||
## [3.5.2] - 2016-01-11
|
||||
### Changed
|
||||
3.5.2 / 2016-01-11
|
||||
------------------
|
||||
|
||||
- Maintenance: missed comma in bower config.
|
||||
|
||||
|
||||
## [3.5.1] - 2016-01-11
|
||||
### Changed
|
||||
3.5.1 / 2016-01-11
|
||||
------------------
|
||||
|
||||
- Removed `inherit` dependency, #239.
|
||||
- Better browserify workaround for esprima load.
|
||||
- Demo rewrite.
|
||||
|
||||
|
||||
## [3.5.0] - 2016-01-10
|
||||
### Fixed
|
||||
3.5.0 / 2016-01-10
|
||||
------------------
|
||||
|
||||
- Dumper. Fold strings only, #217.
|
||||
- Dumper. `norefs` option, to clone linked objects, #229.
|
||||
- Loader. Throw a warning for duplicate keys, #166.
|
||||
- Improved browserify support (mark `esprima` & `Buffer` excluded).
|
||||
|
||||
|
||||
## [3.4.6] - 2015-11-26
|
||||
### Changed
|
||||
3.4.6 / 2015-11-26
|
||||
------------------
|
||||
|
||||
- Use standalone `inherit` to keep browserified files clear.
|
||||
|
||||
|
||||
## [3.4.5] - 2015-11-23
|
||||
### Added
|
||||
3.4.5 / 2015-11-23
|
||||
------------------
|
||||
|
||||
- Added `lineWidth` option to dumper.
|
||||
|
||||
|
||||
## [3.4.4] - 2015-11-21
|
||||
### Fixed
|
||||
3.4.4 / 2015-11-21
|
||||
------------------
|
||||
|
||||
- Fixed floats dump (missed dot for scientific format), #220.
|
||||
- Allow non-printable characters inside quoted scalars, #192.
|
||||
|
||||
|
||||
## [3.4.3] - 2015-10-10
|
||||
### Changed
|
||||
3.4.3 / 2015-10-10
|
||||
------------------
|
||||
|
||||
- Maintenance release - deps bump (esprima, argparse).
|
||||
|
||||
|
||||
## [3.4.2] - 2015-09-09
|
||||
### Fixed
|
||||
3.4.2 / 2015-09-09
|
||||
------------------
|
||||
|
||||
- Fixed serialization of duplicated entries in sequences, #205.
|
||||
Thanks to @vogelsgesang.
|
||||
|
||||
|
||||
## [3.4.1] - 2015-09-05
|
||||
### Fixed
|
||||
3.4.1 / 2015-09-05
|
||||
------------------
|
||||
|
||||
- Fixed stacktrace handling in generated errors, for browsers (FF/IE).
|
||||
|
||||
|
||||
## [3.4.0] - 2015-08-23
|
||||
### Changed
|
||||
- Don't throw on warnings anymore. Use `onWarning` option to catch.
|
||||
3.4.0 / 2015-08-23
|
||||
------------------
|
||||
|
||||
- Fixed multiline keys dump, #197. Thanks to @tcr.
|
||||
- Don't throw on warnongs anymore. Use `onWarning` option to catch.
|
||||
- Throw error on unknown tags (was warning before).
|
||||
- Fixed heading line breaks in some scalars (regression).
|
||||
- Reworked internals of error class.
|
||||
|
||||
### Fixed
|
||||
- Fixed multiline keys dump, #197. Thanks to @tcr.
|
||||
- Fixed heading line breaks in some scalars (regression).
|
||||
|
||||
3.3.1 / 2015-05-13
|
||||
------------------
|
||||
|
||||
## [3.3.1] - 2015-05-13
|
||||
### Added
|
||||
- Added `.sortKeys` dumper option, thanks to @rjmunro.
|
||||
|
||||
### Fixed
|
||||
- Fixed astral characters support, #191.
|
||||
|
||||
|
||||
## [3.3.0] - 2015-04-26
|
||||
### Changed
|
||||
3.3.0 / 2015-04-26
|
||||
------------------
|
||||
|
||||
- Significantly improved long strings formatting in dumper, thanks to @isaacs.
|
||||
- Strip BOM if exists.
|
||||
|
||||
|
||||
## [3.2.7] - 2015-02-19
|
||||
### Changed
|
||||
3.2.7 / 2015-02-19
|
||||
------------------
|
||||
|
||||
- Maintenance release.
|
||||
- Updated dependencies.
|
||||
- HISTORY.md -> CHANGELOG.md
|
||||
|
||||
|
||||
## [3.2.6] - 2015-02-07
|
||||
### Fixed
|
||||
3.2.6 / 2015-02-07
|
||||
------------------
|
||||
|
||||
- Fixed encoding of UTF-16 surrogate pairs. (e.g. "\U0001F431" CAT FACE).
|
||||
- Fixed demo dates dump (#113, thanks to @Hypercubed).
|
||||
|
||||
|
||||
## [3.2.5] - 2014-12-28
|
||||
### Fixed
|
||||
3.2.5 / 2014-12-28
|
||||
------------------
|
||||
|
||||
- Fixed resolving of all built-in types on empty nodes.
|
||||
- Fixed invalid warning on empty lines within quoted scalars and flow collections.
|
||||
- Fixed bug: Tag on an empty node didn't resolve in some cases.
|
||||
|
||||
|
||||
## [3.2.4] - 2014-12-19
|
||||
### Fixed
|
||||
3.2.4 / 2014-12-19
|
||||
------------------
|
||||
|
||||
- Fixed resolving of !!null tag on an empty node.
|
||||
|
||||
|
||||
## [3.2.3] - 2014-11-08
|
||||
### Fixed
|
||||
3.2.3 / 2014-11-08
|
||||
------------------
|
||||
|
||||
- Implemented dumping of objects with circular and cross references.
|
||||
- Partially fixed aliasing of constructed objects. (see issue #141 for details)
|
||||
|
||||
|
||||
## [3.2.2] - 2014-09-07
|
||||
### Fixed
|
||||
3.2.2 / 2014-09-07
|
||||
------------------
|
||||
|
||||
- Fixed infinite loop on unindented block scalars.
|
||||
- Rewritten base64 encode/decode in binary type, to keep code licence clear.
|
||||
|
||||
|
||||
## [3.2.1] - 2014-08-24
|
||||
### Fixed
|
||||
3.2.1 / 2014-08-24
|
||||
------------------
|
||||
|
||||
- Nothig new. Just fix npm publish error.
|
||||
|
||||
|
||||
## [3.2.0] - 2014-08-24
|
||||
### Added
|
||||
- Added input piping support to CLI.
|
||||
3.2.0 / 2014-08-24
|
||||
------------------
|
||||
|
||||
### Fixed
|
||||
- Added input piping support to CLI.
|
||||
- Fixed typo, that could cause hand on initial indent (#139).
|
||||
|
||||
|
||||
## [3.1.0] - 2014-07-07
|
||||
### Changed
|
||||
3.1.0 / 2014-07-07
|
||||
------------------
|
||||
|
||||
- 1.5x-2x speed boost.
|
||||
- Removed deprecated `require('xxx.yml')` support.
|
||||
- Significant code cleanup and refactoring.
|
||||
@@ -282,112 +186,127 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Bugfixes.
|
||||
|
||||
|
||||
## [3.0.2] - 2014-02-27
|
||||
### Fixed
|
||||
3.0.2 / 2014-02-27
|
||||
------------------
|
||||
|
||||
- Fixed bug: "constructor" string parsed as `null`.
|
||||
|
||||
|
||||
## [3.0.1] - 2013-12-22
|
||||
### Fixed
|
||||
3.0.1 / 2013-12-22
|
||||
------------------
|
||||
|
||||
- Fixed parsing of literal scalars. (issue #108)
|
||||
- Prevented adding unnecessary spaces in object dumps. (issue #68)
|
||||
- Fixed dumping of objects with very long (> 1024 in length) keys.
|
||||
|
||||
|
||||
## [3.0.0] - 2013-12-16
|
||||
### Changed
|
||||
3.0.0 / 2013-12-16
|
||||
------------------
|
||||
|
||||
- Refactored code. Changed API for custom types.
|
||||
- Removed output colors in CLI, dump json by default.
|
||||
- Removed big dependencies from browser version (esprima, buffer). Load `esprima` manually, if `!!js/function` needed. `!!bin` now returns Array in browser
|
||||
- Removed big dependencies from browser version (esprima, buffer)
|
||||
- load `esprima` manually, if !!js/function needed
|
||||
- !!bin now returns Array in browser
|
||||
- AMD support.
|
||||
- Don't quote dumped strings because of `-` & `?` (if not first char).
|
||||
- __Deprecated__ loading yaml files via `require()`, as not recommended
|
||||
behaviour for node.
|
||||
|
||||
|
||||
## [2.1.3] - 2013-10-16
|
||||
### Fixed
|
||||
2.1.3 / 2013-10-16
|
||||
------------------
|
||||
|
||||
- Fix wrong loading of empty block scalars.
|
||||
|
||||
|
||||
## [2.1.2] - 2013-10-07
|
||||
### Fixed
|
||||
2.1.2 / 2013-10-07
|
||||
------------------
|
||||
|
||||
- Fix unwanted line breaks in folded scalars.
|
||||
|
||||
|
||||
## [2.1.1] - 2013-10-02
|
||||
### Fixed
|
||||
2.1.1 / 2013-10-02
|
||||
------------------
|
||||
|
||||
- Dumper now respects deprecated booleans syntax from YAML 1.0/1.1
|
||||
- Fixed reader bug in JSON-like sequences/mappings.
|
||||
|
||||
|
||||
## [2.1.0] - 2013-06-05
|
||||
### Added
|
||||
2.1.0 / 2013-06-05
|
||||
------------------
|
||||
|
||||
- Add standard YAML schemas: Failsafe (`FAILSAFE_SCHEMA`),
|
||||
JSON (`JSON_SCHEMA`) and Core (`CORE_SCHEMA`).
|
||||
- Add `skipInvalid` dumper option.
|
||||
|
||||
### Changed
|
||||
- Rename `DEFAULT_SCHEMA` to `DEFAULT_FULL_SCHEMA`
|
||||
and `SAFE_SCHEMA` to `DEFAULT_SAFE_SCHEMA`.
|
||||
- Bug fix: export `NIL` constant from the public interface.
|
||||
- Add `skipInvalid` dumper option.
|
||||
- Use `safeLoad` for `require` extension.
|
||||
|
||||
### Fixed
|
||||
- Bug fix: export `NIL` constant from the public interface.
|
||||
|
||||
2.0.5 / 2013-04-26
|
||||
------------------
|
||||
|
||||
## [2.0.5] - 2013-04-26
|
||||
### Security
|
||||
- Close security issue in !!js/function constructor.
|
||||
Big thanks to @nealpoole for security audit.
|
||||
|
||||
|
||||
## [2.0.4] - 2013-04-08
|
||||
### Changed
|
||||
2.0.4 / 2013-04-08
|
||||
------------------
|
||||
|
||||
- Updated .npmignore to reduce package size
|
||||
|
||||
|
||||
## [2.0.3] - 2013-02-26
|
||||
### Fixed
|
||||
2.0.3 / 2013-02-26
|
||||
------------------
|
||||
|
||||
- Fixed dumping of empty arrays ans objects. ([] and {} instead of null)
|
||||
|
||||
|
||||
## [2.0.2] - 2013-02-15
|
||||
### Fixed
|
||||
2.0.2 / 2013-02-15
|
||||
------------------
|
||||
|
||||
- Fixed input validation: tabs are printable characters.
|
||||
|
||||
|
||||
## [2.0.1] - 2013-02-09
|
||||
### Fixed
|
||||
2.0.1 / 2013-02-09
|
||||
------------------
|
||||
|
||||
- Fixed error, when options not passed to function cass
|
||||
|
||||
|
||||
## [2.0.0] - 2013-02-09
|
||||
### Changed
|
||||
2.0.0 / 2013-02-09
|
||||
------------------
|
||||
|
||||
- Full rewrite. New architecture. Fast one-stage parsing.
|
||||
- Changed custom types API.
|
||||
- Added YAML dumper.
|
||||
|
||||
|
||||
## [1.0.3] - 2012-11-05
|
||||
### Fixed
|
||||
1.0.3 / 2012-11-05
|
||||
------------------
|
||||
|
||||
- Fixed utf-8 files loading.
|
||||
|
||||
|
||||
## [1.0.2] - 2012-08-02
|
||||
### Fixed
|
||||
1.0.2 / 2012-08-02
|
||||
------------------
|
||||
|
||||
- Pull out hand-written shims. Use ES5-Shims for old browsers support. See #44.
|
||||
- Fix timstamps incorectly parsed in local time when no time part specified.
|
||||
|
||||
|
||||
## [1.0.1] - 2012-07-07
|
||||
### Fixed
|
||||
1.0.1 / 2012-07-07
|
||||
------------------
|
||||
|
||||
- Fixes `TypeError: 'undefined' is not an object` under Safari. Thanks Phuong.
|
||||
- Fix timestamps incorrectly parsed in local time. Thanks @caolan. Closes #46.
|
||||
|
||||
|
||||
## [1.0.0] - 2012-07-01
|
||||
### Changed
|
||||
1.0.0 / 2012-07-01
|
||||
------------------
|
||||
|
||||
- `y`, `yes`, `n`, `no`, `on`, `off` are not converted to Booleans anymore.
|
||||
Fixes #42.
|
||||
- `require(filename)` now returns a single document and throws an Error if
|
||||
@@ -395,163 +314,89 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- CLI was merged back from js-yaml.bin
|
||||
|
||||
|
||||
## [0.3.7] - 2012-02-28
|
||||
### Fixed
|
||||
0.3.7 / 2012-02-28
|
||||
------------------
|
||||
|
||||
- Fix export of `addConstructor()`. Closes #39.
|
||||
|
||||
|
||||
## [0.3.6] - 2012-02-22
|
||||
### Changed
|
||||
- Removed AMD parts - too buggy to use. Need help to rewrite from scratch
|
||||
0.3.6 / 2012-02-22
|
||||
------------------
|
||||
|
||||
### Fixed
|
||||
- Removed AMD parts - too buggy to use. Need help to rewrite from scratch
|
||||
- Removed YUI compressor warning (renamed `double` variable). Closes #40.
|
||||
|
||||
|
||||
## [0.3.5] - 2012-01-10
|
||||
### Fixed
|
||||
0.3.5 / 2012-01-10
|
||||
------------------
|
||||
|
||||
- Workagound for .npmignore fuckup under windows. Thanks to airportyh.
|
||||
|
||||
|
||||
## [0.3.4] - 2011-12-24
|
||||
### Fixed
|
||||
0.3.4 / 2011-12-24
|
||||
------------------
|
||||
|
||||
- Fixes str[] for oldIEs support.
|
||||
- Adds better has change support for browserified demo.
|
||||
- improves compact output of Error. Closes #33.
|
||||
|
||||
|
||||
## [0.3.3] - 2011-12-20
|
||||
### Added
|
||||
0.3.3 / 2011-12-20
|
||||
------------------
|
||||
|
||||
- jsyaml executable moved to separate module.
|
||||
- adds `compact` stringification of Errors.
|
||||
|
||||
### Changed
|
||||
- jsyaml executable moved to separate module.
|
||||
|
||||
0.3.2 / 2011-12-16
|
||||
------------------
|
||||
|
||||
## [0.3.2] - 2011-12-16
|
||||
### Added
|
||||
- Added jsyaml executable.
|
||||
- Added !!js/function support. Closes #12.
|
||||
|
||||
### Fixed
|
||||
- Fixes ug with block style scalars. Closes #26.
|
||||
- All sources are passing JSLint now.
|
||||
- Fixes bug in Safari. Closes #28.
|
||||
- Fixes bug in Opers. Closes #29.
|
||||
- Improves browser support. Closes #20.
|
||||
- Added jsyaml executable.
|
||||
- Added !!js/function support. Closes #12.
|
||||
|
||||
|
||||
## [0.3.1] - 2011-11-18
|
||||
### Added
|
||||
0.3.1 / 2011-11-18
|
||||
------------------
|
||||
|
||||
- Added AMD support for browserified version.
|
||||
- Wrapped browserified js-yaml into closure.
|
||||
- Fixed the resolvement of non-specific tags. Closes #17.
|
||||
- Added permalinks for online demo YAML snippets. Now we have YPaste service, lol.
|
||||
- Added !!js/regexp and !!js/undefined types. Partially solves #12.
|
||||
|
||||
### Changed
|
||||
- Wrapped browserified js-yaml into closure.
|
||||
|
||||
### Fixed
|
||||
- Fixed the resolvement of non-specific tags. Closes #17.
|
||||
- Fixed !!set mapping.
|
||||
- Fixed month parse in dates. Closes #19.
|
||||
|
||||
|
||||
## [0.3.0] - 2011-11-09
|
||||
### Added
|
||||
0.3.0 / 2011-11-09
|
||||
------------------
|
||||
|
||||
- Removed JS.Class dependency. Closes #3.
|
||||
- Added browserified version. Closes #13.
|
||||
- Added live demo of browserified version.
|
||||
- Ported some of the PyYAML tests. See #14.
|
||||
|
||||
### Fixed
|
||||
- Removed JS.Class dependency. Closes #3.
|
||||
- Fixed timestamp bug when fraction was given.
|
||||
|
||||
|
||||
## [0.2.2] - 2011-11-06
|
||||
### Fixed
|
||||
0.2.2 / 2011-11-06
|
||||
------------------
|
||||
|
||||
- Fixed crash on docs without ---. Closes #8.
|
||||
- Fixed multiline string parse
|
||||
- Fixed miltiline string parse
|
||||
- Fixed tests/comments for using array as key
|
||||
|
||||
|
||||
## [0.2.1] - 2011-11-02
|
||||
### Fixed
|
||||
0.2.1 / 2011-11-02
|
||||
------------------
|
||||
|
||||
- Fixed short file read (<4k). Closes #9.
|
||||
|
||||
|
||||
## [0.2.0] - 2011-11-02
|
||||
### Changed
|
||||
0.2.0 / 2011-11-02
|
||||
------------------
|
||||
|
||||
- First public release
|
||||
|
||||
|
||||
[3.14.1]: https://github.com/nodeca/js-yaml/compare/3.14.0...3.14.1
|
||||
[3.14.0]: https://github.com/nodeca/js-yaml/compare/3.13.1...3.14.0
|
||||
[3.13.1]: https://github.com/nodeca/js-yaml/compare/3.13.0...3.13.1
|
||||
[3.13.0]: https://github.com/nodeca/js-yaml/compare/3.12.2...3.13.0
|
||||
[3.12.2]: https://github.com/nodeca/js-yaml/compare/3.12.1...3.12.2
|
||||
[3.12.1]: https://github.com/nodeca/js-yaml/compare/3.12.0...3.12.1
|
||||
[3.12.0]: https://github.com/nodeca/js-yaml/compare/3.11.0...3.12.0
|
||||
[3.11.0]: https://github.com/nodeca/js-yaml/compare/3.10.0...3.11.0
|
||||
[3.10.0]: https://github.com/nodeca/js-yaml/compare/3.9.1...3.10.0
|
||||
[3.9.1]: https://github.com/nodeca/js-yaml/compare/3.9.0...3.9.1
|
||||
[3.9.0]: https://github.com/nodeca/js-yaml/compare/3.8.4...3.9.0
|
||||
[3.8.4]: https://github.com/nodeca/js-yaml/compare/3.8.3...3.8.4
|
||||
[3.8.3]: https://github.com/nodeca/js-yaml/compare/3.8.2...3.8.3
|
||||
[3.8.2]: https://github.com/nodeca/js-yaml/compare/3.8.1...3.8.2
|
||||
[3.8.1]: https://github.com/nodeca/js-yaml/compare/3.8.0...3.8.1
|
||||
[3.8.0]: https://github.com/nodeca/js-yaml/compare/3.7.0...3.8.0
|
||||
[3.7.0]: https://github.com/nodeca/js-yaml/compare/3.6.1...3.7.0
|
||||
[3.6.1]: https://github.com/nodeca/js-yaml/compare/3.6.0...3.6.1
|
||||
[3.6.0]: https://github.com/nodeca/js-yaml/compare/3.5.5...3.6.0
|
||||
[3.5.5]: https://github.com/nodeca/js-yaml/compare/3.5.4...3.5.5
|
||||
[3.5.4]: https://github.com/nodeca/js-yaml/compare/3.5.3...3.5.4
|
||||
[3.5.3]: https://github.com/nodeca/js-yaml/compare/3.5.2...3.5.3
|
||||
[3.5.2]: https://github.com/nodeca/js-yaml/compare/3.5.1...3.5.2
|
||||
[3.5.1]: https://github.com/nodeca/js-yaml/compare/3.5.0...3.5.1
|
||||
[3.5.0]: https://github.com/nodeca/js-yaml/compare/3.4.6...3.5.0
|
||||
[3.4.6]: https://github.com/nodeca/js-yaml/compare/3.4.5...3.4.6
|
||||
[3.4.5]: https://github.com/nodeca/js-yaml/compare/3.4.4...3.4.5
|
||||
[3.4.4]: https://github.com/nodeca/js-yaml/compare/3.4.3...3.4.4
|
||||
[3.4.3]: https://github.com/nodeca/js-yaml/compare/3.4.2...3.4.3
|
||||
[3.4.2]: https://github.com/nodeca/js-yaml/compare/3.4.1...3.4.2
|
||||
[3.4.1]: https://github.com/nodeca/js-yaml/compare/3.4.0...3.4.1
|
||||
[3.4.0]: https://github.com/nodeca/js-yaml/compare/3.3.1...3.4.0
|
||||
[3.3.1]: https://github.com/nodeca/js-yaml/compare/3.3.0...3.3.1
|
||||
[3.3.0]: https://github.com/nodeca/js-yaml/compare/3.2.7...3.3.0
|
||||
[3.2.7]: https://github.com/nodeca/js-yaml/compare/3.2.6...3.2.7
|
||||
[3.2.6]: https://github.com/nodeca/js-yaml/compare/3.2.5...3.2.6
|
||||
[3.2.5]: https://github.com/nodeca/js-yaml/compare/3.2.4...3.2.5
|
||||
[3.2.4]: https://github.com/nodeca/js-yaml/compare/3.2.3...3.2.4
|
||||
[3.2.3]: https://github.com/nodeca/js-yaml/compare/3.2.2...3.2.3
|
||||
[3.2.2]: https://github.com/nodeca/js-yaml/compare/3.2.1...3.2.2
|
||||
[3.2.1]: https://github.com/nodeca/js-yaml/compare/3.2.0...3.2.1
|
||||
[3.2.0]: https://github.com/nodeca/js-yaml/compare/3.1.0...3.2.0
|
||||
[3.1.0]: https://github.com/nodeca/js-yaml/compare/3.0.2...3.1.0
|
||||
[3.0.2]: https://github.com/nodeca/js-yaml/compare/3.0.1...3.0.2
|
||||
[3.0.1]: https://github.com/nodeca/js-yaml/compare/3.0.0...3.0.1
|
||||
[3.0.0]: https://github.com/nodeca/js-yaml/compare/2.1.3...3.0.0
|
||||
[2.1.3]: https://github.com/nodeca/js-yaml/compare/2.1.2...2.1.3
|
||||
[2.1.2]: https://github.com/nodeca/js-yaml/compare/2.1.1...2.1.2
|
||||
[2.1.1]: https://github.com/nodeca/js-yaml/compare/2.1.0...2.1.1
|
||||
[2.1.0]: https://github.com/nodeca/js-yaml/compare/2.0.5...2.1.0
|
||||
[2.0.5]: https://github.com/nodeca/js-yaml/compare/2.0.4...2.0.5
|
||||
[2.0.4]: https://github.com/nodeca/js-yaml/compare/2.0.3...2.0.4
|
||||
[2.0.3]: https://github.com/nodeca/js-yaml/compare/2.0.2...2.0.3
|
||||
[2.0.2]: https://github.com/nodeca/js-yaml/compare/2.0.1...2.0.2
|
||||
[2.0.1]: https://github.com/nodeca/js-yaml/compare/2.0.0...2.0.1
|
||||
[2.0.0]: https://github.com/nodeca/js-yaml/compare/1.0.3...2.0.0
|
||||
[1.0.3]: https://github.com/nodeca/js-yaml/compare/1.0.2...1.0.3
|
||||
[1.0.2]: https://github.com/nodeca/js-yaml/compare/1.0.1...1.0.2
|
||||
[1.0.1]: https://github.com/nodeca/js-yaml/compare/1.0.0...1.0.1
|
||||
[1.0.0]: https://github.com/nodeca/js-yaml/compare/0.3.7...1.0.0
|
||||
[0.3.7]: https://github.com/nodeca/js-yaml/compare/0.3.6...0.3.7
|
||||
[0.3.6]: https://github.com/nodeca/js-yaml/compare/0.3.5...0.3.6
|
||||
[0.3.5]: https://github.com/nodeca/js-yaml/compare/0.3.4...0.3.5
|
||||
[0.3.4]: https://github.com/nodeca/js-yaml/compare/0.3.3...0.3.4
|
||||
[0.3.3]: https://github.com/nodeca/js-yaml/compare/0.3.2...0.3.3
|
||||
[0.3.2]: https://github.com/nodeca/js-yaml/compare/0.3.1...0.3.2
|
||||
[0.3.1]: https://github.com/nodeca/js-yaml/compare/0.3.0...0.3.1
|
||||
[0.3.0]: https://github.com/nodeca/js-yaml/compare/0.2.2...0.3.0
|
||||
[0.2.2]: https://github.com/nodeca/js-yaml/compare/0.2.1...0.2.2
|
||||
[0.2.1]: https://github.com/nodeca/js-yaml/compare/0.2.0...0.2.1
|
||||
[0.2.0]: https://github.com/nodeca/js-yaml/releases/tag/0.2.0
|
||||
|
||||
110
node_modules/js-yaml/README.md
generated
vendored
110
node_modules/js-yaml/README.md
generated
vendored
@@ -7,7 +7,7 @@ JS-YAML - YAML 1.2 parser / writer for JavaScript
|
||||
__[Online Demo](http://nodeca.github.com/js-yaml/)__
|
||||
|
||||
|
||||
This is an implementation of [YAML](http://yaml.org/), a human-friendly data
|
||||
This is an implementation of [YAML](http://yaml.org/), a human friendly data
|
||||
serialization language. Started as [PyYAML](http://pyyaml.org/) port, it was
|
||||
completely rewritten from scratch. Now it's very fast, and supports 1.2 spec.
|
||||
|
||||
@@ -57,7 +57,7 @@ var doc = jsyaml.load('greeting: hello\nname: world');
|
||||
</script>
|
||||
```
|
||||
|
||||
Browser support was done mostly for the online demo. If you find any errors - feel
|
||||
Browser support was done mostly for online demo. If you find any errors - feel
|
||||
free to send pull requests with fixes. Also note, that IE and other old browsers
|
||||
needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate.
|
||||
|
||||
@@ -80,12 +80,12 @@ your own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and
|
||||
info.
|
||||
|
||||
``` javascript
|
||||
const yaml = require('js-yaml');
|
||||
const fs = require('fs');
|
||||
yaml = require('js-yaml');
|
||||
fs = require('fs');
|
||||
|
||||
// Get document, or throw exception on error
|
||||
try {
|
||||
const doc = yaml.safeLoad(fs.readFileSync('/home/ixti/example.yml', 'utf8'));
|
||||
var doc = yaml.safeLoad(fs.readFileSync('/home/ixti/example.yml', 'utf8'));
|
||||
console.log(doc);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
@@ -95,16 +95,16 @@ try {
|
||||
|
||||
### safeLoad (string [ , options ])
|
||||
|
||||
**Recommended loading way.** Parses `string` as single YAML document. Returns either a
|
||||
plain object, a string or `undefined`, or throws `YAMLException` on error. By default, does
|
||||
not support regexps, functions and undefined. This method is safe for untrusted data.
|
||||
**Recommended loading way.** Parses `string` as single YAML document. Returns a JavaScript
|
||||
object or throws `YAMLException` on error. By default, does not support regexps,
|
||||
functions and undefined. This method is safe for untrusted data.
|
||||
|
||||
options:
|
||||
|
||||
- `filename` _(default: null)_ - string to be used as a file path in
|
||||
error/warning messages.
|
||||
- `onWarning` _(default: null)_ - function to call on warning messages.
|
||||
Loader will call this function with an instance of `YAMLException` for each warning.
|
||||
Loader will throw on warnings if this function is not provided.
|
||||
- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ - specifies a schema to use.
|
||||
- `FAILSAFE_SCHEMA` - only strings, arrays and plain objects:
|
||||
http://www.yaml.org/spec/1.2/spec.html#id2802346
|
||||
@@ -122,33 +122,33 @@ NOTE: This function **does not** understand multi-document sources, it throws
|
||||
exception on those.
|
||||
|
||||
NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions.
|
||||
So, the JSON schema is not as strictly defined in the YAML specification.
|
||||
So, JSON schema is not as strict as defined in the YAML specification.
|
||||
It allows numbers in any notation, use `Null` and `NULL` as `null`, etc.
|
||||
The core schema also has no such restrictions. It allows binary notation for integers.
|
||||
Core schema also has no such restrictions. It allows binary notation for integers.
|
||||
|
||||
|
||||
### load (string [ , options ])
|
||||
|
||||
**Use with care with untrusted sources**. The same as `safeLoad()` but uses
|
||||
`DEFAULT_FULL_SCHEMA` by default - adds some JavaScript-specific types:
|
||||
`!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources, you
|
||||
must additionally validate object structure to avoid injections:
|
||||
`!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources you
|
||||
must additionally validate object structure, to avoid injections:
|
||||
|
||||
``` javascript
|
||||
const untrusted_code = '"toString": !<tag:yaml.org,2002:js/function> "function (){very_evil_thing();}"';
|
||||
var untrusted_code = '"toString": !<tag:yaml.org,2002:js/function> "function (){very_evil_thing();}"';
|
||||
|
||||
// I'm just converting that string, what could possibly go wrong?
|
||||
require('js-yaml').load(untrusted_code) + ''
|
||||
```
|
||||
|
||||
|
||||
### safeLoadAll (string [, iterator] [, options ])
|
||||
### safeLoadAll (string, iterator [ , options ])
|
||||
|
||||
Same as `safeLoad()`, but understands multi-document sources. Applies
|
||||
`iterator` to each document if specified, or returns array of documents.
|
||||
Same as `safeLoad()`, but understands multi-document sources and apply
|
||||
`iterator` to each document.
|
||||
|
||||
``` javascript
|
||||
const yaml = require('js-yaml');
|
||||
var yaml = require('js-yaml');
|
||||
|
||||
yaml.safeLoadAll(data, function (doc) {
|
||||
console.log(doc);
|
||||
@@ -156,21 +156,20 @@ yaml.safeLoadAll(data, function (doc) {
|
||||
```
|
||||
|
||||
|
||||
### loadAll (string [, iterator] [ , options ])
|
||||
### loadAll (string, iterator [ , options ])
|
||||
|
||||
Same as `safeLoadAll()` but uses `DEFAULT_FULL_SCHEMA` by default.
|
||||
|
||||
|
||||
### safeDump (object [ , options ])
|
||||
|
||||
Serializes `object` as a YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will
|
||||
throw an exception if you try to dump regexps or functions. However, you can
|
||||
disable exceptions by setting the `skipInvalid` option to `true`.
|
||||
Serializes `object` as YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will
|
||||
throw exception if you try to dump regexps or functions. However, you can
|
||||
disable exceptions by `skipInvalid` option.
|
||||
|
||||
options:
|
||||
|
||||
- `indent` _(default: 2)_ - indentation width to use (in spaces).
|
||||
- `noArrayIndent` _(default: false)_ - when true, will not add an indentation level to array elements
|
||||
- `skipInvalid` _(default: false)_ - do not throw on invalid types (like function
|
||||
in the safe schema) and skip pairs and single values with such types.
|
||||
- `flowLevel` (default: -1) - specifies level of nesting, when to switch from
|
||||
@@ -183,46 +182,28 @@ options:
|
||||
- `noRefs` _(default: `false`)_ - if `true`, don't convert duplicate objects into references
|
||||
- `noCompatMode` _(default: `false`)_ - if `true` don't try to be compatible with older
|
||||
yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1
|
||||
- `condenseFlow` _(default: `false`)_ - if `true` flow sequences will be condensed, omitting the space between `a, b`. Eg. `'[a,b]'`, and omitting the space between `key: value` and quoting the key. Eg. `'{"a":b}'` Can be useful when using yaml for pretty URL query params as spaces are %-encoded.
|
||||
|
||||
The following table show availlable styles (e.g. "canonical",
|
||||
"binary"...) available for each tag (.e.g. !!null, !!int ...). Yaml
|
||||
output is shown on the right side after `=>` (default setting) or `->`:
|
||||
styles:
|
||||
|
||||
``` none
|
||||
!!null
|
||||
"canonical" -> "~"
|
||||
"lowercase" => "null"
|
||||
"uppercase" -> "NULL"
|
||||
"camelcase" -> "Null"
|
||||
"canonical" => "~"
|
||||
|
||||
!!int
|
||||
"binary" -> "0b1", "0b101010", "0b1110001111010"
|
||||
"octal" -> "01", "052", "016172"
|
||||
"binary" => "0b1", "0b101010", "0b1110001111010"
|
||||
"octal" => "01", "052", "016172"
|
||||
"decimal" => "1", "42", "7290"
|
||||
"hexadecimal" -> "0x1", "0x2A", "0x1C7A"
|
||||
"hexadecimal" => "0x1", "0x2A", "0x1C7A"
|
||||
|
||||
!!bool
|
||||
"lowercase" => "true", "false"
|
||||
"uppercase" -> "TRUE", "FALSE"
|
||||
"camelcase" -> "True", "False"
|
||||
|
||||
!!float
|
||||
"lowercase" => ".nan", '.inf'
|
||||
"uppercase" -> ".NAN", '.INF'
|
||||
"camelcase" -> ".NaN", '.Inf'
|
||||
!!null, !!bool, !!float
|
||||
"lowercase" => "null", "true", "false", ".nan", '.inf'
|
||||
"uppercase" => "NULL", "TRUE", "FALSE", ".NAN", '.INF'
|
||||
"camelcase" => "Null", "True", "False", ".NaN", '.Inf'
|
||||
```
|
||||
|
||||
Example:
|
||||
By default, !!int uses `decimal`, and !!null, !!bool, !!float use `lowercase`.
|
||||
|
||||
|
||||
``` javascript
|
||||
safeDump (object, {
|
||||
'styles': {
|
||||
'!!null': 'canonical' // dump null as ~
|
||||
},
|
||||
'sortKeys': true // sort object keys
|
||||
});
|
||||
```
|
||||
|
||||
### dump (object [ , options ])
|
||||
|
||||
@@ -263,7 +244,7 @@ Caveats
|
||||
-------
|
||||
|
||||
Note, that you use arrays or objects as key in JS-YAML. JS does not allow objects
|
||||
or arrays as keys, and stringifies (by calling `toString()` method) them at the
|
||||
or array as keys, and stringifies (by calling .toString method) them at the
|
||||
moment of adding them.
|
||||
|
||||
``` yaml
|
||||
@@ -291,9 +272,24 @@ So, the following YAML document cannot be loaded.
|
||||
```
|
||||
|
||||
|
||||
js-yaml for enterprise
|
||||
----------------------
|
||||
Breaking changes in 2.x.x -> 3.x.x
|
||||
----------------------------------
|
||||
|
||||
Available as part of the Tidelift Subscription
|
||||
If you have not used __custom__ tags or loader classes and not loaded yaml
|
||||
files via `require()` - no changes needed. Just upgrade library.
|
||||
|
||||
The maintainers of js-yaml and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-js-yaml?utm_source=npm-js-yaml&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
Otherwise, you should:
|
||||
|
||||
1. Replace all occurences of `require('xxxx.yml')` by `fs.readFileSync()` +
|
||||
`yaml.safeLoad()`.
|
||||
2. rewrite your custom tags constructors and custom loader
|
||||
classes, to conform new API. See
|
||||
[examples](https://github.com/nodeca/js-yaml/tree/master/examples) and
|
||||
[wiki](https://github.com/nodeca/js-yaml/wiki) for details.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
View the [LICENSE](https://github.com/nodeca/js-yaml/blob/master/LICENSE) file
|
||||
(MIT).
|
||||
|
||||
290
node_modules/js-yaml/dist/js-yaml.js
generated
vendored
290
node_modules/js-yaml/dist/js-yaml.js
generated
vendored
@@ -1,4 +1,4 @@
|
||||
/*! js-yaml 3.14.1 https://github.com/nodeca/js-yaml */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsyaml = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
||||
/* js-yaml 3.6.1 https://github.com/nodeca/js-yaml */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsyaml = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
|
||||
@@ -115,7 +115,6 @@ var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
var CHAR_TAB = 0x09; /* Tab */
|
||||
var CHAR_LINE_FEED = 0x0A; /* LF */
|
||||
var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */
|
||||
var CHAR_SPACE = 0x20; /* Space */
|
||||
var CHAR_EXCLAMATION = 0x21; /* ! */
|
||||
var CHAR_DOUBLE_QUOTE = 0x22; /* " */
|
||||
@@ -127,7 +126,6 @@ var CHAR_ASTERISK = 0x2A; /* * */
|
||||
var CHAR_COMMA = 0x2C; /* , */
|
||||
var CHAR_MINUS = 0x2D; /* - */
|
||||
var CHAR_COLON = 0x3A; /* : */
|
||||
var CHAR_EQUALS = 0x3D; /* = */
|
||||
var CHAR_GREATER_THAN = 0x3E; /* > */
|
||||
var CHAR_QUESTION = 0x3F; /* ? */
|
||||
var CHAR_COMMERCIAL_AT = 0x40; /* @ */
|
||||
@@ -176,7 +174,8 @@ function compileStyleMap(schema, map) {
|
||||
if (tag.slice(0, 2) === '!!') {
|
||||
tag = 'tag:yaml.org,2002:' + tag.slice(2);
|
||||
}
|
||||
type = schema.compiledTypeMap['fallback'][tag];
|
||||
|
||||
type = schema.compiledTypeMap[tag];
|
||||
|
||||
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
||||
style = type.styleAliases[style];
|
||||
@@ -210,17 +209,15 @@ function encodeHex(character) {
|
||||
}
|
||||
|
||||
function State(options) {
|
||||
this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
|
||||
this.indent = Math.max(1, (options['indent'] || 2));
|
||||
this.noArrayIndent = options['noArrayIndent'] || false;
|
||||
this.skipInvalid = options['skipInvalid'] || false;
|
||||
this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
|
||||
this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
|
||||
this.sortKeys = options['sortKeys'] || false;
|
||||
this.lineWidth = options['lineWidth'] || 80;
|
||||
this.noRefs = options['noRefs'] || false;
|
||||
this.noCompatMode = options['noCompatMode'] || false;
|
||||
this.condenseFlow = options['condenseFlow'] || false;
|
||||
this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
|
||||
this.indent = Math.max(1, (options['indent'] || 2));
|
||||
this.skipInvalid = options['skipInvalid'] || false;
|
||||
this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
|
||||
this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
|
||||
this.sortKeys = options['sortKeys'] || false;
|
||||
this.lineWidth = options['lineWidth'] || 80;
|
||||
this.noRefs = options['noRefs'] || false;
|
||||
this.noCompatMode = options['noCompatMode'] || false;
|
||||
|
||||
this.implicitTypes = this.schema.compiledImplicit;
|
||||
this.explicitTypes = this.schema.compiledExplicit;
|
||||
@@ -293,23 +290,8 @@ function isPrintable(c) {
|
||||
|| (0x10000 <= c && c <= 0x10FFFF);
|
||||
}
|
||||
|
||||
// [34] ns-char ::= nb-char - s-white
|
||||
// [27] nb-char ::= c-printable - b-char - c-byte-order-mark
|
||||
// [26] b-char ::= b-line-feed | b-carriage-return
|
||||
// [24] b-line-feed ::= #xA /* LF */
|
||||
// [25] b-carriage-return ::= #xD /* CR */
|
||||
// [3] c-byte-order-mark ::= #xFEFF
|
||||
function isNsChar(c) {
|
||||
return isPrintable(c) && !isWhitespace(c)
|
||||
// byte-order-mark
|
||||
&& c !== 0xFEFF
|
||||
// b-char
|
||||
&& c !== CHAR_CARRIAGE_RETURN
|
||||
&& c !== CHAR_LINE_FEED;
|
||||
}
|
||||
|
||||
// Simplified test for values allowed after the first character in plain style.
|
||||
function isPlainSafe(c, prev) {
|
||||
function isPlainSafe(c) {
|
||||
// Uses a subset of nb-char - c-flow-indicator - ":" - "#"
|
||||
// where nb-char ::= c-printable - b-char - c-byte-order-mark.
|
||||
return isPrintable(c) && c !== 0xFEFF
|
||||
@@ -320,9 +302,8 @@ function isPlainSafe(c, prev) {
|
||||
&& c !== CHAR_LEFT_CURLY_BRACKET
|
||||
&& c !== CHAR_RIGHT_CURLY_BRACKET
|
||||
// - ":" - "#"
|
||||
// /* An ns-char preceding */ "#"
|
||||
&& c !== CHAR_COLON
|
||||
&& ((c !== CHAR_SHARP) || (prev && isNsChar(prev)));
|
||||
&& c !== CHAR_SHARP;
|
||||
}
|
||||
|
||||
// Simplified test for values allowed as the first character in plain style.
|
||||
@@ -341,13 +322,12 @@ function isPlainSafeFirst(c) {
|
||||
&& c !== CHAR_RIGHT_SQUARE_BRACKET
|
||||
&& c !== CHAR_LEFT_CURLY_BRACKET
|
||||
&& c !== CHAR_RIGHT_CURLY_BRACKET
|
||||
// | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"”
|
||||
// | “#” | “&” | “*” | “!” | “|” | “>” | “'” | “"”
|
||||
&& c !== CHAR_SHARP
|
||||
&& c !== CHAR_AMPERSAND
|
||||
&& c !== CHAR_ASTERISK
|
||||
&& c !== CHAR_EXCLAMATION
|
||||
&& c !== CHAR_VERTICAL_LINE
|
||||
&& c !== CHAR_EQUALS
|
||||
&& c !== CHAR_GREATER_THAN
|
||||
&& c !== CHAR_SINGLE_QUOTE
|
||||
&& c !== CHAR_DOUBLE_QUOTE
|
||||
@@ -357,12 +337,6 @@ function isPlainSafeFirst(c) {
|
||||
&& c !== CHAR_GRAVE_ACCENT;
|
||||
}
|
||||
|
||||
// Determines whether block indentation indicator is required.
|
||||
function needIndentIndicator(string) {
|
||||
var leadingSpaceRe = /^\n* /;
|
||||
return leadingSpaceRe.test(string);
|
||||
}
|
||||
|
||||
var STYLE_PLAIN = 1,
|
||||
STYLE_SINGLE = 2,
|
||||
STYLE_LITERAL = 3,
|
||||
@@ -378,7 +352,7 @@ var STYLE_PLAIN = 1,
|
||||
// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
|
||||
function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
|
||||
var i;
|
||||
var char, prev_char;
|
||||
var char;
|
||||
var hasLineBreak = false;
|
||||
var hasFoldableLine = false; // only checked if shouldTrackWidth
|
||||
var shouldTrackWidth = lineWidth !== -1;
|
||||
@@ -394,8 +368,7 @@ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, te
|
||||
if (!isPrintable(char)) {
|
||||
return STYLE_DOUBLE;
|
||||
}
|
||||
prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
|
||||
plain = plain && isPlainSafe(char, prev_char);
|
||||
plain = plain && isPlainSafe(char);
|
||||
}
|
||||
} else {
|
||||
// Case: block styles permitted.
|
||||
@@ -414,8 +387,7 @@ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, te
|
||||
} else if (!isPrintable(char)) {
|
||||
return STYLE_DOUBLE;
|
||||
}
|
||||
prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
|
||||
plain = plain && isPlainSafe(char, prev_char);
|
||||
plain = plain && isPlainSafe(char);
|
||||
}
|
||||
// in case the end is missing a \n
|
||||
hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
|
||||
@@ -432,7 +404,7 @@ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, te
|
||||
? STYLE_PLAIN : STYLE_SINGLE;
|
||||
}
|
||||
// Edge case: block indentation indicator can only have one digit.
|
||||
if (indentPerLevel > 9 && needIndentIndicator(string)) {
|
||||
if (string[0] === ' ' && indentPerLevel > 9) {
|
||||
return STYLE_DOUBLE;
|
||||
}
|
||||
// At this point we know block styles are valid.
|
||||
@@ -496,7 +468,7 @@ function writeScalar(state, string, level, iskey) {
|
||||
|
||||
// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
|
||||
function blockHeader(string, indentPerLevel) {
|
||||
var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';
|
||||
var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : '';
|
||||
|
||||
// note the special case: the string '\n' counts as a "trailing" empty line.
|
||||
var clip = string[string.length - 1] === '\n';
|
||||
@@ -592,21 +564,11 @@ function foldLine(line, width) {
|
||||
// Escapes a double-quoted string.
|
||||
function escapeString(string) {
|
||||
var result = '';
|
||||
var char, nextChar;
|
||||
var char;
|
||||
var escapeSeq;
|
||||
|
||||
for (var i = 0; i < string.length; i++) {
|
||||
char = string.charCodeAt(i);
|
||||
// Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates").
|
||||
if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {
|
||||
nextChar = string.charCodeAt(i + 1);
|
||||
if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {
|
||||
// Combine the surrogate pair and store it escaped.
|
||||
result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);
|
||||
// Advance index one extra since we already used that char here.
|
||||
i++; continue;
|
||||
}
|
||||
}
|
||||
escapeSeq = ESCAPE_SEQUENCES[char];
|
||||
result += !escapeSeq && isPrintable(char)
|
||||
? string[i]
|
||||
@@ -625,7 +587,7 @@ function writeFlowSequence(state, level, object) {
|
||||
for (index = 0, length = object.length; index < length; index += 1) {
|
||||
// Write only valid elements.
|
||||
if (writeNode(state, level, object[index], false, false)) {
|
||||
if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : '');
|
||||
if (index !== 0) _result += ', ';
|
||||
_result += state.dump;
|
||||
}
|
||||
}
|
||||
@@ -646,14 +608,7 @@ function writeBlockSequence(state, level, object, compact) {
|
||||
if (!compact || index !== 0) {
|
||||
_result += generateNextLine(state, level);
|
||||
}
|
||||
|
||||
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
||||
_result += '-';
|
||||
} else {
|
||||
_result += '- ';
|
||||
}
|
||||
|
||||
_result += state.dump;
|
||||
_result += '- ' + state.dump;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -672,11 +627,9 @@ function writeFlowMapping(state, level, object) {
|
||||
pairBuffer;
|
||||
|
||||
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
||||
|
||||
pairBuffer = '';
|
||||
if (index !== 0) pairBuffer += ', ';
|
||||
|
||||
if (state.condenseFlow) pairBuffer += '"';
|
||||
if (index !== 0) pairBuffer += ', ';
|
||||
|
||||
objectKey = objectKeyList[index];
|
||||
objectValue = object[objectKey];
|
||||
@@ -687,7 +640,7 @@ function writeFlowMapping(state, level, object) {
|
||||
|
||||
if (state.dump.length > 1024) pairBuffer += '? ';
|
||||
|
||||
pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
|
||||
pairBuffer += state.dump + ': ';
|
||||
|
||||
if (!writeNode(state, level, objectValue, false, false)) {
|
||||
continue; // Skip this pair because of invalid value.
|
||||
@@ -861,14 +814,13 @@ function writeNode(state, level, object, block, compact, iskey) {
|
||||
}
|
||||
}
|
||||
} else if (type === '[object Array]') {
|
||||
var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level;
|
||||
if (block && (state.dump.length !== 0)) {
|
||||
writeBlockSequence(state, arrayLevel, state.dump, compact);
|
||||
writeBlockSequence(state, level, state.dump, compact);
|
||||
if (duplicate) {
|
||||
state.dump = '&ref_' + duplicateIndex + state.dump;
|
||||
}
|
||||
} else {
|
||||
writeFlowSequence(state, arrayLevel, state.dump);
|
||||
writeFlowSequence(state, level, state.dump);
|
||||
if (duplicate) {
|
||||
state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
|
||||
}
|
||||
@@ -961,11 +913,6 @@ function YAMLException(reason, mark) {
|
||||
// Super constructor
|
||||
Error.call(this);
|
||||
|
||||
this.name = 'YAMLException';
|
||||
this.reason = reason;
|
||||
this.mark = mark;
|
||||
this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : '');
|
||||
|
||||
// Include stack trace in error object
|
||||
if (Error.captureStackTrace) {
|
||||
// Chrome and NodeJS
|
||||
@@ -974,6 +921,11 @@ function YAMLException(reason, mark) {
|
||||
// FF, IE 10+ and Safari 6+. Fallback for others
|
||||
this.stack = (new Error()).stack || '';
|
||||
}
|
||||
|
||||
this.name = 'YAMLException';
|
||||
this.reason = reason;
|
||||
this.mark = mark;
|
||||
this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : '');
|
||||
}
|
||||
|
||||
|
||||
@@ -1030,8 +982,6 @@ var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
|
||||
var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
||||
|
||||
|
||||
function _class(obj) { return Object.prototype.toString.call(obj); }
|
||||
|
||||
function is_EOL(c) {
|
||||
return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
|
||||
}
|
||||
@@ -1088,7 +1038,6 @@ function fromDecimalCode(c) {
|
||||
}
|
||||
|
||||
function simpleEscapeSequence(c) {
|
||||
/* eslint-disable indent */
|
||||
return (c === 0x30/* 0 */) ? '\x00' :
|
||||
(c === 0x61/* a */) ? '\x07' :
|
||||
(c === 0x62/* b */) ? '\x08' :
|
||||
@@ -1115,10 +1064,8 @@ function charFromCodepoint(c) {
|
||||
}
|
||||
// Encode UTF-16 surrogate pair
|
||||
// https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
|
||||
return String.fromCharCode(
|
||||
((c - 0x010000) >> 10) + 0xD800,
|
||||
((c - 0x010000) & 0x03FF) + 0xDC00
|
||||
);
|
||||
return String.fromCharCode(((c - 0x010000) >> 10) + 0xD800,
|
||||
((c - 0x010000) & 0x03FF) + 0xDC00);
|
||||
}
|
||||
|
||||
var simpleEscapeCheck = new Array(256); // integer, for fast access
|
||||
@@ -1250,7 +1197,9 @@ function captureSegment(state, start, end, checkJson) {
|
||||
_result = state.input.slice(start, end);
|
||||
|
||||
if (checkJson) {
|
||||
for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
|
||||
for (_position = 0, _length = _result.length;
|
||||
_position < _length;
|
||||
_position += 1) {
|
||||
_character = _result.charCodeAt(_position);
|
||||
if (!(_character === 0x09 ||
|
||||
(0x20 <= _character && _character <= 0x10FFFF))) {
|
||||
@@ -1284,34 +1233,9 @@ function mergeMappings(state, destination, source, overridableKeys) {
|
||||
}
|
||||
}
|
||||
|
||||
function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) {
|
||||
function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode) {
|
||||
var index, quantity;
|
||||
|
||||
// The output is a plain object here, so keys can only be strings.
|
||||
// We need to convert keyNode to a string, but doing so can hang the process
|
||||
// (deeply nested arrays that explode exponentially using aliases).
|
||||
if (Array.isArray(keyNode)) {
|
||||
keyNode = Array.prototype.slice.call(keyNode);
|
||||
|
||||
for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
|
||||
if (Array.isArray(keyNode[index])) {
|
||||
throwError(state, 'nested arrays are not supported inside keys');
|
||||
}
|
||||
|
||||
if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
|
||||
keyNode[index] = '[object Object]';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Avoid code execution in load() via toString property
|
||||
// (still use its own toString for arrays, timestamps,
|
||||
// and whatever user schema extensions happen to have @@toStringTag)
|
||||
if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {
|
||||
keyNode = '[object Object]';
|
||||
}
|
||||
|
||||
|
||||
keyNode = String(keyNode);
|
||||
|
||||
if (_result === null) {
|
||||
@@ -1330,8 +1254,6 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu
|
||||
if (!state.json &&
|
||||
!_hasOwnProperty.call(overridableKeys, keyNode) &&
|
||||
_hasOwnProperty.call(_result, keyNode)) {
|
||||
state.line = startLine || state.line;
|
||||
state.position = startPos || state.position;
|
||||
throwError(state, 'duplicated mapping key');
|
||||
}
|
||||
_result[keyNode] = valueNode;
|
||||
@@ -1562,9 +1484,8 @@ function readSingleQuotedScalar(state, nodeIndent) {
|
||||
ch = state.input.charCodeAt(++state.position);
|
||||
|
||||
if (ch === 0x27/* ' */) {
|
||||
captureStart = state.position;
|
||||
captureStart = captureEnd = state.position;
|
||||
state.position++;
|
||||
captureEnd = state.position;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
@@ -1979,7 +1900,6 @@ function readBlockMapping(state, nodeIndent, flowIndent) {
|
||||
var following,
|
||||
allowCompact,
|
||||
_line,
|
||||
_pos,
|
||||
_tag = state.tag,
|
||||
_anchor = state.anchor,
|
||||
_result = {},
|
||||
@@ -2000,7 +1920,6 @@ function readBlockMapping(state, nodeIndent, flowIndent) {
|
||||
while (ch !== 0) {
|
||||
following = state.input.charCodeAt(state.position + 1);
|
||||
_line = state.line; // Save the current line.
|
||||
_pos = state.position;
|
||||
|
||||
//
|
||||
// Explicit notation case. There are two separate blocks:
|
||||
@@ -2024,7 +1943,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) {
|
||||
allowCompact = true;
|
||||
|
||||
} else {
|
||||
throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');
|
||||
throwError(state, 'incomplete explicit mapping pair; a key node is missed');
|
||||
}
|
||||
|
||||
state.position += 1;
|
||||
@@ -2095,7 +2014,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) {
|
||||
}
|
||||
|
||||
if (!atExplicitKey) {
|
||||
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos);
|
||||
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode);
|
||||
keyTag = keyNode = valueNode = null;
|
||||
}
|
||||
|
||||
@@ -2272,7 +2191,7 @@ function readAlias(state) {
|
||||
|
||||
alias = state.input.slice(_position, state.position);
|
||||
|
||||
if (!_hasOwnProperty.call(state.anchorMap, alias)) {
|
||||
if (!state.anchorMap.hasOwnProperty(alias)) {
|
||||
throwError(state, 'unidentified alias "' + alias + '"');
|
||||
}
|
||||
|
||||
@@ -2393,19 +2312,15 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact
|
||||
|
||||
if (state.tag !== null && state.tag !== '!') {
|
||||
if (state.tag === '?') {
|
||||
// Implicit resolving is not allowed for non-scalar types, and '?'
|
||||
// non-specific tag is only automatically assigned to plain scalars.
|
||||
//
|
||||
// We only need to check kind conformity in case user explicitly assigns '?'
|
||||
// tag, for example like this: "!<?> [0]"
|
||||
//
|
||||
if (state.result !== null && state.kind !== 'scalar') {
|
||||
throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
|
||||
}
|
||||
|
||||
for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
|
||||
for (typeIndex = 0, typeQuantity = state.implicitTypes.length;
|
||||
typeIndex < typeQuantity;
|
||||
typeIndex += 1) {
|
||||
type = state.implicitTypes[typeIndex];
|
||||
|
||||
// Implicit resolving is not allowed for non-scalar types, and '?'
|
||||
// non-specific tag is only assigned to plain scalars. So, it isn't
|
||||
// needed to check for 'kind' conformity.
|
||||
|
||||
if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
|
||||
state.result = type.construct(state.result);
|
||||
state.tag = type.tag;
|
||||
@@ -2415,8 +2330,8 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {
|
||||
type = state.typeMap[state.kind || 'fallback'][state.tag];
|
||||
} else if (_hasOwnProperty.call(state.typeMap, state.tag)) {
|
||||
type = state.typeMap[state.tag];
|
||||
|
||||
if (state.result !== null && type.kind !== state.kind) {
|
||||
throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
|
||||
@@ -2569,13 +2484,6 @@ function loadDocuments(input, options) {
|
||||
|
||||
var state = new State(input, options);
|
||||
|
||||
var nullpos = input.indexOf('\0');
|
||||
|
||||
if (nullpos !== -1) {
|
||||
state.position = nullpos;
|
||||
throwError(state, 'null byte is not allowed in input');
|
||||
}
|
||||
|
||||
// Use 0 as string terminator. That significantly simplifies bounds check.
|
||||
state.input += '\0';
|
||||
|
||||
@@ -2593,18 +2501,9 @@ function loadDocuments(input, options) {
|
||||
|
||||
|
||||
function loadAll(input, iterator, options) {
|
||||
if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {
|
||||
options = iterator;
|
||||
iterator = null;
|
||||
}
|
||||
var documents = loadDocuments(input, options), index, length;
|
||||
|
||||
var documents = loadDocuments(input, options);
|
||||
|
||||
if (typeof iterator !== 'function') {
|
||||
return documents;
|
||||
}
|
||||
|
||||
for (var index = 0, length = documents.length; index < length; index += 1) {
|
||||
for (index = 0, length = documents.length; index < length; index += 1) {
|
||||
iterator(documents[index]);
|
||||
}
|
||||
}
|
||||
@@ -2623,13 +2522,8 @@ function load(input, options) {
|
||||
}
|
||||
|
||||
|
||||
function safeLoadAll(input, iterator, options) {
|
||||
if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') {
|
||||
options = iterator;
|
||||
iterator = null;
|
||||
}
|
||||
|
||||
return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
|
||||
function safeLoadAll(input, output, options) {
|
||||
loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
|
||||
}
|
||||
|
||||
|
||||
@@ -2740,7 +2634,7 @@ function compileList(schema, name, result) {
|
||||
|
||||
schema[name].forEach(function (currentType) {
|
||||
result.forEach(function (previousType, previousIndex) {
|
||||
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
|
||||
if (previousType.tag === currentType.tag) {
|
||||
exclude.push(previousIndex);
|
||||
}
|
||||
});
|
||||
@@ -2755,20 +2649,16 @@ function compileList(schema, name, result) {
|
||||
|
||||
|
||||
function compileMap(/* lists... */) {
|
||||
var result = {
|
||||
scalar: {},
|
||||
sequence: {},
|
||||
mapping: {},
|
||||
fallback: {}
|
||||
}, index, length;
|
||||
var result = {}, index, length;
|
||||
|
||||
function collectType(type) {
|
||||
result[type.kind][type.tag] = result['fallback'][type.tag] = type;
|
||||
result[type.tag] = type;
|
||||
}
|
||||
|
||||
for (index = 0, length = arguments.length; index < length; index += 1) {
|
||||
arguments[index].forEach(collectType);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -3095,10 +2985,7 @@ function constructYamlBinary(data) {
|
||||
}
|
||||
|
||||
// Wrap into Buffer for NodeJS and leave Array for browser
|
||||
if (NodeBuffer) {
|
||||
// Support node 6.+ Buffer API when available
|
||||
return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result);
|
||||
}
|
||||
if (NodeBuffer) return new NodeBuffer(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -3201,27 +3088,16 @@ var common = require('../common');
|
||||
var Type = require('../type');
|
||||
|
||||
var YAML_FLOAT_PATTERN = new RegExp(
|
||||
// 2.5e4, 2.5 and integers
|
||||
'^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
|
||||
// .2e4, .2
|
||||
// special case, seems not from spec
|
||||
'|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
|
||||
// 20:59
|
||||
'^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?' +
|
||||
'|\\.[0-9_]+(?:[eE][-+][0-9]+)?' +
|
||||
'|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' +
|
||||
// .inf
|
||||
'|[-+]?\\.(?:inf|Inf|INF)' +
|
||||
// .nan
|
||||
'|\\.(?:nan|NaN|NAN))$');
|
||||
|
||||
function resolveYamlFloat(data) {
|
||||
if (data === null) return false;
|
||||
|
||||
if (!YAML_FLOAT_PATTERN.test(data) ||
|
||||
// Quick hack to not allow integers end with `_`
|
||||
// Probably should update regexp & check speed
|
||||
data[data.length - 1] === '_') {
|
||||
return false;
|
||||
}
|
||||
if (!YAML_FLOAT_PATTERN.test(data)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -3366,7 +3242,7 @@ function resolveYamlInteger(data) {
|
||||
if (ch !== '0' && ch !== '1') return false;
|
||||
hasDigits = true;
|
||||
}
|
||||
return hasDigits && ch !== '_';
|
||||
return hasDigits;
|
||||
}
|
||||
|
||||
|
||||
@@ -3380,7 +3256,7 @@ function resolveYamlInteger(data) {
|
||||
if (!isHexCode(data.charCodeAt(index))) return false;
|
||||
hasDigits = true;
|
||||
}
|
||||
return hasDigits && ch !== '_';
|
||||
return hasDigits;
|
||||
}
|
||||
|
||||
// base 8
|
||||
@@ -3390,14 +3266,11 @@ function resolveYamlInteger(data) {
|
||||
if (!isOctCode(data.charCodeAt(index))) return false;
|
||||
hasDigits = true;
|
||||
}
|
||||
return hasDigits && ch !== '_';
|
||||
return hasDigits;
|
||||
}
|
||||
|
||||
// base 10 (except 0) or base 60
|
||||
|
||||
// value should not start with `_`;
|
||||
if (ch === '_') return false;
|
||||
|
||||
for (; index < max; index++) {
|
||||
ch = data[index];
|
||||
if (ch === '_') continue;
|
||||
@@ -3408,8 +3281,7 @@ function resolveYamlInteger(data) {
|
||||
hasDigits = true;
|
||||
}
|
||||
|
||||
// Should have digits and should not end with `_`
|
||||
if (!hasDigits || ch === '_') return false;
|
||||
if (!hasDigits) return false;
|
||||
|
||||
// if !base60 - done;
|
||||
if (ch !== ':') return true;
|
||||
@@ -3472,11 +3344,10 @@ module.exports = new Type('tag:yaml.org,2002:int', {
|
||||
construct: constructYamlInteger,
|
||||
predicate: isInteger,
|
||||
represent: {
|
||||
binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },
|
||||
octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); },
|
||||
decimal: function (obj) { return obj.toString(10); },
|
||||
/* eslint-disable max-len */
|
||||
hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }
|
||||
binary: function (object) { return '0b' + object.toString(2); },
|
||||
octal: function (object) { return '0' + object.toString(8); },
|
||||
decimal: function (object) { return object.toString(10); },
|
||||
hexadecimal: function (object) { return '0x' + object.toString(16).toUpperCase(); }
|
||||
},
|
||||
defaultStyle: 'decimal',
|
||||
styleAliases: {
|
||||
@@ -3504,8 +3375,7 @@ try {
|
||||
var _require = require;
|
||||
esprima = _require('esprima');
|
||||
} catch (_) {
|
||||
/* eslint-disable no-redeclare */
|
||||
/* global window */
|
||||
/*global window */
|
||||
if (typeof window !== 'undefined') esprima = window.esprima;
|
||||
}
|
||||
|
||||
@@ -3521,8 +3391,7 @@ function resolveJavascriptFunction(data) {
|
||||
if (ast.type !== 'Program' ||
|
||||
ast.body.length !== 1 ||
|
||||
ast.body[0].type !== 'ExpressionStatement' ||
|
||||
(ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
|
||||
ast.body[0].expression.type !== 'FunctionExpression')) {
|
||||
ast.body[0].expression.type !== 'FunctionExpression') {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3543,8 +3412,7 @@ function constructJavascriptFunction(data) {
|
||||
if (ast.type !== 'Program' ||
|
||||
ast.body.length !== 1 ||
|
||||
ast.body[0].type !== 'ExpressionStatement' ||
|
||||
(ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
|
||||
ast.body[0].expression.type !== 'FunctionExpression')) {
|
||||
ast.body[0].expression.type !== 'FunctionExpression') {
|
||||
throw new Error('Failed to resolve function');
|
||||
}
|
||||
|
||||
@@ -3556,14 +3424,8 @@ function constructJavascriptFunction(data) {
|
||||
|
||||
// Esprima's ranges include the first '{' and the last '}' characters on
|
||||
// function expressions. So cut them out.
|
||||
if (ast.body[0].expression.body.type === 'BlockStatement') {
|
||||
/*eslint-disable no-new-func*/
|
||||
return new Function(params, source.slice(body[0] + 1, body[1] - 1));
|
||||
}
|
||||
// ES6 arrow functions can omit the BlockStatement. In that case, just return
|
||||
// the body.
|
||||
/*eslint-disable no-new-func*/
|
||||
return new Function(params, 'return ' + source.slice(body[0], body[1]));
|
||||
return new Function(params, source.slice(body[0] + 1, body[1] - 1));
|
||||
}
|
||||
|
||||
function representJavascriptFunction(object /*, style*/) {
|
||||
@@ -3986,4 +3848,4 @@ var yaml = require('./lib/js-yaml.js');
|
||||
module.exports = yaml;
|
||||
|
||||
},{"./lib/js-yaml.js":1}]},{},[])("/")
|
||||
});
|
||||
});
|
||||
4
node_modules/js-yaml/dist/js-yaml.min.js
generated
vendored
4
node_modules/js-yaml/dist/js-yaml.min.js
generated
vendored
File diff suppressed because one or more lines are too long
100
node_modules/js-yaml/lib/js-yaml/dumper.js
generated
vendored
100
node_modules/js-yaml/lib/js-yaml/dumper.js
generated
vendored
@@ -12,7 +12,6 @@ var _hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
var CHAR_TAB = 0x09; /* Tab */
|
||||
var CHAR_LINE_FEED = 0x0A; /* LF */
|
||||
var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */
|
||||
var CHAR_SPACE = 0x20; /* Space */
|
||||
var CHAR_EXCLAMATION = 0x21; /* ! */
|
||||
var CHAR_DOUBLE_QUOTE = 0x22; /* " */
|
||||
@@ -24,7 +23,6 @@ var CHAR_ASTERISK = 0x2A; /* * */
|
||||
var CHAR_COMMA = 0x2C; /* , */
|
||||
var CHAR_MINUS = 0x2D; /* - */
|
||||
var CHAR_COLON = 0x3A; /* : */
|
||||
var CHAR_EQUALS = 0x3D; /* = */
|
||||
var CHAR_GREATER_THAN = 0x3E; /* > */
|
||||
var CHAR_QUESTION = 0x3F; /* ? */
|
||||
var CHAR_COMMERCIAL_AT = 0x40; /* @ */
|
||||
@@ -73,7 +71,8 @@ function compileStyleMap(schema, map) {
|
||||
if (tag.slice(0, 2) === '!!') {
|
||||
tag = 'tag:yaml.org,2002:' + tag.slice(2);
|
||||
}
|
||||
type = schema.compiledTypeMap['fallback'][tag];
|
||||
|
||||
type = schema.compiledTypeMap[tag];
|
||||
|
||||
if (type && _hasOwnProperty.call(type.styleAliases, style)) {
|
||||
style = type.styleAliases[style];
|
||||
@@ -107,17 +106,15 @@ function encodeHex(character) {
|
||||
}
|
||||
|
||||
function State(options) {
|
||||
this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
|
||||
this.indent = Math.max(1, (options['indent'] || 2));
|
||||
this.noArrayIndent = options['noArrayIndent'] || false;
|
||||
this.skipInvalid = options['skipInvalid'] || false;
|
||||
this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
|
||||
this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
|
||||
this.sortKeys = options['sortKeys'] || false;
|
||||
this.lineWidth = options['lineWidth'] || 80;
|
||||
this.noRefs = options['noRefs'] || false;
|
||||
this.noCompatMode = options['noCompatMode'] || false;
|
||||
this.condenseFlow = options['condenseFlow'] || false;
|
||||
this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
|
||||
this.indent = Math.max(1, (options['indent'] || 2));
|
||||
this.skipInvalid = options['skipInvalid'] || false;
|
||||
this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
|
||||
this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
|
||||
this.sortKeys = options['sortKeys'] || false;
|
||||
this.lineWidth = options['lineWidth'] || 80;
|
||||
this.noRefs = options['noRefs'] || false;
|
||||
this.noCompatMode = options['noCompatMode'] || false;
|
||||
|
||||
this.implicitTypes = this.schema.compiledImplicit;
|
||||
this.explicitTypes = this.schema.compiledExplicit;
|
||||
@@ -190,23 +187,8 @@ function isPrintable(c) {
|
||||
|| (0x10000 <= c && c <= 0x10FFFF);
|
||||
}
|
||||
|
||||
// [34] ns-char ::= nb-char - s-white
|
||||
// [27] nb-char ::= c-printable - b-char - c-byte-order-mark
|
||||
// [26] b-char ::= b-line-feed | b-carriage-return
|
||||
// [24] b-line-feed ::= #xA /* LF */
|
||||
// [25] b-carriage-return ::= #xD /* CR */
|
||||
// [3] c-byte-order-mark ::= #xFEFF
|
||||
function isNsChar(c) {
|
||||
return isPrintable(c) && !isWhitespace(c)
|
||||
// byte-order-mark
|
||||
&& c !== 0xFEFF
|
||||
// b-char
|
||||
&& c !== CHAR_CARRIAGE_RETURN
|
||||
&& c !== CHAR_LINE_FEED;
|
||||
}
|
||||
|
||||
// Simplified test for values allowed after the first character in plain style.
|
||||
function isPlainSafe(c, prev) {
|
||||
function isPlainSafe(c) {
|
||||
// Uses a subset of nb-char - c-flow-indicator - ":" - "#"
|
||||
// where nb-char ::= c-printable - b-char - c-byte-order-mark.
|
||||
return isPrintable(c) && c !== 0xFEFF
|
||||
@@ -217,9 +199,8 @@ function isPlainSafe(c, prev) {
|
||||
&& c !== CHAR_LEFT_CURLY_BRACKET
|
||||
&& c !== CHAR_RIGHT_CURLY_BRACKET
|
||||
// - ":" - "#"
|
||||
// /* An ns-char preceding */ "#"
|
||||
&& c !== CHAR_COLON
|
||||
&& ((c !== CHAR_SHARP) || (prev && isNsChar(prev)));
|
||||
&& c !== CHAR_SHARP;
|
||||
}
|
||||
|
||||
// Simplified test for values allowed as the first character in plain style.
|
||||
@@ -238,13 +219,12 @@ function isPlainSafeFirst(c) {
|
||||
&& c !== CHAR_RIGHT_SQUARE_BRACKET
|
||||
&& c !== CHAR_LEFT_CURLY_BRACKET
|
||||
&& c !== CHAR_RIGHT_CURLY_BRACKET
|
||||
// | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"”
|
||||
// | “#” | “&” | “*” | “!” | “|” | “>” | “'” | “"”
|
||||
&& c !== CHAR_SHARP
|
||||
&& c !== CHAR_AMPERSAND
|
||||
&& c !== CHAR_ASTERISK
|
||||
&& c !== CHAR_EXCLAMATION
|
||||
&& c !== CHAR_VERTICAL_LINE
|
||||
&& c !== CHAR_EQUALS
|
||||
&& c !== CHAR_GREATER_THAN
|
||||
&& c !== CHAR_SINGLE_QUOTE
|
||||
&& c !== CHAR_DOUBLE_QUOTE
|
||||
@@ -254,12 +234,6 @@ function isPlainSafeFirst(c) {
|
||||
&& c !== CHAR_GRAVE_ACCENT;
|
||||
}
|
||||
|
||||
// Determines whether block indentation indicator is required.
|
||||
function needIndentIndicator(string) {
|
||||
var leadingSpaceRe = /^\n* /;
|
||||
return leadingSpaceRe.test(string);
|
||||
}
|
||||
|
||||
var STYLE_PLAIN = 1,
|
||||
STYLE_SINGLE = 2,
|
||||
STYLE_LITERAL = 3,
|
||||
@@ -275,7 +249,7 @@ var STYLE_PLAIN = 1,
|
||||
// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
|
||||
function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
|
||||
var i;
|
||||
var char, prev_char;
|
||||
var char;
|
||||
var hasLineBreak = false;
|
||||
var hasFoldableLine = false; // only checked if shouldTrackWidth
|
||||
var shouldTrackWidth = lineWidth !== -1;
|
||||
@@ -291,8 +265,7 @@ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, te
|
||||
if (!isPrintable(char)) {
|
||||
return STYLE_DOUBLE;
|
||||
}
|
||||
prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
|
||||
plain = plain && isPlainSafe(char, prev_char);
|
||||
plain = plain && isPlainSafe(char);
|
||||
}
|
||||
} else {
|
||||
// Case: block styles permitted.
|
||||
@@ -311,8 +284,7 @@ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, te
|
||||
} else if (!isPrintable(char)) {
|
||||
return STYLE_DOUBLE;
|
||||
}
|
||||
prev_char = i > 0 ? string.charCodeAt(i - 1) : null;
|
||||
plain = plain && isPlainSafe(char, prev_char);
|
||||
plain = plain && isPlainSafe(char);
|
||||
}
|
||||
// in case the end is missing a \n
|
||||
hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
|
||||
@@ -329,7 +301,7 @@ function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, te
|
||||
? STYLE_PLAIN : STYLE_SINGLE;
|
||||
}
|
||||
// Edge case: block indentation indicator can only have one digit.
|
||||
if (indentPerLevel > 9 && needIndentIndicator(string)) {
|
||||
if (string[0] === ' ' && indentPerLevel > 9) {
|
||||
return STYLE_DOUBLE;
|
||||
}
|
||||
// At this point we know block styles are valid.
|
||||
@@ -393,7 +365,7 @@ function writeScalar(state, string, level, iskey) {
|
||||
|
||||
// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
|
||||
function blockHeader(string, indentPerLevel) {
|
||||
var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';
|
||||
var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : '';
|
||||
|
||||
// note the special case: the string '\n' counts as a "trailing" empty line.
|
||||
var clip = string[string.length - 1] === '\n';
|
||||
@@ -489,21 +461,11 @@ function foldLine(line, width) {
|
||||
// Escapes a double-quoted string.
|
||||
function escapeString(string) {
|
||||
var result = '';
|
||||
var char, nextChar;
|
||||
var char;
|
||||
var escapeSeq;
|
||||
|
||||
for (var i = 0; i < string.length; i++) {
|
||||
char = string.charCodeAt(i);
|
||||
// Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates").
|
||||
if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {
|
||||
nextChar = string.charCodeAt(i + 1);
|
||||
if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {
|
||||
// Combine the surrogate pair and store it escaped.
|
||||
result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);
|
||||
// Advance index one extra since we already used that char here.
|
||||
i++; continue;
|
||||
}
|
||||
}
|
||||
escapeSeq = ESCAPE_SEQUENCES[char];
|
||||
result += !escapeSeq && isPrintable(char)
|
||||
? string[i]
|
||||
@@ -522,7 +484,7 @@ function writeFlowSequence(state, level, object) {
|
||||
for (index = 0, length = object.length; index < length; index += 1) {
|
||||
// Write only valid elements.
|
||||
if (writeNode(state, level, object[index], false, false)) {
|
||||
if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : '');
|
||||
if (index !== 0) _result += ', ';
|
||||
_result += state.dump;
|
||||
}
|
||||
}
|
||||
@@ -543,14 +505,7 @@ function writeBlockSequence(state, level, object, compact) {
|
||||
if (!compact || index !== 0) {
|
||||
_result += generateNextLine(state, level);
|
||||
}
|
||||
|
||||
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
|
||||
_result += '-';
|
||||
} else {
|
||||
_result += '- ';
|
||||
}
|
||||
|
||||
_result += state.dump;
|
||||
_result += '- ' + state.dump;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -569,11 +524,9 @@ function writeFlowMapping(state, level, object) {
|
||||
pairBuffer;
|
||||
|
||||
for (index = 0, length = objectKeyList.length; index < length; index += 1) {
|
||||
|
||||
pairBuffer = '';
|
||||
if (index !== 0) pairBuffer += ', ';
|
||||
|
||||
if (state.condenseFlow) pairBuffer += '"';
|
||||
if (index !== 0) pairBuffer += ', ';
|
||||
|
||||
objectKey = objectKeyList[index];
|
||||
objectValue = object[objectKey];
|
||||
@@ -584,7 +537,7 @@ function writeFlowMapping(state, level, object) {
|
||||
|
||||
if (state.dump.length > 1024) pairBuffer += '? ';
|
||||
|
||||
pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
|
||||
pairBuffer += state.dump + ': ';
|
||||
|
||||
if (!writeNode(state, level, objectValue, false, false)) {
|
||||
continue; // Skip this pair because of invalid value.
|
||||
@@ -758,14 +711,13 @@ function writeNode(state, level, object, block, compact, iskey) {
|
||||
}
|
||||
}
|
||||
} else if (type === '[object Array]') {
|
||||
var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level;
|
||||
if (block && (state.dump.length !== 0)) {
|
||||
writeBlockSequence(state, arrayLevel, state.dump, compact);
|
||||
writeBlockSequence(state, level, state.dump, compact);
|
||||
if (duplicate) {
|
||||
state.dump = '&ref_' + duplicateIndex + state.dump;
|
||||
}
|
||||
} else {
|
||||
writeFlowSequence(state, arrayLevel, state.dump);
|
||||
writeFlowSequence(state, level, state.dump);
|
||||
if (duplicate) {
|
||||
state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
|
||||
}
|
||||
|
||||
10
node_modules/js-yaml/lib/js-yaml/exception.js
generated
vendored
10
node_modules/js-yaml/lib/js-yaml/exception.js
generated
vendored
@@ -6,11 +6,6 @@ function YAMLException(reason, mark) {
|
||||
// Super constructor
|
||||
Error.call(this);
|
||||
|
||||
this.name = 'YAMLException';
|
||||
this.reason = reason;
|
||||
this.mark = mark;
|
||||
this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : '');
|
||||
|
||||
// Include stack trace in error object
|
||||
if (Error.captureStackTrace) {
|
||||
// Chrome and NodeJS
|
||||
@@ -19,6 +14,11 @@ function YAMLException(reason, mark) {
|
||||
// FF, IE 10+ and Safari 6+. Fallback for others
|
||||
this.stack = (new Error()).stack || '';
|
||||
}
|
||||
|
||||
this.name = 'YAMLException';
|
||||
this.reason = reason;
|
||||
this.mark = mark;
|
||||
this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : '');
|
||||
}
|
||||
|
||||
|
||||
|
||||
104
node_modules/js-yaml/lib/js-yaml/loader.js
generated
vendored
104
node_modules/js-yaml/lib/js-yaml/loader.js
generated
vendored
@@ -30,8 +30,6 @@ var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
|
||||
var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
||||
|
||||
|
||||
function _class(obj) { return Object.prototype.toString.call(obj); }
|
||||
|
||||
function is_EOL(c) {
|
||||
return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
|
||||
}
|
||||
@@ -88,7 +86,6 @@ function fromDecimalCode(c) {
|
||||
}
|
||||
|
||||
function simpleEscapeSequence(c) {
|
||||
/* eslint-disable indent */
|
||||
return (c === 0x30/* 0 */) ? '\x00' :
|
||||
(c === 0x61/* a */) ? '\x07' :
|
||||
(c === 0x62/* b */) ? '\x08' :
|
||||
@@ -115,10 +112,8 @@ function charFromCodepoint(c) {
|
||||
}
|
||||
// Encode UTF-16 surrogate pair
|
||||
// https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
|
||||
return String.fromCharCode(
|
||||
((c - 0x010000) >> 10) + 0xD800,
|
||||
((c - 0x010000) & 0x03FF) + 0xDC00
|
||||
);
|
||||
return String.fromCharCode(((c - 0x010000) >> 10) + 0xD800,
|
||||
((c - 0x010000) & 0x03FF) + 0xDC00);
|
||||
}
|
||||
|
||||
var simpleEscapeCheck = new Array(256); // integer, for fast access
|
||||
@@ -250,7 +245,9 @@ function captureSegment(state, start, end, checkJson) {
|
||||
_result = state.input.slice(start, end);
|
||||
|
||||
if (checkJson) {
|
||||
for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
|
||||
for (_position = 0, _length = _result.length;
|
||||
_position < _length;
|
||||
_position += 1) {
|
||||
_character = _result.charCodeAt(_position);
|
||||
if (!(_character === 0x09 ||
|
||||
(0x20 <= _character && _character <= 0x10FFFF))) {
|
||||
@@ -284,34 +281,9 @@ function mergeMappings(state, destination, source, overridableKeys) {
|
||||
}
|
||||
}
|
||||
|
||||
function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) {
|
||||
function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode) {
|
||||
var index, quantity;
|
||||
|
||||
// The output is a plain object here, so keys can only be strings.
|
||||
// We need to convert keyNode to a string, but doing so can hang the process
|
||||
// (deeply nested arrays that explode exponentially using aliases).
|
||||
if (Array.isArray(keyNode)) {
|
||||
keyNode = Array.prototype.slice.call(keyNode);
|
||||
|
||||
for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
|
||||
if (Array.isArray(keyNode[index])) {
|
||||
throwError(state, 'nested arrays are not supported inside keys');
|
||||
}
|
||||
|
||||
if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
|
||||
keyNode[index] = '[object Object]';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Avoid code execution in load() via toString property
|
||||
// (still use its own toString for arrays, timestamps,
|
||||
// and whatever user schema extensions happen to have @@toStringTag)
|
||||
if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {
|
||||
keyNode = '[object Object]';
|
||||
}
|
||||
|
||||
|
||||
keyNode = String(keyNode);
|
||||
|
||||
if (_result === null) {
|
||||
@@ -330,8 +302,6 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu
|
||||
if (!state.json &&
|
||||
!_hasOwnProperty.call(overridableKeys, keyNode) &&
|
||||
_hasOwnProperty.call(_result, keyNode)) {
|
||||
state.line = startLine || state.line;
|
||||
state.position = startPos || state.position;
|
||||
throwError(state, 'duplicated mapping key');
|
||||
}
|
||||
_result[keyNode] = valueNode;
|
||||
@@ -562,9 +532,8 @@ function readSingleQuotedScalar(state, nodeIndent) {
|
||||
ch = state.input.charCodeAt(++state.position);
|
||||
|
||||
if (ch === 0x27/* ' */) {
|
||||
captureStart = state.position;
|
||||
captureStart = captureEnd = state.position;
|
||||
state.position++;
|
||||
captureEnd = state.position;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
@@ -979,7 +948,6 @@ function readBlockMapping(state, nodeIndent, flowIndent) {
|
||||
var following,
|
||||
allowCompact,
|
||||
_line,
|
||||
_pos,
|
||||
_tag = state.tag,
|
||||
_anchor = state.anchor,
|
||||
_result = {},
|
||||
@@ -1000,7 +968,6 @@ function readBlockMapping(state, nodeIndent, flowIndent) {
|
||||
while (ch !== 0) {
|
||||
following = state.input.charCodeAt(state.position + 1);
|
||||
_line = state.line; // Save the current line.
|
||||
_pos = state.position;
|
||||
|
||||
//
|
||||
// Explicit notation case. There are two separate blocks:
|
||||
@@ -1024,7 +991,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) {
|
||||
allowCompact = true;
|
||||
|
||||
} else {
|
||||
throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');
|
||||
throwError(state, 'incomplete explicit mapping pair; a key node is missed');
|
||||
}
|
||||
|
||||
state.position += 1;
|
||||
@@ -1095,7 +1062,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) {
|
||||
}
|
||||
|
||||
if (!atExplicitKey) {
|
||||
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos);
|
||||
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode);
|
||||
keyTag = keyNode = valueNode = null;
|
||||
}
|
||||
|
||||
@@ -1272,7 +1239,7 @@ function readAlias(state) {
|
||||
|
||||
alias = state.input.slice(_position, state.position);
|
||||
|
||||
if (!_hasOwnProperty.call(state.anchorMap, alias)) {
|
||||
if (!state.anchorMap.hasOwnProperty(alias)) {
|
||||
throwError(state, 'unidentified alias "' + alias + '"');
|
||||
}
|
||||
|
||||
@@ -1393,19 +1360,15 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact
|
||||
|
||||
if (state.tag !== null && state.tag !== '!') {
|
||||
if (state.tag === '?') {
|
||||
// Implicit resolving is not allowed for non-scalar types, and '?'
|
||||
// non-specific tag is only automatically assigned to plain scalars.
|
||||
//
|
||||
// We only need to check kind conformity in case user explicitly assigns '?'
|
||||
// tag, for example like this: "!<?> [0]"
|
||||
//
|
||||
if (state.result !== null && state.kind !== 'scalar') {
|
||||
throwError(state, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + state.kind + '"');
|
||||
}
|
||||
|
||||
for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
|
||||
for (typeIndex = 0, typeQuantity = state.implicitTypes.length;
|
||||
typeIndex < typeQuantity;
|
||||
typeIndex += 1) {
|
||||
type = state.implicitTypes[typeIndex];
|
||||
|
||||
// Implicit resolving is not allowed for non-scalar types, and '?'
|
||||
// non-specific tag is only assigned to plain scalars. So, it isn't
|
||||
// needed to check for 'kind' conformity.
|
||||
|
||||
if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
|
||||
state.result = type.construct(state.result);
|
||||
state.tag = type.tag;
|
||||
@@ -1415,8 +1378,8 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {
|
||||
type = state.typeMap[state.kind || 'fallback'][state.tag];
|
||||
} else if (_hasOwnProperty.call(state.typeMap, state.tag)) {
|
||||
type = state.typeMap[state.tag];
|
||||
|
||||
if (state.result !== null && type.kind !== state.kind) {
|
||||
throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
|
||||
@@ -1569,13 +1532,6 @@ function loadDocuments(input, options) {
|
||||
|
||||
var state = new State(input, options);
|
||||
|
||||
var nullpos = input.indexOf('\0');
|
||||
|
||||
if (nullpos !== -1) {
|
||||
state.position = nullpos;
|
||||
throwError(state, 'null byte is not allowed in input');
|
||||
}
|
||||
|
||||
// Use 0 as string terminator. That significantly simplifies bounds check.
|
||||
state.input += '\0';
|
||||
|
||||
@@ -1593,18 +1549,9 @@ function loadDocuments(input, options) {
|
||||
|
||||
|
||||
function loadAll(input, iterator, options) {
|
||||
if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {
|
||||
options = iterator;
|
||||
iterator = null;
|
||||
}
|
||||
var documents = loadDocuments(input, options), index, length;
|
||||
|
||||
var documents = loadDocuments(input, options);
|
||||
|
||||
if (typeof iterator !== 'function') {
|
||||
return documents;
|
||||
}
|
||||
|
||||
for (var index = 0, length = documents.length; index < length; index += 1) {
|
||||
for (index = 0, length = documents.length; index < length; index += 1) {
|
||||
iterator(documents[index]);
|
||||
}
|
||||
}
|
||||
@@ -1623,13 +1570,8 @@ function load(input, options) {
|
||||
}
|
||||
|
||||
|
||||
function safeLoadAll(input, iterator, options) {
|
||||
if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') {
|
||||
options = iterator;
|
||||
iterator = null;
|
||||
}
|
||||
|
||||
return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
|
||||
function safeLoadAll(input, output, options) {
|
||||
loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
|
||||
}
|
||||
|
||||
|
||||
|
||||
12
node_modules/js-yaml/lib/js-yaml/schema.js
generated
vendored
12
node_modules/js-yaml/lib/js-yaml/schema.js
generated
vendored
@@ -16,7 +16,7 @@ function compileList(schema, name, result) {
|
||||
|
||||
schema[name].forEach(function (currentType) {
|
||||
result.forEach(function (previousType, previousIndex) {
|
||||
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
|
||||
if (previousType.tag === currentType.tag) {
|
||||
exclude.push(previousIndex);
|
||||
}
|
||||
});
|
||||
@@ -31,20 +31,16 @@ function compileList(schema, name, result) {
|
||||
|
||||
|
||||
function compileMap(/* lists... */) {
|
||||
var result = {
|
||||
scalar: {},
|
||||
sequence: {},
|
||||
mapping: {},
|
||||
fallback: {}
|
||||
}, index, length;
|
||||
var result = {}, index, length;
|
||||
|
||||
function collectType(type) {
|
||||
result[type.kind][type.tag] = result['fallback'][type.tag] = type;
|
||||
result[type.tag] = type;
|
||||
}
|
||||
|
||||
for (index = 0, length = arguments.length; index < length; index += 1) {
|
||||
arguments[index].forEach(collectType);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
5
node_modules/js-yaml/lib/js-yaml/type/binary.js
generated
vendored
5
node_modules/js-yaml/lib/js-yaml/type/binary.js
generated
vendored
@@ -75,10 +75,7 @@ function constructYamlBinary(data) {
|
||||
}
|
||||
|
||||
// Wrap into Buffer for NodeJS and leave Array for browser
|
||||
if (NodeBuffer) {
|
||||
// Support node 6.+ Buffer API when available
|
||||
return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result);
|
||||
}
|
||||
if (NodeBuffer) return new NodeBuffer(result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
17
node_modules/js-yaml/lib/js-yaml/type/float.js
generated
vendored
17
node_modules/js-yaml/lib/js-yaml/type/float.js
generated
vendored
@@ -4,27 +4,16 @@ var common = require('../common');
|
||||
var Type = require('../type');
|
||||
|
||||
var YAML_FLOAT_PATTERN = new RegExp(
|
||||
// 2.5e4, 2.5 and integers
|
||||
'^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
|
||||
// .2e4, .2
|
||||
// special case, seems not from spec
|
||||
'|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
|
||||
// 20:59
|
||||
'^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?' +
|
||||
'|\\.[0-9_]+(?:[eE][-+][0-9]+)?' +
|
||||
'|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' +
|
||||
// .inf
|
||||
'|[-+]?\\.(?:inf|Inf|INF)' +
|
||||
// .nan
|
||||
'|\\.(?:nan|NaN|NAN))$');
|
||||
|
||||
function resolveYamlFloat(data) {
|
||||
if (data === null) return false;
|
||||
|
||||
if (!YAML_FLOAT_PATTERN.test(data) ||
|
||||
// Quick hack to not allow integers end with `_`
|
||||
// Probably should update regexp & check speed
|
||||
data[data.length - 1] === '_') {
|
||||
return false;
|
||||
}
|
||||
if (!YAML_FLOAT_PATTERN.test(data)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
21
node_modules/js-yaml/lib/js-yaml/type/int.js
generated
vendored
21
node_modules/js-yaml/lib/js-yaml/type/int.js
generated
vendored
@@ -51,7 +51,7 @@ function resolveYamlInteger(data) {
|
||||
if (ch !== '0' && ch !== '1') return false;
|
||||
hasDigits = true;
|
||||
}
|
||||
return hasDigits && ch !== '_';
|
||||
return hasDigits;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ function resolveYamlInteger(data) {
|
||||
if (!isHexCode(data.charCodeAt(index))) return false;
|
||||
hasDigits = true;
|
||||
}
|
||||
return hasDigits && ch !== '_';
|
||||
return hasDigits;
|
||||
}
|
||||
|
||||
// base 8
|
||||
@@ -75,14 +75,11 @@ function resolveYamlInteger(data) {
|
||||
if (!isOctCode(data.charCodeAt(index))) return false;
|
||||
hasDigits = true;
|
||||
}
|
||||
return hasDigits && ch !== '_';
|
||||
return hasDigits;
|
||||
}
|
||||
|
||||
// base 10 (except 0) or base 60
|
||||
|
||||
// value should not start with `_`;
|
||||
if (ch === '_') return false;
|
||||
|
||||
for (; index < max; index++) {
|
||||
ch = data[index];
|
||||
if (ch === '_') continue;
|
||||
@@ -93,8 +90,7 @@ function resolveYamlInteger(data) {
|
||||
hasDigits = true;
|
||||
}
|
||||
|
||||
// Should have digits and should not end with `_`
|
||||
if (!hasDigits || ch === '_') return false;
|
||||
if (!hasDigits) return false;
|
||||
|
||||
// if !base60 - done;
|
||||
if (ch !== ':') return true;
|
||||
@@ -157,11 +153,10 @@ module.exports = new Type('tag:yaml.org,2002:int', {
|
||||
construct: constructYamlInteger,
|
||||
predicate: isInteger,
|
||||
represent: {
|
||||
binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },
|
||||
octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); },
|
||||
decimal: function (obj) { return obj.toString(10); },
|
||||
/* eslint-disable max-len */
|
||||
hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }
|
||||
binary: function (object) { return '0b' + object.toString(2); },
|
||||
octal: function (object) { return '0' + object.toString(8); },
|
||||
decimal: function (object) { return object.toString(10); },
|
||||
hexadecimal: function (object) { return '0x' + object.toString(16).toUpperCase(); }
|
||||
},
|
||||
defaultStyle: 'decimal',
|
||||
styleAliases: {
|
||||
|
||||
17
node_modules/js-yaml/lib/js-yaml/type/js/function.js
generated
vendored
17
node_modules/js-yaml/lib/js-yaml/type/js/function.js
generated
vendored
@@ -14,8 +14,7 @@ try {
|
||||
var _require = require;
|
||||
esprima = _require('esprima');
|
||||
} catch (_) {
|
||||
/* eslint-disable no-redeclare */
|
||||
/* global window */
|
||||
/*global window */
|
||||
if (typeof window !== 'undefined') esprima = window.esprima;
|
||||
}
|
||||
|
||||
@@ -31,8 +30,7 @@ function resolveJavascriptFunction(data) {
|
||||
if (ast.type !== 'Program' ||
|
||||
ast.body.length !== 1 ||
|
||||
ast.body[0].type !== 'ExpressionStatement' ||
|
||||
(ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
|
||||
ast.body[0].expression.type !== 'FunctionExpression')) {
|
||||
ast.body[0].expression.type !== 'FunctionExpression') {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -53,8 +51,7 @@ function constructJavascriptFunction(data) {
|
||||
if (ast.type !== 'Program' ||
|
||||
ast.body.length !== 1 ||
|
||||
ast.body[0].type !== 'ExpressionStatement' ||
|
||||
(ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
|
||||
ast.body[0].expression.type !== 'FunctionExpression')) {
|
||||
ast.body[0].expression.type !== 'FunctionExpression') {
|
||||
throw new Error('Failed to resolve function');
|
||||
}
|
||||
|
||||
@@ -66,14 +63,8 @@ function constructJavascriptFunction(data) {
|
||||
|
||||
// Esprima's ranges include the first '{' and the last '}' characters on
|
||||
// function expressions. So cut them out.
|
||||
if (ast.body[0].expression.body.type === 'BlockStatement') {
|
||||
/*eslint-disable no-new-func*/
|
||||
return new Function(params, source.slice(body[0] + 1, body[1] - 1));
|
||||
}
|
||||
// ES6 arrow functions can omit the BlockStatement. In that case, just return
|
||||
// the body.
|
||||
/*eslint-disable no-new-func*/
|
||||
return new Function(params, 'return ' + source.slice(body[0], body[1]));
|
||||
return new Function(params, source.slice(body[0] + 1, body[1] - 1));
|
||||
}
|
||||
|
||||
function representJavascriptFunction(object /*, style*/) {
|
||||
|
||||
21
node_modules/js-yaml/package.json
generated
vendored
21
node_modules/js-yaml/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "js-yaml",
|
||||
"version": "3.14.1",
|
||||
"version": "3.6.1",
|
||||
"description": "YAML 1.2 parser and serializer",
|
||||
"keywords": [
|
||||
"yaml",
|
||||
@@ -26,22 +26,19 @@
|
||||
"bin": {
|
||||
"js-yaml": "bin/js-yaml.js"
|
||||
},
|
||||
"unpkg": "dist/js-yaml.min.js",
|
||||
"jsdelivr": "dist/js-yaml.min.js",
|
||||
"dependencies": {
|
||||
"argparse": "^1.0.7",
|
||||
"esprima": "^4.0.0"
|
||||
"esprima": "^2.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ansi": "^0.3.1",
|
||||
"benchmark": "^2.1.4",
|
||||
"browserify": "^16.2.2",
|
||||
"ansi": "*",
|
||||
"benchmark": "*",
|
||||
"browserify": "^13.0.0",
|
||||
"codemirror": "^5.13.4",
|
||||
"eslint": "^7.0.0",
|
||||
"fast-check": "^1.24.2",
|
||||
"istanbul": "^0.4.5",
|
||||
"mocha": "^7.1.2",
|
||||
"uglify-js": "^3.0.1"
|
||||
"eslint": "^2.8.0",
|
||||
"istanbul": "*",
|
||||
"mocha": "*",
|
||||
"uglify-js": "^2.6.1"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "make test"
|
||||
|
||||
Reference in New Issue
Block a user