Skip to content

Commit

Permalink
fix: replace lodash.set dependency
Browse files Browse the repository at this point in the history
lodash.set has vulnerability and no longer maintained as an individual package
  • Loading branch information
ozum committed Feb 12, 2024
1 parent 3b01a3b commit 442d7c1
Show file tree
Hide file tree
Showing 5 changed files with 11,074 additions and 7,374 deletions.
78 changes: 39 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ const users = new IndexableArray({ id: 23, name: "Geroge" }, { id: 96, name: "Li
users.indexedArray; // ["$$self", "name"]
```

Defined in: [index.ts:77](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L77)
Defined in: [index.ts:77](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L77)

## Accessors

Expand All @@ -237,7 +237,7 @@ Defined in: [index.ts:77](https://github.com/ozum/indexable-array/blob/7694902/s

**Returns:** DK

Defined in: [index.ts:200](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L200)
Defined in: [index.ts:200](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L200)

## Methods

Expand All @@ -253,7 +253,7 @@ Defined in: [index.ts:200](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<I, DK, OK, TH\>

Defined in: [index.ts:672](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L672)
Defined in: [index.ts:672](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L672)

**concat**(...`items`: (I | _ConcatArray_<I\>)[]): [_default_](#classesdefaultmd)<I, DK, OK, TH\>

Expand All @@ -265,7 +265,7 @@ Defined in: [index.ts:672](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<I, DK, OK, TH\>

Defined in: [index.ts:673](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L673)
Defined in: [index.ts:673](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L673)

---

Expand All @@ -292,7 +292,7 @@ indexedArray.enableIndex(); // Index is recreated from scratch.

**Returns:** _void_

Defined in: [index.ts:857](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L857)
Defined in: [index.ts:857](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L857)

---

Expand All @@ -306,7 +306,7 @@ Enables indexing and recreates index from scratch.

**Returns:** _void_

Defined in: [index.ts:866](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L866)
Defined in: [index.ts:866](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L866)

---

Expand All @@ -329,7 +329,7 @@ Defined in: [index.ts:866](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<S, DK, OK, TH\>

Defined in: [index.ts:466](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L466)
Defined in: [index.ts:466](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L466)

**filter**(`callbackfn`: _Callback_<I, DK, OK, TH, _unknown_\>, `thisArg?`: _any_): [_default_](#classesdefaultmd)<I, DK, OK, TH\>

Expand All @@ -342,7 +342,7 @@ Defined in: [index.ts:466](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<I, DK, OK, TH\>

Defined in: [index.ts:471](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L471)
Defined in: [index.ts:471](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L471)

---

Expand All @@ -369,7 +369,7 @@ Defined in: [index.ts:471](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<U, DK2, _Exclude_<OK2, DK2\>, TH\>

Defined in: [index.ts:558](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L558)
Defined in: [index.ts:558](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L558)

**flatMap**<U, DK2, OK2, This\>(`callbackFn`: _CallbackThis_<I, DK, OK, TH, U | readonly U[], This\>, `thisArg`: This, `defaultKey?`: DK2, ...`indexKeys`: OK2[]): [_default_](#classesdefaultmd)<U, DK2, _Exclude_<OK2, DK2\>, TH\>

Expand All @@ -393,7 +393,7 @@ Defined in: [index.ts:558](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<U, DK2, _Exclude_<OK2, DK2\>, TH\>

Defined in: [index.ts:569](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L569)
Defined in: [index.ts:569](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L569)

**flatMap**<U, DK2, OK2, This\>(`callbackFn`: _CallbackThis_<I, DK, OK, TH, U | readonly U[], This\>, `defaultKey`: DK2, ...`indexKeys`: OK2[]): [_default_](#classesdefaultmd)<U, DK2, _Exclude_<OK2, DK2\>, TH\>

Expand All @@ -416,7 +416,7 @@ Defined in: [index.ts:569](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<U, DK2, _Exclude_<OK2, DK2\>, TH\>

Defined in: [index.ts:581](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L581)
Defined in: [index.ts:581](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L581)

**flatMap**<U, DK2, OK2, This\>(`callbackFn`: _CallbackThis_<I, DK, OK, TH, U | readonly U[], This\>, `thisArg`: This, `defaultKey`: DK2, ...`indexKeys`: OK2[]): [_default_](#classesdefaultmd)<U, DK2, _Exclude_<OK2, DK2\>, TH\>

Expand All @@ -440,7 +440,7 @@ Defined in: [index.ts:581](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<U, DK2, _Exclude_<OK2, DK2\>, TH\>

Defined in: [index.ts:592](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L592)
Defined in: [index.ts:592](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L592)

**flatMap**<U, This\>(`callbackFn`: _CallbackThis_<I, DK, OK, TH, U | readonly U[], This\>, `thisArg?`: This, ...`rest`: _never_[]): [_default_](#classesdefaultmd)<U, _AvailableDefaultIndex_<U, DK, OK\>, _Exclude_<_Extract_<OK, keyof U\>, _AvailableDefaultIndex_<U, DK, OK\>\>, TH\>

Expand All @@ -461,7 +461,7 @@ Defined in: [index.ts:592](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<U, _AvailableDefaultIndex_<U, DK, OK\>, _Exclude_<_Extract_<OK, keyof U\>, _AvailableDefaultIndex_<U, DK, OK\>\>, TH\>

Defined in: [index.ts:604](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L604)
Defined in: [index.ts:604](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L604)

**flatMap**<U, This\>(`callbackFn`: _CallbackThis_<I, DK, OK, TH, U | readonly U[], This\>, `thisArg?`: This, ...`rest`: _never_[]): [_default_](#classesdefaultmd)<U, _AvailableDefaultIndex_<U, DK, OK\>, _Exclude_<_Extract_<OK, keyof U\>, _AvailableDefaultIndex_<U, DK, OK\>\>, TH\>

Expand All @@ -482,7 +482,7 @@ Defined in: [index.ts:604](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<U, _AvailableDefaultIndex_<U, DK, OK\>, _Exclude_<_Extract_<OK, keyof U\>, _AvailableDefaultIndex_<U, DK, OK\>\>, TH\>

Defined in: [index.ts:610](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L610)
Defined in: [index.ts:610](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L610)

---

Expand Down Expand Up @@ -518,7 +518,7 @@ is indexed value to search for.

the first item with given indexed value in the array; `undefined` if not found.

Defined in: [index.ts:743](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L743)
Defined in: [index.ts:743](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L743)

---

Expand Down Expand Up @@ -550,7 +550,7 @@ is indexed value to search for.

all items with given indexed value in the array; Empty array if not found.

Defined in: [index.ts:799](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L799)
Defined in: [index.ts:799](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L799)

---

Expand Down Expand Up @@ -582,7 +582,7 @@ indexed value to search for.

all indexes of the element in the array; Empty array if not found.

Defined in: [index.ts:727](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L727)
Defined in: [index.ts:727](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L727)

---

Expand Down Expand Up @@ -615,7 +615,7 @@ indexed value to search for.

the first index of the element in the array; -1 if not found.

Defined in: [index.ts:704](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L704)
Defined in: [index.ts:704](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L704)

---

Expand Down Expand Up @@ -648,7 +648,7 @@ is indexed value to search for.

is the first item with given indexed value in the array; `undefined` if not found.

Defined in: [index.ts:784](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L784)
Defined in: [index.ts:784](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L784)

---

Expand Down Expand Up @@ -681,7 +681,7 @@ is indexed value to search for.

the first item with given indexed value in the array; `undefined` if not found.

Defined in: [index.ts:771](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L771)
Defined in: [index.ts:771](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L771)

---

Expand Down Expand Up @@ -714,7 +714,7 @@ is indexed value to search for.

true if indexed value is found among array's entries' keys.

Defined in: [index.ts:814](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L814)
Defined in: [index.ts:814](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L814)

---

Expand All @@ -740,7 +740,7 @@ Defined in: [index.ts:814](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<U, DK2, _Exclude_<OK2, DK2\>, TH\>

Defined in: [index.ts:481](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L481)
Defined in: [index.ts:481](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L481)

**map**<U, DK2, OK2\>(`callbackFn`: _Callback_<I, DK, OK, TH, U\>, `thisArg`: _Record_<_string_, _unknown_\>, `defaultKey?`: DK2, ...`indexKeys`: OK2[]): [_default_](#classesdefaultmd)<U, DK2, _Exclude_<OK2, DK2\>, TH\>

Expand All @@ -763,7 +763,7 @@ Defined in: [index.ts:481](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<U, DK2, _Exclude_<OK2, DK2\>, TH\>

Defined in: [index.ts:487](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L487)
Defined in: [index.ts:487](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L487)

**map**<U, DK2, OK2\>(`callbackFn`: _Callback_<I, DK, OK, TH, U\>, `defaultKey`: DK2, ...`indexKeys`: OK2[]): [_default_](#classesdefaultmd)<U, DK2, _Exclude_<OK2, DK2\>, TH\>

Expand All @@ -785,7 +785,7 @@ Defined in: [index.ts:487](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<U, DK2, _Exclude_<OK2, DK2\>, TH\>

Defined in: [index.ts:494](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L494)
Defined in: [index.ts:494](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L494)

**map**<U, DK2, OK2\>(`callbackFn`: _Callback_<I, DK, OK, TH, U\>, `thisArg`: _Record_<_string_, _unknown_\>, `defaultKey`: DK2, ...`indexKeys`: OK2[]): [_default_](#classesdefaultmd)<U, DK2, _Exclude_<OK2, DK2\>, TH\>

Expand All @@ -808,7 +808,7 @@ Defined in: [index.ts:494](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<U, DK2, _Exclude_<OK2, DK2\>, TH\>

Defined in: [index.ts:500](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L500)
Defined in: [index.ts:500](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L500)

**map**<U\>(`callbackFn`: _Callback_<I, DK, OK, TH, U\>, `thisArg?`: _Record_<_string_, _unknown_\>): [_default_](#classesdefaultmd)<U, _AvailableDefaultIndex_<U, DK, OK\>, _Exclude_<_Extract_<OK, keyof U\>, _AvailableDefaultIndex_<U, DK, OK\>\>, TH\>

Expand All @@ -827,7 +827,7 @@ Defined in: [index.ts:500](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<U, _AvailableDefaultIndex_<U, DK, OK\>, _Exclude_<_Extract_<OK, keyof U\>, _AvailableDefaultIndex_<U, DK, OK\>\>, TH\>

Defined in: [index.ts:507](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L507)
Defined in: [index.ts:507](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L507)

**map**<U\>(`callbackFn`: _Callback_<I, DK, OK, TH, U\>, `thisArg?`: _Record_<_string_, _unknown_\>): [_default_](#classesdefaultmd)<U, _AvailableDefaultIndex_<U, DK, OK\>, _Exclude_<_Extract_<OK, keyof U\>, _AvailableDefaultIndex_<U, DK, OK\>\>, TH\>

Expand All @@ -846,7 +846,7 @@ Defined in: [index.ts:507](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<U, _AvailableDefaultIndex_<U, DK, OK\>, _Exclude_<_Extract_<OK, keyof U\>, _AvailableDefaultIndex_<U, DK, OK\>\>, TH\>

Defined in: [index.ts:512](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L512)
Defined in: [index.ts:512](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L512)

---

Expand Down Expand Up @@ -882,7 +882,7 @@ const baseArray = usersWithName.mapToArray((user) => ({ id: user.id, nick: name.

a new `Array` with each element being the result of the callback function.

Defined in: [index.ts:664](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L664)
Defined in: [index.ts:664](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L664)

---

Expand All @@ -898,7 +898,7 @@ Defined in: [index.ts:664](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** _number_

Defined in: [index.ts:422](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L422)
Defined in: [index.ts:422](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L422)

---

Expand Down Expand Up @@ -926,7 +926,7 @@ indexedArray.set(0, "name", "OK"); // Index updated.

**Returns:** _void_

Defined in: [index.ts:831](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L831)
Defined in: [index.ts:831](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L831)

---

Expand All @@ -943,7 +943,7 @@ Defined in: [index.ts:831](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<I, DK, OK, TH\>

Defined in: [index.ts:668](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L668)
Defined in: [index.ts:668](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L668)

---

Expand All @@ -959,7 +959,7 @@ Defined in: [index.ts:668](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<I, DK, OK, TH\>

Defined in: [index.ts:441](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L441)
Defined in: [index.ts:441](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L441)

---

Expand All @@ -979,7 +979,7 @@ Sorts the elements of an array by given key in place and returns the sorted arra

this instance.

Defined in: [index.ts:454](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L454)
Defined in: [index.ts:454](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L454)

---

Expand All @@ -997,7 +997,7 @@ Defined in: [index.ts:454](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** I[]

Defined in: [index.ts:429](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L429)
Defined in: [index.ts:429](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L429)

---

Expand Down Expand Up @@ -1034,7 +1034,7 @@ users = users.withDefaultIndex("id"); // "id" is default index. Assignment is us

this object.

Defined in: [index.ts:690](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L690)
Defined in: [index.ts:690](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L690)

---

Expand Down Expand Up @@ -1063,7 +1063,7 @@ Defined in: [index.ts:690](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<I2, DK3, _Exclude_<OK3, DK3\>, TH2\>

Defined in: [index.ts:95](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L95)
Defined in: [index.ts:95](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L95)

`Static`**from**<I2, DK2, OK2\>(`arrayLike`: _Iterable_<I2\> | _ArrayLike_<I2\>, `defaultKey`: DK2, ...`indexKeys`: OK2[]): [_default_](#classesdefaultmd)<I2, DK2, _Exclude_<OK2, DK2\>, _false_\>

Expand All @@ -1085,7 +1085,7 @@ Defined in: [index.ts:95](https://github.com/ozum/indexable-array/blob/7694902/s

**Returns:** [_default_](#classesdefaultmd)<I2, DK2, _Exclude_<OK2, DK2\>, _false_\>

Defined in: [index.ts:108](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L108)
Defined in: [index.ts:108](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L108)

---

Expand Down Expand Up @@ -1114,7 +1114,7 @@ Defined in: [index.ts:108](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<I2, DK3, _Exclude_<OK3, DK3\>, _true_\>

Defined in: [index.ts:154](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L154)
Defined in: [index.ts:154](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L154)

`Static`**throwingFrom**<I2, DK2, OK2\>(`arrayLike`: _Iterable_<I2\> | _ArrayLike_<I2\>, `defaultKey`: DK2, ...`indexKeys`: OK2[]): [_default_](#classesdefaultmd)<I2, DK2, _Exclude_<OK2, DK2\>, _true_\>

Expand All @@ -1136,4 +1136,4 @@ Defined in: [index.ts:154](https://github.com/ozum/indexable-array/blob/7694902/

**Returns:** [_default_](#classesdefaultmd)<I2, DK2, _Exclude_<OK2, DK2\>, _true_\>

Defined in: [index.ts:167](https://github.com/ozum/indexable-array/blob/7694902/src/index.ts#L167)
Defined in: [index.ts:167](https://github.com/ozum/indexable-array/blob/3b01a3b/src/index.ts#L167)
12 changes: 0 additions & 12 deletions module-files/scripts/tsmod.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const os = require("os");
const { promises: fs, readFileSync } = require("fs");
const { sep, join, normalize, basename, dirname, parse } = require("path");
const childProcess = require("child_process");
const { notSync } = require("not-sync");
const readmeasy = require("readmeasy").default;

const cwd = process.env.INIT_CWD || process.cwd();
Expand Down Expand Up @@ -146,20 +145,9 @@ async function vuepressApi() {
// intermodular.log("info", "VuePress site updated.");
}

/**
* Creates given directories and disables cloud storage syncroonization.
*
* @param {string[]} dirs are directories to create and disable syncronization.
*/
async function applyNotSync(dirs) {
if (!hasDependency("not-sync")) return;
await notSync(dirs, { createDirs: true });
}

const commands = {
readme: () => readme(),
"vuepress-api": () => vuepressApi(),
"not-sync": (args) => applyNotSync(args[0].split(",")),
};

const [command, ...args] = process.argv.slice(2);
Expand Down
Loading

0 comments on commit 442d7c1

Please sign in to comment.