// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.

import type { Closer } from "./types.ts";

export function isCloser(value: unknown): value is Closer {
  return typeof value === "object" && value !== null && value !== undefined &&
    "close" in value &&
    // deno-lint-ignore no-explicit-any
    typeof (value as Record<string, any>)["close"] === "function";
}

// denoCacheMetadata={"headers":{"alt-svc":"h3=\":443\"; ma=86400","cache-control":"public, max-age=31536000, immutable","content-length":"429","etag":"\"cb590d97bee8d501aad1dc73bb47003a\"","access-control-allow-origin":"*","set-cookie":"__cf_bm=q8P9hr9OWZecrRpYik.Hj0jkD.SfUZUTJ3nMOyClElU-1785241875.2262242-1.0.1.1-rDC6TZmAcqjpwconnEQDakJows2gEztcOa1gSrpeju5qp9aDpUo_T4SE6QKL6Q0dgCE.lU2inZ4CaaGmnQ0Xn_cS5om9Ca9OSH3gSLi4.4RCkTlJ918lU447q313arCa; HttpOnly; SameSite=None; Secure; Path=/; Domain=jsr.io; Expires=Tue, 28 Jul 2026 13:01:15 GMT","x-robots-tag":"noindex","nel":"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}","x-content-type-options":"nosniff","vary":"Origin","cf-ray":"a223e6581b857db6-LAX","x-jsr-backend":"modules","access-control-expose-headers":"*","server":"cloudflare","report-to":"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=uhQTurfzNfMKP7F%2FR7AzCFymSrzO%2BvzY%2BVLkWBtY%2FWhONtbjxfj8HMSiHNhPGYB04iaqb2ns0q7QEAZB5kt518qNMfj9oPoppGzQDmw6RQEWm2SmxeCdILs%3D\"}]}","date":"Tue, 28 Jul 2026 12:31:15 GMT","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';","cross-origin-resource-policy":"cross-origin","content-type":"text/typescript"},"url":"https://jsr.io/@std/io/0.224.8/_common.ts","time":1785241875}