necessary 11.3.0 → 11.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -600,7 +600,7 @@ pathWithoutTopmostDirectoryNameFromPath("root/etc/init.conf"); // returns 'etc/i
|
|
|
600
600
|
- `find()`
|
|
601
601
|
- `prune()`
|
|
602
602
|
- `patch()`
|
|
603
|
-
- `
|
|
603
|
+
- `compress()`
|
|
604
604
|
- `augment()`
|
|
605
605
|
- `separate()`
|
|
606
606
|
- `forwardsFind()`
|
|
@@ -690,20 +690,20 @@ prune([1, 2, -1, -2], (element, index) => {
|
|
|
690
690
|
// returns -1
|
|
691
691
|
```
|
|
692
692
|
|
|
693
|
-
* The `patch()` function will append the given element to the
|
|
693
|
+
* The `patch()` function will append the given element to the array argument the first time that the callback function returns a truthy value:
|
|
694
694
|
|
|
695
695
|
```
|
|
696
696
|
patch([1, 2, 0, -1, -2], 4, (element, index) => {
|
|
697
697
|
return element === 0;
|
|
698
|
-
}); // the
|
|
698
|
+
}); // the array argument becomes [1, 2, 0, -1, -2, 4]
|
|
699
699
|
```
|
|
700
700
|
|
|
701
|
-
* The `compress()` function will remove elements from the
|
|
701
|
+
* The `compress()` function will remove elements from the array argument whenever the callback function returns a truthy value:
|
|
702
702
|
|
|
703
703
|
```
|
|
704
704
|
compress([1, 2, 1], (element1, element2) => {
|
|
705
705
|
return element1 === element2;
|
|
706
|
-
}); // the
|
|
706
|
+
}); // the array argument becomes [1, 2]
|
|
707
707
|
```
|
|
708
708
|
|
|
709
709
|
* The `augment()` function appends each of the elements of the second array argument to the first array argument whenever the callback returns a truthy value:
|