@zelgadis87/utils-core 5.2.5 → 5.2.7
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/CHANGELOG.md +8 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/arrays.d.ts +8 -0
- package/esbuild/index.cjs +7 -0
- package/esbuild/index.cjs.map +2 -2
- package/esbuild/index.mjs +6 -0
- package/esbuild/index.mjs.map +2 -2
- package/package.json +1 -1
- package/src/utils/arrays.ts +13 -0
package/esbuild/index.mjs
CHANGED
|
@@ -862,6 +862,11 @@ function unzip(arr) {
|
|
|
862
862
|
return [[...ts, t], [...rs, r]];
|
|
863
863
|
}, [[], []]);
|
|
864
864
|
}
|
|
865
|
+
function arrayGet(arr, index) {
|
|
866
|
+
if (index < 0 || index >= arr.length)
|
|
867
|
+
return Optional_default.empty();
|
|
868
|
+
return Optional_default.of(arr[index]);
|
|
869
|
+
}
|
|
865
870
|
|
|
866
871
|
// src/utils/booleans.ts
|
|
867
872
|
function isTrue(x) {
|
|
@@ -2829,6 +2834,7 @@ export {
|
|
|
2829
2834
|
alwaysFalse,
|
|
2830
2835
|
alwaysTrue,
|
|
2831
2836
|
and,
|
|
2837
|
+
arrayGet,
|
|
2832
2838
|
asError,
|
|
2833
2839
|
asPromise,
|
|
2834
2840
|
average,
|