// 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.

// deno-lint-ignore no-explicit-any
export type Any = any;

export function isBoolean(value: unknown): value is boolean {
  return typeof value === "boolean" || value instanceof Boolean;
}

export function isNull(value: unknown): value is null {
  return value === null;
}

export function isObject(value: unknown): value is Record<string, unknown> {
  return value !== null && typeof value === "object";
}

export function repeat(str: string, count: number): string {
  let result = "";

  for (let cycle = 0; cycle < count; cycle++) {
    result += str;
  }

  return result;
}

export function isNegativeZero(i: number): boolean {
  return i === 0 && Number.NEGATIVE_INFINITY === 1 / i;
}

export interface ArrayObject<T = Any> {
  [P: string]: T;
}

// denoCacheMetadata={"headers":{"content-length":"1021","access-control-expose-headers":"*","age":"1700001","vary":"Origin","content-type":"text/typescript","date":"Tue, 28 Jul 2026 12:31:15 GMT","cf-cache-status":"HIT","cf-ray":"a223e657fb2c7db6-LAX","cross-origin-resource-policy":"cross-origin","x-jsr-backend":"modules","x-robots-tag":"noindex","accept-ranges":"bytes","alt-svc":"h3=\":443\"; ma=86400","cache-control":"public, max-age=31536000, immutable","content-security-policy":"default-src 'none'; script-src 'none'; style-src 'none'; img-src 'none'; font-src 'none'; connect-src 'none'; frame-src 'none'; object-src 'none'; frame-ancestors 'none'; sandbox; form-action 'none';","report-to":"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=c5qKz%2BMBibtOsTuzuf%2Bp9Sap5hc0UenBOLoAu3dlNiEEudVzeIEZODMfvZDf8JSC9382HIrTGxuC79SHG3cmPRYzkmq6ATdAgrhDdtcWDLLfU75UIeca3M0%3D\"}]}","access-control-allow-origin":"*","etag":"\"c8601a5cbf8b24bd148c4f42d34ed37c\"","server":"cloudflare","set-cookie":"__cf_bm=2uNFImyGSixz_DdVenvWzTudLtvPxDgI2wovhbaPXrw-1785241875.204828-1.0.1.1-Yq0S1VcZAnQmrLJbuxBrqifVDiviMqLkg9OasQXFXuvvCsYKqWQOVW2cpgBxknxlNjFms6XY00wRihIz_wr2PttLG09kEoPTTp_iu8MWHa0xt.AufS4EKILhUlNjbz6D; HttpOnly; SameSite=None; Secure; Path=/; Domain=jsr.io; Expires=Tue, 28 Jul 2026 13:01:15 GMT","x-content-type-options":"nosniff","nel":"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}"},"url":"https://jsr.io/@std/yaml/0.224.3/_utils.ts","time":1785241875}