FileSystemHandle.isSameEntry()

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

安全なコンテキスト用: この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (HTTPS) でのみ利用できます。

FileSystemHandle インターフェイスの isSameEntry() メソッドは、2 個のハンドルを比較し、対応するエントリー (ファイルまたはディレクトリー) が一致するかを確認します。

構文

js
isSameEntry(fileSystemHandle)

引数

FileSystemHandle

メソッドを呼び出すハンドルと比較する FileSystemHandle です。

返値

エントリーが一致するとき true となる Boolean を返します。

例外

例外は投げられません。

以下の関数は、1 個のエントリーをエントリーの配列と比較し、一致するエントリーを全て取り除いた新しい配列を返します。

js
function removeMatches(fileEntry, entriesArr) {
  let newArr = entriesArr.filter((entry) => !fileEntry.isSameEntry(entry));

  return newArr;
}

仕様書

Specification
File System Standard
# api-filesystemhandle-issameentry

ブラウザーの互換性

BCD tables only load in the browser

関連情報