このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

FileSystemHandle.isSameEntry()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2023年3月⁩.

安全なコンテキスト用: この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (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
# api-filesystemhandle-issameentry

ブラウザーの互換性

関連情報