async function loadJSONFixture(pathOrJson) {
  /** @type {Volume} */
  let vol
  await Promise.resolve()
  if (isString(pathOrJson) || pathOrJson instanceof URL) {
    if (loadJSONFixture.dirJsonCache.has(pathOrJson)) {
      vol = Volume.fromJSON(
        /** @type {DirectoryJSON} */ (
          loadJSONFixture.dirJsonCache.get(pathOrJson)
        )
      )
    } else if (loadJSONFixture.snapshotCache.has(pathOrJson)) {
      vol = await createVolFromSnapshot(
        /** @type {JsonUint8Array<SnapshotNode>} */ (
          loadJSONFixture.snapshotCache.get(pathOrJson)
        )
      )
    } else {
      const filepath = pathOrJson
      const rawJson = await fs.promises.readFile(filepath)
      if (isCompactJson(rawJson)) {
        loadJSONFixture.snapshotCache.set(pathOrJson, rawJson)
        vol = await createVolFromSnapshot(rawJson)
      } else {
        const dirJson = JSON.parse(rawJson.toString('utf-8'))
        loadJSONFixture.dirJsonCache.set(pathOrJson, dirJson)
        vol = Volume.fromJSON(dirJson)
      }
    }
  } else {
    const json = pathOrJson
    vol = isCompactJson(json)
      ? await createVolFromSnapshot(json)
      : Volume.fromJSON(json)
  }

  const readPowers = makeReadPowers({ fs: /** @type {FsInterface} */ (vol) })
  return { vol, readPowers }
}
Loads a fixture JSON file or `DirectoryJSON` object or a "Compact JSON" value
and resolves w/ a `Volume` and read powers.

If a "Compact JSON" value, it must be a `Uint8Array`.

Caches anything it loads from disk.

@remarks
`memfs` provides two (or three) different snapshot formats; the first is a
plain JSON object which can be loaded into a `Volume` via
{@link Volume.fromJSON}. The newer "snapshot" format is a binary JSON type
which looks to be more performant which has better handling of binary data
(e.g., _native modules_) and supports symlinks. That's why we load the
fixture into a `Buffer` instead of a `string`; once we've determined the
value is _not_ a "Compact JSON" snapshot, we can parse it as a
`DirectoryJSON` object using {@link JSON.parse}.
@param {string | URL | DirectoryJSON | JsonUint8Array<SnapshotNode>} pathOrJson
  Path to fixture JSON or directory object
@returns {Promise<{
  vol: Volume
  readPowers: ReadNowPowers
}>}
@see {@link https://github.com/streamich/memfs/blob/master/docs/snapshot/index.md}
@todo Standardize entry point filename and return the entry point path.