SearchKey

Chercher une clé dans un objet JS en mode strict ou include sur différents niveaux de profondeur.

Ten skrypt nie powinien być instalowany bezpośrednio. Jest to biblioteka dla innych skyptów do włączenia dyrektywą meta // @require https://update.greasyfork.org/scripts/578734/1828936/SearchKey.js

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

Autor
Atlantis-JS
Wersja
0.0.1.20260518141033
Utworzono
18-05-2026
Zaktualizowano
18-05-2026
Rozmiar
1,37 KB
Licencja
Brak licencji

Chercher une clé dans un objet JS en mode strict ou include sur différents niveaux de profondeur.

Skip les valeurs falsy (null, undefined, "", 0, false) et continue la recherche.

  • -
  • param {Object} target - L'objet dans lequel chercher
  • param {string} searchedKey - Le nom de clé à chercher
  • param {boolean} strictName - true = nom exact, false = includes (défaut: true)
  • param {number} maxDepth - Profondeur de recherche, 1 = niveau courant seulement (défaut: 1)
  • example
  • searchKey(state, 'search_key_2'); // nom exact, niveau courant
  • searchKey(cache, 'key', false); // includes, niveau courant
  • searchKey(state, 'key', false, 20); // includes, recherche profonde
  • searchKey(state, 'search_key_2', true, 20); // nom exact, recherche profonde