UNPKG

868 BJavaScriptView Raw
1"use strict";
2/*
3 * @adonisjs/sink
4 *
5 * (c) Harminder Virk <virk@adonisjs.com>
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
10Object.defineProperty(exports, "__esModule", { value: true });
11exports.YamlFile = void 0;
12const mrm_core_1 = require("mrm-core");
13const KeyValuePair_1 = require("../Base/KeyValuePair");
14/**
15 * Exposes the API to work with Yaml files.
16 *
17 * ```ts
18 * const yaml = new YamlFile(__dirname, '.travis.yml')
19 * yaml.set('language', 'node_js')
20 * yaml.set('language', [4, 6])
21 *
22 * yaml.commit()
23 * ```
24 */
25class YamlFile extends KeyValuePair_1.KeyValuePair {
26 constructor(basePath, filename) {
27 super(basePath);
28 this.cdIn();
29 this.filePointer = (0, mrm_core_1.yaml)(filename);
30 this.cdOut();
31 }
32}
33exports.YamlFile = YamlFile;