@dereekb/util 9.23.19 → 9.23.20
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 +4 -0
- package/fetch/CHANGELOG.md +4 -0
- package/fetch/package.json +2 -2
- package/package.json +1 -1
- package/src/lib/value/map.d.ts +7 -0
- package/src/lib/value/map.js +15 -1
- package/src/lib/value/map.js.map +1 -1
- package/test/CHANGELOG.md +4 -0
- package/test/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [9.23.20](https://github.com/dereekb/dbx-components/compare/v9.23.19-dev...v9.23.20) (2023-05-19)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
## [9.23.19](https://github.com/dereekb/dbx-components/compare/v9.23.18-dev...v9.23.19) (2023-05-11)
|
|
6
10
|
|
|
7
11
|
|
package/fetch/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [9.23.20](https://github.com/dereekb/dbx-components/compare/v9.23.19-dev...v9.23.20) (2023-05-19)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
## [9.23.19](https://github.com/dereekb/dbx-components/compare/v9.23.18-dev...v9.23.19) (2023-05-11)
|
|
6
10
|
|
|
7
11
|
|
package/fetch/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/util/fetch",
|
|
3
|
-
"version": "9.23.
|
|
3
|
+
"version": "9.23.20",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"types": "./src/index.d.ts",
|
|
6
6
|
"dependencies": {},
|
|
7
7
|
"peerDependencies": {
|
|
8
|
-
"@dereekb/util": "9.23.
|
|
8
|
+
"@dereekb/util": "9.23.20",
|
|
9
9
|
"lodash.isequal": "^4.5.0",
|
|
10
10
|
"make-error": "^1.3.0",
|
|
11
11
|
"class-validator": "^0.13.2",
|
package/package.json
CHANGED
package/src/lib/value/map.d.ts
CHANGED
|
@@ -5,6 +5,13 @@ import { Maybe, MaybeNot } from './maybe.type';
|
|
|
5
5
|
* Converts one value to another.
|
|
6
6
|
*/
|
|
7
7
|
export declare type MapFunction<I, O> = (input: I) => O;
|
|
8
|
+
/**
|
|
9
|
+
* Turns a normal MapFunction into one that passes through Maybe values without attempting to map them.
|
|
10
|
+
*
|
|
11
|
+
* @param mapFunction
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare function mapMaybeFunction<I, O>(mapFunction: MapFunction<I, O>): MapFunction<Maybe<I>, Maybe<O>>;
|
|
8
15
|
/**
|
|
9
16
|
* MapFunction with the same input as output.
|
|
10
17
|
*/
|
package/src/lib/value/map.js
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.chainMapFunction = exports.chainMapSameFunctions = exports.mapFunctionOutput = exports.wrapMapFunctionOutput = exports.mapFunctionOutputPair = exports.isMapIdentityFunction = exports.mapIdentityFunction = exports.MAP_IDENTITY = exports.mapArrayFunction = void 0;
|
|
3
|
+
exports.chainMapFunction = exports.chainMapSameFunctions = exports.mapFunctionOutput = exports.wrapMapFunctionOutput = exports.mapFunctionOutputPair = exports.isMapIdentityFunction = exports.mapIdentityFunction = exports.MAP_IDENTITY = exports.mapArrayFunction = exports.mapMaybeFunction = void 0;
|
|
4
4
|
const array_1 = require("../array/array");
|
|
5
5
|
const array_value_1 = require("../array/array.value");
|
|
6
6
|
const build_1 = require("./build");
|
|
7
|
+
const maybe_1 = require("./maybe");
|
|
8
|
+
/**
|
|
9
|
+
* Turns a normal MapFunction into one that passes through Maybe values without attempting to map them.
|
|
10
|
+
*
|
|
11
|
+
* @param mapFunction
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
function mapMaybeFunction(mapFunction) {
|
|
15
|
+
return (input) => {
|
|
16
|
+
const output = (0, maybe_1.isMaybeNot)(input) ? input : mapFunction(input);
|
|
17
|
+
return output;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
exports.mapMaybeFunction = mapMaybeFunction;
|
|
7
21
|
function mapArrayFunction(mapFunction) {
|
|
8
22
|
return (input) => input.map(mapFunction);
|
|
9
23
|
}
|
package/src/lib/value/map.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/value/map.ts"],"names":[],"mappings":";;;AAAA,0CAAuD;AACvD,sDAAyD;AAEzD,mCAAgC;
|
|
1
|
+
{"version":3,"file":"map.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/value/map.ts"],"names":[],"mappings":";;;AAAA,0CAAuD;AACvD,sDAAyD;AAEzD,mCAAgC;AAChC,mCAAqC;AAQrC;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAO,WAA8B;IACnE,OAAO,CAAC,KAAe,EAAE,EAAE;QACzB,MAAM,MAAM,GAAa,IAAA,kBAAU,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACxE,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AALD,4CAKC;AA6BD,SAAgB,gBAAgB,CAAO,WAA8B;IACnE,OAAO,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAChD,CAAC;AAFD,4CAEC;AAEM,MAAM,YAAY,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,KAAK,CAAC;AAAzC,QAAA,YAAY,gBAA6B;AAEtD,SAAgB,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AE,CAAC;YAC3B,MAAM;QACR,KAAK,CAAC;YACJ,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;YACZ,MAAM;QACR;YACE,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;YAEZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;gBACtC,EAAE,GAAG,gBAAgB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;aACnC;YACD,MAAM;KACT;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AArBD,sDAqBC;AAkBD,SAAgB,gBAAgB,CAAU,CAAoB,EAAE,CAA2B,EAAE,KAAK,GAAG,IAAI;IACvG,IAAI,KAAK,IAAI,CAAC,IAAI,IAAI,EAAE;QACtB,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACvB;SAAM;QACL,OAAO,CAAC,CAAC;KACV;AACH,CAAC;AAND,4CAMC"}
|
package/test/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [9.23.20](https://github.com/dereekb/dbx-components/compare/v9.23.19-dev...v9.23.20) (2023-05-19)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
5
9
|
## [9.23.19](https://github.com/dereekb/dbx-components/compare/v9.23.18-dev...v9.23.19) (2023-05-11)
|
|
6
10
|
|
|
7
11
|
|
package/test/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/util/test",
|
|
3
|
-
"version": "9.23.
|
|
3
|
+
"version": "9.23.20",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
7
7
|
"dependencies": {},
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@dereekb/util": "9.23.
|
|
9
|
+
"@dereekb/util": "9.23.20",
|
|
10
10
|
"lodash.isequal": "^4.5.0",
|
|
11
11
|
"make-error": "^1.3.0",
|
|
12
12
|
"class-validator": "^0.13.2",
|