3.1.1 • Published 2 years ago

wsearch v3.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

wsearch

Function to search values (or keys) in objects by RegExp.

Installation

  • from package manager
npm i wsearch

and import into your file:

const wsearch = require('wsearch');
//or
import wsearch from 'wsearch';
  • from browser DevTools
Put code from "wsearch.min.js" to the target page console.

Basic usage

wsearch(query, {target}[, options])

Nesting target in the object with a single property is required for valid path in output.

Default search prototypes: ["Window", "Object", "Array", "Set", "Map", "Function"]

  • query \<RegExp> Search query
  • target \<Object> | \<Array> | etc. Object with any prototype to search
  • options \<Object> - byKeys \<boolean> Default: false Change the mode to search by property names. - functions \<boolean> Default: false Add functions body to search. - typesAdd \<Array> Add prototypes to defaults (like "Location", "Navigator" etc.). You can get type of any object:
    	```js
    	Object.prototype.toString.call(object);
    	```
    - `typesSet` \<Array\> | "all"
    Replace defaults prototypes.

With parameter "all" search will be performed in all prototypes in target object that are found and maybe will take a lot of time.

  • Returns: \<Array>

For example:

wsearch(/Hello\sworld/, {window}, {functions: true});

Output:

[
	{
		path: <string path to value>,
		match: <array of matches>,
		object: <object>,
		key: <key>,
		value: <value>
	},
	...
]

Info

If the found path includes Map/Set object or Symbol, access to the keys will be performed through an array with index valid at the time of the search.

3.1.1

2 years ago

3.1.0

2 years ago

3.0.0

2 years ago

2.0.13

2 years ago

2.0.12

2 years ago

2.0.11

2 years ago

2.0.10

2 years ago

2.0.9

2 years ago

2.0.8

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago