mirror of
https://github.com/actions/labeler.git
synced 2025-12-15 14:37:35 +00:00
build
This commit is contained in:
39
node_modules/js-yaml/README.md
generated
vendored
39
node_modules/js-yaml/README.md
generated
vendored
@@ -80,12 +80,12 @@ your own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and
|
||||
info.
|
||||
|
||||
``` javascript
|
||||
yaml = require('js-yaml');
|
||||
fs = require('fs');
|
||||
const yaml = require('js-yaml');
|
||||
const fs = require('fs');
|
||||
|
||||
// Get document, or throw exception on error
|
||||
try {
|
||||
var doc = yaml.safeLoad(fs.readFileSync('/home/ixti/example.yml', 'utf8'));
|
||||
const doc = yaml.safeLoad(fs.readFileSync('/home/ixti/example.yml', 'utf8'));
|
||||
console.log(doc);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
@@ -95,9 +95,9 @@ try {
|
||||
|
||||
### safeLoad (string [ , options ])
|
||||
|
||||
**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.
|
||||
**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.
|
||||
|
||||
options:
|
||||
|
||||
@@ -135,7 +135,7 @@ The core schema also has no such restrictions. It allows binary notation for int
|
||||
must additionally validate object structure to avoid injections:
|
||||
|
||||
``` javascript
|
||||
var untrusted_code = '"toString": !<tag:yaml.org,2002:js/function> "function (){very_evil_thing();}"';
|
||||
const 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) + ''
|
||||
@@ -148,7 +148,7 @@ Same as `safeLoad()`, but understands multi-document sources. Applies
|
||||
`iterator` to each document if specified, or returns array of documents.
|
||||
|
||||
``` javascript
|
||||
var yaml = require('js-yaml');
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
yaml.safeLoadAll(data, function (doc) {
|
||||
console.log(doc);
|
||||
@@ -291,24 +291,9 @@ So, the following YAML document cannot be loaded.
|
||||
```
|
||||
|
||||
|
||||
Breaking changes in 2.x.x -> 3.x.x
|
||||
----------------------------------
|
||||
js-yaml for enterprise
|
||||
----------------------
|
||||
|
||||
If you have not used __custom__ tags or loader classes and not loaded yaml
|
||||
files via `require()`, no changes are needed. Just upgrade the library.
|
||||
Available as part of the Tidelift Subscription
|
||||
|
||||
Otherwise, you should:
|
||||
|
||||
1. Replace all occurrences of `require('xxxx.yml')` by `fs.readFileSync()` +
|
||||
`yaml.safeLoad()`.
|
||||
2. rewrite your custom tags constructors and custom loader
|
||||
classes, to conform the 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).
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user