1.0.5 • Published 3 years ago

@yaml-tools/visit-operator v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

@yaml-tools/visit-operator

A utility for the yaml package to process special nodes, lets call them operators, with the purpose of making plain YAML a little bit smarter.

With this visitor, you can implement YAML file inclusion or node substitution for example. Visitors can return a new map, sequence, scalar or undefined.

Basic example

+with:
  - hello
import visitOperator from `@yaml-tools/visit-operator`;

const newYaml = visitOperator(yaml, '+with', (args, node) => {
  // args === []
  return ...
});

Arguments example

+with a b c:
  - hello
const newYaml = visitOperator(yaml, '+with', (args, node) => {
  // args === ['a', 'b', 'c']
  return ...
});
1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago