{"id":16208466,"url":"https://github.com/ehmicky/wild-wild-utils","last_synced_at":"2025-04-09T14:06:33.645Z","repository":{"id":40602312,"uuid":"473357320","full_name":"ehmicky/wild-wild-utils","owner":"ehmicky","description":"🤠 Functional utilities using object property paths with wildcards and regexps 🌵","archived":false,"fork":false,"pushed_at":"2025-03-29T03:19:14.000Z","size":9862,"stargazers_count":38,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-02T12:08:30.929Z","etag":null,"topics":["algorithm","data-structures","filter","functional-programming","glob","globbing","globstar","javascript","json","library","map","nodejs","parsing","path","recursion","regex","regexp","regular-expression","typescript","wildcard"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ehmicky.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-23T21:01:42.000Z","updated_at":"2025-03-29T03:19:17.000Z","dependencies_parsed_at":"2023-02-19T11:31:44.357Z","dependency_job_id":"7ffde614-c4b1-4c7e-a7c7-d6a52c46a120","html_url":"https://github.com/ehmicky/wild-wild-utils","commit_stats":{"total_commits":522,"total_committers":2,"mean_commits":261.0,"dds":0.01532567049808431,"last_synced_commit":"4b80ed81192b2b3c1eea8fd1a9586d7969f088d8"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehmicky%2Fwild-wild-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehmicky%2Fwild-wild-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehmicky%2Fwild-wild-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehmicky%2Fwild-wild-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ehmicky","download_url":"https://codeload.github.com/ehmicky/wild-wild-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054227,"owners_count":21039952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","data-structures","filter","functional-programming","glob","globbing","globstar","javascript","json","library","map","nodejs","parsing","path","recursion","regex","regexp","regular-expression","typescript","wildcard"],"created_at":"2024-10-10T10:17:07.942Z","updated_at":"2025-04-09T14:06:33.614Z","avatar_url":"https://github.com/ehmicky.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg alt=\"wild-wild-utils logo\" src=\"https://raw.githubusercontent.com/ehmicky/design/main/wild-wild-utils/wild-wild-utils.svg?sanitize=true\" width=\"700\"/\u003e\n\n[![Node](https://img.shields.io/badge/-Node.js-808080?logo=node.js\u0026colorA=404040\u0026logoColor=66cc33)](https://www.npmjs.com/package/wild-wild-utils)\n[![Browsers](https://img.shields.io/badge/-Browsers-808080?logo=firefox\u0026colorA=404040)](https://unpkg.com/wild-wild-utils?module)\n[![TypeScript](https://img.shields.io/badge/-Typed-808080?logo=typescript\u0026colorA=404040\u0026logoColor=0096ff)](/src/main.d.ts)\n[![Codecov](https://img.shields.io/badge/-Tested%20100%25-808080?logo=codecov\u0026colorA=404040)](https://codecov.io/gh/ehmicky/wild-wild-utils)\n[![Minified size](https://img.shields.io/bundlephobia/minzip/wild-wild-utils?label\u0026colorA=404040\u0026colorB=808080\u0026logo=webpack)](https://bundlephobia.com/package/wild-wild-utils)\n[![Mastodon](https://img.shields.io/badge/-Mastodon-808080.svg?logo=mastodon\u0026colorA=404040\u0026logoColor=9590F9)](https://fosstodon.org/@ehmicky)\n[![Medium](https://img.shields.io/badge/-Medium-808080.svg?logo=medium\u0026colorA=404040)](https://medium.com/@ehmicky)\n\n🤠 Functional utilities using object property paths with wildcards and regexps.\n🌵\n\nAvailable functional methods include:\n\n- 🗺️ Mapping: [`map()`](#maptarget-query-mapfunction-options),\n  [`flatten()`](#flattentarget-options)\n- 🚂 Merging/concatenating: [`merge()`](#mergetarget-query-value-options),\n  [`push()`](#pushtarget-query-values-options),\n  [`unshift()`](#unshifttarget-query-values-options)\n- ⛏️ Finding: [`find()`](#findtarget-query-testfunction-options)\n- ⭐ Filtering: [`pick()`](#picktarget-query-options),\n  [`include()`](#includetarget-query-testfunction-options),\n  [`exclude()`](#excludetarget-query-testfunction-options)\n\nUnlike similar libraries, object properties can be get/set using\n[dot-delimited paths](https://github.com/ehmicky/wild-wild-path#%EF%B8%8F-deep-properties),\n[wildcards](https://github.com/ehmicky/wild-wild-path#-wildcards),\n[regexps](https://github.com/ehmicky/wild-wild-path#%EF%B8%8F-regexps),\n[slices](https://github.com/ehmicky/wild-wild-path#%EF%B8%8F-array-slices) and\n[unions](https://github.com/ehmicky/wild-wild-path#-unions). It is built on top\nof [`wild-wild-path`](https://github.com/ehmicky/wild-wild-path).\n\n# Install\n\n```bash\nnpm install wild-wild-utils\n```\n\nThis package works in both Node.js \u003e=18.18.0 and\n[browsers](https://raw.githubusercontent.com/ehmicky/dev-tasks/main/src/browserslist).\n\nThis is an ES module. It must be loaded using\n[an `import` or `import()` statement](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c),\nnot `require()`. If TypeScript is used, it must be configured to\n[output ES modules](https://www.typescriptlang.org/docs/handbook/esm-node.html),\nnot CommonJS.\n\n# API\n\n## Methods\n\n### map(target, query, mapFunction, options?)\n\n`target`: [`Target`](https://github.com/ehmicky/wild-wild-path#target)\\\n`query`: [`Query`](https://github.com/ehmicky/wild-wild-path#queries)\\\n`mapFunction`: `(value) =\u003e value`\\\n`options`: [`Options?`](#options)\\\n_Return value_: [`Target`](https://github.com/ehmicky/wild-wild-path#target)\n\nUse a `mapFunction()` to modify any property matching the `query`.\n\n```js\nconst target = { user: { firstName: 'Alice', lastName: 'Smith' } }\nmap(target, 'user.*', (userProp) =\u003e userProp.toLowerCase())\n// { user: { firstName: 'alice', lastName: 'smith' } }\n```\n\n### merge(target, query, value, options?)\n\n`target`: [`Target`](https://github.com/ehmicky/wild-wild-path#target)\\\n`query`: [`Query`](https://github.com/ehmicky/wild-wild-path#queries)\\\n`value`: `any`\\\n`options`: [`Options?`](#options)\\\n_Return value_: [`Target`](https://github.com/ehmicky/wild-wild-path#target)\n\nDeeply merge an object `value` with each object property matching the `query`.\n\nIf one of these properties is not an object, it is overridden instead.\n\n[Any object in `value` can change](https://github.com/ehmicky/declarative-merge#nesting)\nthe merge mode using a `_merge` property with value\n[`\"deep\"`](https://github.com/ehmicky/declarative-merge#deep-merge) (default),\n[`\"shallow\"`](https://github.com/ehmicky/declarative-merge#shallow-merge),\n[`\"set\"`](https://github.com/ehmicky/declarative-merge#no-merge) or\n[`\"delete\"`](https://github.com/ehmicky/declarative-merge#delete).\n\nArrays\n[can be merged using objects in `value`](https://github.com/ehmicky/declarative-merge#arrays)\nwhere the keys are the\n[array indices](https://github.com/ehmicky/declarative-merge#update). Items can\nbe [updated](https://github.com/ehmicky/declarative-merge#update),\n[merged](https://github.com/ehmicky/declarative-merge#merge),\n[added](https://github.com/ehmicky/declarative-merge#add),\n[inserted](https://github.com/ehmicky/declarative-merge#insert),\n[appended](https://github.com/ehmicky/declarative-merge#append),\n[prepended](https://github.com/ehmicky/declarative-merge#prepend) or\n[deleted](https://github.com/ehmicky/declarative-merge#delete-1).\n\n```js\nconst target = {\n  userOne: { names: ['Alice', 'Smith'], settings: { deleted: true } },\n  userTwo: { names: ['John', 'Doe'], settings: { deleted: false } },\n}\n\nmerge(target, '*', { age: 72, settings: { admin: true } })\n// {\n//   userOne: {\n//     names: ['Alice', 'Smith'],\n//     settings: { deleted: true, admin: true },\n//     age: 72,\n//   },\n//   userTwo: {\n//     names: ['John', 'Doe'],\n//     settings: { deleted: false, admin: true },\n//     age: 72,\n//   },\n// }\n\nmerge(target, '*', { age: 72, settings: { admin: true }, _merge: 'shallow' })\n// {\n//   userOne: {\n//     names: [ 'Alice', 'Smith' ],\n//     settings: { admin: true },\n//     age: 72,\n//   },\n//   userTwo: {\n//     names: [ 'John', 'Doe' ],\n//     settings: { admin: true },\n//     age: 72,\n//   },\n// }\n\nmerge(target, '*', { names: { 1: 'Red' } })\n// {\n//   userOne: {\n//     names: ['Alice', 'Red'],\n//     settings: { deleted: true },\n//     age: 72,\n//   },\n//   userTwo: {\n//     names: ['John', 'Red'],\n//     settings: { deleted: false },\n//     age: 72,\n//   },\n// }\n```\n\n### push(target, query, values, options?)\n\n`target`: [`Target`](https://github.com/ehmicky/wild-wild-path#target)\\\n`query`: [`Query`](https://github.com/ehmicky/wild-wild-path#queries)\\\n`values`: `any[]`\\\n`options`: [`Options?`](#options)\\\n_Return value_: [`Target`](https://github.com/ehmicky/wild-wild-path#target)\n\nConcatenate an array of `values` with each array property matching the `query`.\n\nIf one of these properties is not an array, it is overridden instead.\n\n```js\nconst target = {\n  userOne: { firstName: 'Alice', colors: ['red'] },\n  userTwo: { firstName: 'John', colors: ['blue'] },\n}\npush(target, '*.colors', ['yellow', 'silver'])\n// {\n//   userOne: { firstName: 'Alice', colors: ['red', 'yellow', 'silver'] },\n//   userTwo: { firstName: 'John', colors: ['blue', 'yellow', 'silver'] },\n// }\n```\n\n### unshift(target, query, values, options?)\n\n`target`: [`Target`](https://github.com/ehmicky/wild-wild-path#target)\\\n`query`: [`Query`](https://github.com/ehmicky/wild-wild-path#queries)\\\n`values`: `any[]`\\\n`options`: [`Options?`](#options)\\\n_Return value_: [`Target`](https://github.com/ehmicky/wild-wild-path#target)\n\nLike [`push()`](#pushtarget-query-values-options) but concatenates at the\nbeginning of each property instead of at the end.\n\n```js\nconst target = {\n  userOne: { firstName: 'Alice', colors: ['red'] },\n  userTwo: { firstName: 'John', colors: ['blue'] },\n}\nunshift(target, '*.colors', ['yellow', 'silver'])\n// {\n//   userOne: { firstName: 'Alice', colors: ['yellow', 'silver', 'red'] },\n//   userTwo: { firstName: 'John', colors: ['yellow', 'silver', 'blue'] },\n// }\n```\n\n### find(target, query, testFunction, options?)\n\n`target`: [`Target`](https://github.com/ehmicky/wild-wild-path#target)\\\n`query`: [`Query`](https://github.com/ehmicky/wild-wild-path#queries)\\\n`testFunction`: `(value) =\u003e boolean`\\\n`options`: [`Options?`](#options)\\\n_Return value_: `any`\n\nReturn the first property that matches the `query` and that returns `true` with\nthe `testFunction()`.\n\n```js\nconst target = {\n  userOne: { firstName: 'Alice', colors: ['red'] },\n  userTwo: { firstName: 'John', colors: ['blue'] },\n}\nfind(target, '*.firstName', (firstName) =\u003e firstName !== 'John') // 'Alice'\n```\n\n### pick(target, query, options?)\n\n`target`: [`Target`](https://github.com/ehmicky/wild-wild-path#target)\\\n`query`: [`Query`](https://github.com/ehmicky/wild-wild-path#queries)\\\n`options`: [`Options?`](#options)\\\n_Return value_: [`Target`](https://github.com/ehmicky/wild-wild-path#target)\n\nKeep only the properties matching the `query`.\n\n```js\nconst target = {\n  userOne: { firstName: 'Alice', lastName: 'Smith', age: 72, admin: true },\n  userTwo: { firstName: 'John', lastName: 'Doe', age: 72, admin: true },\n}\npick(target, '*./Name/')\n// {\n//   userOne: { firstName: 'Alice', lastName: 'Smith' },\n//   userTwo: { firstName: 'John', lastName: 'Doe' },\n// }\n```\n\n### include(target, query, testFunction, options?)\n\n`target`: [`Target`](https://github.com/ehmicky/wild-wild-path#target)\\\n`query`: [`Query`](https://github.com/ehmicky/wild-wild-path#queries)\\\n`testFunction`: `(value) =\u003e boolean`\\\n`options`: [`Options?`](#options)\\\n_Return value_: [`Target`](https://github.com/ehmicky/wild-wild-path#target)\n\nKeep only the properties that match the `query` and that return `true` with the\n`testFunction()`.\n\n```js\nconst target = {\n  userOne: { firstName: 'Alice', lastName: 'Smith', age: 72, admin: true },\n  userTwo: { firstName: 'John', lastName: 'Doe', age: 72, admin: true },\n}\ninclude(target, '**', (value) =\u003e typeof value === 'string')\n// {\n//   userOne: { firstName: 'Alice', lastName: 'Smith' },\n//   userTwo: { firstName: 'John', lastName: 'Doe' },\n// }\n```\n\n### exclude(target, query, testFunction, options?)\n\n`target`: [`Target`](https://github.com/ehmicky/wild-wild-path#target)\\\n`query`: [`Query`](https://github.com/ehmicky/wild-wild-path#queries)\\\n`testFunction`: `(value) =\u003e boolean`\\\n`options`: [`Options?`](#options)\\\n_Return value_: [`Target`](https://github.com/ehmicky/wild-wild-path#target)\n\nRemove any property that matches the `query` and that returns `true` with the\n`testFunction()`.\n\n```js\nconst target = {\n  userOne: { firstName: 'Alice', lastName: 'Smith', age: 72, admin: true },\n  userTwo: { firstName: 'John', lastName: 'Doe', age: 72, admin: true },\n}\nexclude(target, '**', (value) =\u003e typeof value === 'string')\n// {\n//   userOne: { age: 72, admin: true },\n//   userTwo: { age: 72, admin: true },\n// }\n```\n\n### flatten(target, options?)\n\n`target`: [`Target`](https://github.com/ehmicky/wild-wild-path#target)\\\n`options`: [`Options?`](#options)\\\n_Return value_: [`Target`](https://github.com/ehmicky/wild-wild-path#target)\n\nFlatten deep properties to shallow properties with\n[dot-delimited paths](https://github.com/ehmicky/wild-wild-path#paths).\n\n```js\nconst target = { user: { firstName: 'Bob', colors: ['red', 'blue'] } }\nflatten(target)\n// { 'user.firstName': 'Bob', 'user.colors.0': 'red', 'user.colors.1': 'blue' }\n```\n\n## Target\n\nThe target value must be an object or an array.\n\n## Query\n\nThe query format is documented\n[here](https://github.com/ehmicky/wild-wild-path#queries). Both query\n[strings](https://github.com/ehmicky/wild-wild-path#query-strings) and\n[arrays](https://github.com/ehmicky/wild-wild-path#query-arrays) can be used.\n\n## Options\n\nOptions are optional plain objects. They are almost\n[the same as in `wild-wild-path`](https://github.com/ehmicky/wild-wild-path#options).\n\n### mutate\n\n_Methods_: [`map()`](#maptarget-query-mapfunction-options),\n[`merge()`](#mergetarget-query-value-options),\n[`push()`](#pushtarget-query-values-options),\n[`unshift()`](#unshifttarget-query-values-options),\n[`exclude()`](#excludetarget-query-testfunction-options)\\\n_Type_: `boolean`\\\n_Default_: `false`\n\nBy default, the [target](https://github.com/ehmicky/wild-wild-path#target) is\ndeeply cloned.\\\nWhen `true`, it is directly mutated instead, which is faster but has side\neffects.\n\n```js\nconst target = { colors: ['red'] }\nconsole.log(push(target, 'colors', ['blue']))\n// { colors: ['red', 'blue'] }\nconsole.log(target)\n// { colors: ['red'] }\nconsole.log(push(target, 'colors', ['blue'], { mutate: true }))\n// { colors: ['red', 'blue'] }\nconsole.log(target)\n// { colors: ['red', 'blue'] }\n```\n\n### entries\n\n_Methods_: [`map()`](#maptarget-query-mapfunction-options),\n[`find()`](#findtarget-query-testfunction-options),\n[`include()`](#includetarget-query-testfunction-options),\n[`exclude()`](#excludetarget-query-testfunction-options)\\\n_Type_: `boolean`\\\n_Default_: `false`\n\nBy default, properties' values are:\n\n- Passed as argument to callbacks like `mapFunction()` and `testFunction()`\n- Returned by [`find()`](#findtarget-query-testfunction-options)\n\nWhen `true`, objects with the following shape are used instead:\n\n- `value` `any`: property's value\n- `path` [`Path`](https://github.com/ehmicky/wild-wild-path#paths): property's\n  full path\n- `missing` `boolean`: whether the property is [missing](#missing) from the\n  [target](https://github.com/ehmicky/wild-wild-path#target)\n\n```js\nconst target = { job: '', firstName: 'Alice', lastName: 'Smith' }\nfind(target, '*', (value) =\u003e value !== '') // 'Alice'\nfind(\n  target,\n  '*',\n  (entry) =\u003e entry.value !== '' \u0026\u0026 entry.path[0] !== 'firstName',\n  { entries: true },\n)\n// { value: 'Smith', path: ['lastName'], missing: false },\n```\n\n### missing\n\n_Methods_: [`map()`](#maptarget-query-mapfunction-options),\n[`merge()`](#mergetarget-query-value-options),\n[`push()`](#pushtarget-query-values-options),\n[`unshift()`](#unshifttarget-query-values-options)\\\n_Type_: `boolean`\\\n_Default_: `false` with `map()`, `true` with `merge|push|unshift()`\n\nWhen `false`, properties\n[not defined in the target](https://github.com/ehmicky/wild-wild-path#undefined-values)\nare ignored.\n\n```js\nconst target = {}\n\npush(target, 'colors', ['red']) // { colors: ['red'] }\npush(target, 'colors', ['red'], { missing: false }) // {}\n\nmap(target, 'name', (value = 'defaultName') =\u003e value) // {}\nmap(target, 'name', ({ value = 'defaultName' }) =\u003e value, {\n  missing: true,\n  entries: true,\n}) // { name: 'defaultName' }\n```\n\n### sort\n\n_Methods_: [`find()`](#findtarget-query-testfunction-options),\n[`pick()`](#picktarget-query-options),\n[`include()`](#includetarget-query-testfunction-options),\\\n[`flatten()`](#flattentarget-options)\\\n_Type_: `boolean`\\\n_Default_: `false`\n\nWhen returning sibling object properties, sort them by the lexigographic order\nof their names (not values).\n\n```js\nconst target = { user: { lastName: 'Doe', firstName: 'John', age: 72 } }\nflatten(target)\n// { 'user.lastName': 'Doe', 'user.firstName': 'John', 'user.age': 72 }\nflatten(target, { sort: true })\n// { 'user.age': 72, 'user.firstName': 'John', 'user.lastName': 'Doe' }\n```\n\n### childFirst\n\n_Methods_: [`find()`](#findtarget-query-testfunction-options)\\\n_Type_: `boolean`\\\n_Default_: `false`\n\nWhen using [unions](https://github.com/ehmicky/wild-wild-path#-unions) or\n[deep wildcards](https://github.com/ehmicky/wild-wild-path#-wildcards), a query\nmight match both a property and some of its children.\n\nThis option decides whether the returned properties should be sorted from\nchildren to parents, or the reverse.\n\n```js\nconst target = { user: { firstName: 'Alice', lastName: '' } }\nconst isDefined = (value) =\u003e value !== ''\nfind(target, 'user.**', isDefined) // { firstName: 'Alice', lastName: '' }\nfind(target, 'user.**', isDefined, { childFirst: true }) // 'Alice'\n```\n\n### leaves\n\n_Methods_: [`map()`](#maptarget-query-mapfunction-options),\n[`merge()`](#mergetarget-query-value-options),\n[`push()`](#pushtarget-query-values-options),\n[`unshift()`](#unshifttarget-query-values-options),\n[`find()`](#findtarget-query-testfunction-options)\\\n_Type_: `boolean`\\\n_Default_: `false`\n\nWhen using [unions](https://github.com/ehmicky/wild-wild-path#-unions) or\n[deep wildcards](https://github.com/ehmicky/wild-wild-path#-wildcards), a query\nmight match both a property and some of its children.\n\nWhen `true`, only leaves are matched. In other words, a matching property is\nignored if one of its children also matches.\n\n```js\nconst target = { user: { settings: { firstName: 'Alice', lastName: 'Smith' } } }\nmerge(target, 'user user.settings', { age: 72 })\n// {\n//   user: {\n//     settings: { firstName: 'Alice', lastName: 'Smith', age: 72 },\n//     age: 72,\n//   }\n// }\nmerge(target, 'user user.settings', { age: 72 }, { leaves: true })\n// {\n//   user: {\n//     settings: { firstName: 'Alice', lastName: 'Smith', age: 72 },\n//   }\n// }\n```\n\n### roots\n\n_Methods_: [`map()`](#maptarget-query-mapfunction-options),\n[`merge()`](#mergetarget-query-value-options),\n[`push()`](#pushtarget-query-values-options),\n[`unshift()`](#unshifttarget-query-values-options),\n[`find()`](#findtarget-query-testfunction-options)\\\n_Type_: `boolean`\\\n_Default_: `false`\n\nWhen using [unions](https://github.com/ehmicky/wild-wild-path#-unions) or\n[deep wildcards](https://github.com/ehmicky/wild-wild-path#-wildcards), a query\nmight match both a property and some of its children.\n\nWhen `true`, only roots are matched. In other words, a matching property is\nignored if one of its parents also matches.\n\n```js\nconst target = { user: { settings: { firstName: 'Alice', lastName: 'Smith' } } }\nmerge(target, 'user user.settings', { age: 72 })\n// {\n//   user: {\n//     settings: { firstName: 'Alice', lastName: 'Smith', age: 72 },\n//     age: 72,\n//   }\n// }\nmerge(target, 'user user.settings', { age: 72 }, { roots: true })\n// {\n//   user: {\n//     settings: { firstName: 'Alice', lastName: 'Smith' },\n//     age: 72,\n//   }\n// }\n```\n\n### shallowArrays\n\n_Methods_: all\\\n_Type_: `boolean`\\\n_Default_: `false`\n\nIf `true`, [wildcards](https://github.com/ehmicky/wild-wild-path#-wildcards) do\nnot recurse on arrays. Array items can still be matched by using\n[indices](https://github.com/ehmicky/wild-wild-path#-arrays-indices) or\n[slices](https://github.com/ehmicky/wild-wild-path#%EF%B8%8F-array-slices).\n\n```js\nconst target = { user: { firstName: 'Bob', colors: ['red', 'blue'] } }\nflatten(target)\n// { 'user.firstName': 'Bob', 'user.colors.0': 'red', 'user.colors.1': 'blue' }\nflatten(target, { shallowArrays: true })\n// { 'user.firstName': 'Bob', 'user.colors': ['red', 'blue'] }\n```\n\n### classes\n\n_Methods_: all\\\n_Type_: `boolean`\\\n_Default_: `false`\n\nUnless `true`, [wildcards](https://github.com/ehmicky/wild-wild-path#-wildcards)\nand [regexps](https://github.com/ehmicky/wild-wild-path#%EF%B8%8F-regexps)\nignore properties of objects that are not plain objects (like class instances,\nerrors or functions). Those can still be matched by using their\n[property name](https://github.com/ehmicky/wild-wild-path#%EF%B8%8F-deep-properties).\n\n```js\nconst target = { user: new User({ name: 'Alice' }) }\nconst isDefined = (value) =\u003e value !== ''\nfind(target, 'user.*', isDefined) // undefined\nfind(target, 'user.*', isDefined, { classes: true }) // 'Alice'\n```\n\n### inherited\n\n_Methods_: all\\\n_Type_: `boolean`\\\n_Default_: `false`\n\nBy default, [wildcards](https://github.com/ehmicky/wild-wild-path#-wildcards)\nand [regexps](https://github.com/ehmicky/wild-wild-path#%EF%B8%8F-regexps)\nignore properties that are either\n[inherited](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain)\nor\n[not enumerable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties).\nThose can still be matched by using their\n[property name](https://github.com/ehmicky/wild-wild-path#%EF%B8%8F-deep-properties).\n\nWhen `true`, inherited properties are not ignored, but not enumerable ones still\nare.\n\n# Related projects\n\n- [`wild-wild-path`](https://github.com/ehmicky/wild-wild-path): object property\n  paths used by `wild-wild-utils`\n- [`wild-wild-parser`](https://github.com/ehmicky/wild-wild-parser): parser for\n  `wild-wild-path`'s object property paths\n- [`declarative-merge`](https://github.com/ehmicky/declarative-merge): object\n  merging logic used by the [`merge()` method](#mergetarget-query-value-options)\n- [`set-array`](https://github.com/ehmicky/set-array): array update logic used\n  by the [`merge()` method](#mergetarget-query-value-options)\n\n# Support\n\nFor any question, _don't hesitate_ to [submit an issue on GitHub](../../issues).\n\nEveryone is welcome regardless of personal background. We enforce a\n[Code of conduct](CODE_OF_CONDUCT.md) in order to promote a positive and\ninclusive environment.\n\n# Contributing\n\nThis project was made with ❤️. The simplest way to give back is by starring and\nsharing it online.\n\nIf the documentation is unclear or has a typo, please click on the page's `Edit`\nbutton (pencil icon) and suggest a correction.\n\nIf you would like to help us fix a bug or add a new feature, please check our\n[guidelines](CONTRIBUTING.md). Pull requests are welcome!\n\n\u003c!-- Thanks go to our wonderful contributors: --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START --\u003e\n\u003c!-- prettier-ignore --\u003e\n\u003c!--\n\u003ctable\u003e\u003ctr\u003e\u003ctd align=\"center\"\u003e\u003ca href=\"https://fosstodon.org/@ehmicky\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/8136211?v=4\" width=\"100px;\" alt=\"ehmicky\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eehmicky\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/ehmicky/wild-wild-utils/commits?author=ehmicky\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#design-ehmicky\" title=\"Design\"\u003e🎨\u003c/a\u003e \u003ca href=\"#ideas-ehmicky\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"https://github.com/ehmicky/wild-wild-utils/commits?author=ehmicky\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehmicky%2Fwild-wild-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fehmicky%2Fwild-wild-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehmicky%2Fwild-wild-utils/lists"}