@stryke/fs 0.28.1 → 0.28.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/yaml.cjs CHANGED
@@ -5,24 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.readYamlFile = readYamlFile;
7
7
  exports.readYamlFileSync = readYamlFileSync;
8
+ var _yaml = require("yaml");
8
9
  var _readFile = require("./read-file.cjs");
9
- function readYamlFileSync(e, n) {
10
- const a = (0, _readFile.readFileSync)(e),
11
- {
12
- load: o
13
- } = require("@zkochan/js-yaml");
14
- return o(a, {
15
- ...n,
16
- filename: e
17
- });
10
+ function readYamlFileSync(e, t) {
11
+ return (0, _yaml.parse)((0, _readFile.readFileSync)(e), t);
18
12
  }
19
- async function readYamlFile(e, n) {
20
- const a = await (0, _readFile.readFile)(e),
21
- {
22
- load: o
23
- } = require("@zkochan/js-yaml");
24
- return o(a, {
25
- ...n,
26
- filename: e
27
- });
13
+ async function readYamlFile(e, t = {}) {
14
+ return (0, _yaml.parse)(await (0, _readFile.readFile)(e), t);
28
15
  }
package/dist/yaml.d.ts CHANGED
@@ -1,9 +1,5 @@
1
- export interface YamlReadOptions {
2
- /**
3
- * Compatibility with JSON.parse behavior. If true, then duplicate keys in a mapping will override values rather than throwing an error.
4
- */
5
- json?: boolean;
6
- }
1
+ import type { DocumentOptions, ParseOptions, SchemaOptions, ToJSOptions } from "yaml";
2
+ export type YamlReadOptions = ParseOptions & DocumentOptions & SchemaOptions & ToJSOptions;
7
3
  /**
8
4
  * Reads a YAML file and returns the object the YAML content represents.
9
5
  *
package/dist/yaml.mjs CHANGED
@@ -1 +1 @@
1
- import{readFile as t,readFileSync as r}from"./read-file";export function readYamlFileSync(e,n){const a=r(e),{load:o}=require("@zkochan/js-yaml");return o(a,{...n,filename:e})}export async function readYamlFile(e,n){const a=await t(e),{load:o}=require("@zkochan/js-yaml");return o(a,{...n,filename:e})}
1
+ import{parse as o}from"yaml";import{readFile as n,readFileSync as a}from"./read-file";export function readYamlFileSync(e,t){return o(a(e),t)}export async function readYamlFile(e,t={}){return o(await n(e),t)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stryke/fs",
3
- "version": "0.28.1",
3
+ "version": "0.28.3",
4
4
  "type": "module",
5
5
  "description": "A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.",
6
6
  "repository": {
@@ -16,15 +16,15 @@
16
16
  "@ltd/j-toml": "^1.38.0",
17
17
  "@storm-software/config-tools": "latest",
18
18
  "@stryke/convert": "^0.5.0",
19
- "@stryke/path": "^0.13.1",
19
+ "@stryke/path": "^0.14.0",
20
20
  "@stryke/string-format": "^0.11.0",
21
- "@zkochan/js-yaml": "^0.0.7",
22
21
  "chalk": "^5.4.1",
23
22
  "defu": "^6.1.4",
24
23
  "glob": "^11.0.1",
25
24
  "mlly": "1.7.4",
26
25
  "nanotar": "^0.2.0",
27
26
  "semver": "7.7.1",
27
+ "yaml": "^2.8.1",
28
28
  "@stryke/json": "^0.9.3",
29
29
  "@stryke/type-checks": "^0.3.9",
30
30
  "@stryke/types": "^0.8.9"
@@ -395,5 +395,5 @@
395
395
  "main": "./dist/index.cjs",
396
396
  "module": "./dist/index.mjs",
397
397
  "types": "./dist/index.d.ts",
398
- "gitHead": "42d98e1558382fc90bcd857b1d5d1d75c546c7c6"
398
+ "gitHead": "e16a03d7f9db49ef07f8b9368c56182fa84e2bf6"
399
399
  }