// Ported from js-yaml v3.13.1:
// https://github.com/nodeca/js-yaml/commit/665aadda42349dcae869f12040d9b10ef18d12da
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.
import { load, loadAll } from "./_loader/loader.ts";
import { replaceSchemaNameWithSchemaClass } from "./mod.ts";
/**
 * Parse `content` as single YAML document, and return it.
 *
 * This function does not support regexps, functions, and undefined by default.
 * This method is safe for parsing untrusted data.
 *
 * @example Usage
 * ```ts
 * import { parse } from "@std/yaml/parse";
 * import { assertEquals } from "@std/assert/assert-equals";
 *
 * const data = parse(`
 * id: 1
 * name: Alice
 * `);
 *
 * assertEquals(data, { id: 1, name: "Alice" });
 * ```
 *
 * @throws {YAMLError} Throws error on invalid YAML.
 * @param content YAML string to parse.
 * @param options Parsing options.
 * @returns Parsed document.
 */ export function parse(content, options) {
  replaceSchemaNameWithSchemaClass(options);
  // deno-lint-ignore no-explicit-any
  return load(content, options);
}
export function parseAll(content, iteratorOrOption, options) {
  if (typeof iteratorOrOption !== "function") {
    replaceSchemaNameWithSchemaClass(iteratorOrOption);
  }
  replaceSchemaNameWithSchemaClass(options);
  // deno-lint-ignore no-explicit-any
  return loadAll(content, iteratorOrOption, options);
}
//# sourceMappingURL=data:application/json;base64,[encoded data, 6004 characters]