@dereekb/util 8.7.6 → 8.9.0
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 +22 -0
- package/package.json +1 -1
- package/src/lib/array/array.string.d.ts +8 -20
- package/src/lib/array/array.string.js +14 -13
- package/src/lib/array/array.string.js.map +1 -1
- package/src/lib/index.d.ts +1 -1
- package/src/lib/index.js +1 -1
- package/src/lib/index.js.map +1 -1
- package/src/lib/model/model.conversion.d.ts +22 -0
- package/src/lib/model/model.conversion.js +26 -2
- package/src/lib/model/model.conversion.js.map +1 -1
- package/src/lib/number/number.d.ts +4 -0
- package/src/lib/number/number.js.map +1 -1
- package/src/lib/number/round.d.ts +36 -1
- package/src/lib/number/round.js +51 -1
- package/src/lib/number/round.js.map +1 -1
- package/src/lib/string/index.d.ts +2 -0
- package/src/lib/string/index.js +6 -0
- package/src/lib/string/index.js.map +1 -0
- package/src/lib/{string.d.ts → string/string.d.ts} +2 -2
- package/src/lib/{string.js → string/string.js} +0 -0
- package/src/lib/string/string.js.map +1 -0
- package/src/lib/string/transform.d.ts +24 -0
- package/src/lib/string/transform.js +43 -0
- package/src/lib/string/transform.js.map +1 -0
- package/src/lib/value/index.d.ts +1 -0
- package/src/lib/value/index.js +1 -0
- package/src/lib/value/index.js.map +1 -1
- package/src/lib/value/map.d.ts +1 -0
- package/src/lib/value/map.js +5 -1
- package/src/lib/value/map.js.map +1 -1
- package/src/lib/value/point.d.ts +193 -0
- package/src/lib/value/point.js +191 -0
- package/src/lib/value/point.js.map +1 -0
- package/test/CHANGELOG.md +12 -0
- package/test/package.json +2 -2
- package/src/lib/string.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
# [8.9.0](https://github.com/dereekb/dbx-components/compare/v8.8.1-dev...v8.9.0) (2022-06-30)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* added firestoreLatLngString() ([2af3e5f](https://github.com/dereekb/dbx-components/commit/2af3e5fcbcae665994df5cc68d1c246b5417a07d))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [8.8.1](https://github.com/dereekb/dbx-components/compare/v8.8.0-dev...v8.8.1) (2022-06-29)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# [8.8.0](https://github.com/dereekb/dbx-components/compare/v8.7.6-dev...v8.8.0) (2022-06-29)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* added firestoreSubObjectField() ([3d6fbe1](https://github.com/dereekb/dbx-components/commit/3d6fbe17a10dfddf3e9bc1cecd522ed61efd6c49))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
5
27
|
## [8.7.6](https://github.com/dereekb/dbx-components/compare/v8.7.5-dev...v8.7.6) (2022-06-29)
|
|
6
28
|
|
|
7
29
|
|
package/package.json
CHANGED
|
@@ -1,25 +1,13 @@
|
|
|
1
1
|
import { ReadKeyFunction, ReadKeysFunction } from '../key';
|
|
2
|
-
import {
|
|
2
|
+
import { MapFunction } from '../value/map';
|
|
3
|
+
import { DecisionFunctionFactory } from '../value/decision';
|
|
4
|
+
import { TransformStringFunctionConfig } from '../string/transform';
|
|
3
5
|
export declare function hasDifferentStringsNoCase(a: string[], b: string[]): boolean;
|
|
4
|
-
export declare
|
|
5
|
-
export declare
|
|
6
|
-
export declare
|
|
7
|
-
/**
|
|
8
|
-
* Whether or not to store all values as lowercase. Ignored if transform is provided.
|
|
9
|
-
*/
|
|
10
|
-
toLowercase?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Whether or not to store all values as uppercase. Ignored if transform is provided.
|
|
13
|
-
*/
|
|
14
|
-
toUppercase?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Optional transform function for text.
|
|
17
|
-
*/
|
|
18
|
-
transform?: TransformSingleStringFunction;
|
|
19
|
-
};
|
|
20
|
-
export declare type TransformSingleStringFunction = MapFunction<string, string>;
|
|
6
|
+
export declare const trimArray: MapFunction<string[], string[]>;
|
|
7
|
+
export declare const arrayToUppercase: MapFunction<string[], string[]>;
|
|
8
|
+
export declare const arrayToLowercase: MapFunction<string[], string[]>;
|
|
21
9
|
export declare type TransformStringsFunction = MapFunction<string[], string[]>;
|
|
22
|
-
export declare function transformStrings(config:
|
|
10
|
+
export declare function transformStrings(config: TransformStringFunctionConfig): TransformStringsFunction;
|
|
23
11
|
export declare function toCaseInsensitiveStringArray(values: Iterable<string>): string[];
|
|
24
12
|
export declare function uniqueCaseInsensitiveStrings(values: Iterable<string>): string[];
|
|
25
13
|
export declare function uniqueCaseInsensitiveStringsSet(values: Iterable<string>): Set<string>;
|
|
@@ -28,7 +16,7 @@ export declare function findUniqueCaseInsensitiveStrings<T, K extends string = s
|
|
|
28
16
|
export declare function containsStringAnyCase(values: Iterable<string>, valueToFind: string): boolean;
|
|
29
17
|
export declare function containsAnyStringAnyCase(values: Iterable<string>, valuesToFind: Iterable<string>): boolean;
|
|
30
18
|
export declare function containsAllStringsAnyCase(values: Iterable<string>, valuesToFind: Iterable<string>): boolean;
|
|
31
|
-
export interface FindUniqueStringsTransformConfig extends
|
|
19
|
+
export interface FindUniqueStringsTransformConfig extends TransformStringFunctionConfig {
|
|
32
20
|
/**
|
|
33
21
|
* Whether or not to compare values as lowercase when finding uniqueness.
|
|
34
22
|
*
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.caseInsensitiveFilterByIndexOfDecisionFactory = exports.searchStringFilterFunction = exports.findUniqueTransform = exports.containsAllStringsAnyCase = exports.containsAnyStringAnyCase = exports.containsStringAnyCase = exports.findUniqueCaseInsensitiveStrings = exports.flattenArrayUniqueCaseInsensitiveStrings = exports.uniqueCaseInsensitiveStringsSet = exports.uniqueCaseInsensitiveStrings = exports.toCaseInsensitiveStringArray = exports.transformStrings = exports.arrayToLowercase = exports.arrayToUppercase = exports.hasDifferentStringsNoCase = void 0;
|
|
3
|
+
exports.caseInsensitiveFilterByIndexOfDecisionFactory = exports.searchStringFilterFunction = exports.findUniqueTransform = exports.containsAllStringsAnyCase = exports.containsAnyStringAnyCase = exports.containsStringAnyCase = exports.findUniqueCaseInsensitiveStrings = exports.flattenArrayUniqueCaseInsensitiveStrings = exports.uniqueCaseInsensitiveStringsSet = exports.uniqueCaseInsensitiveStrings = exports.toCaseInsensitiveStringArray = exports.transformStrings = exports.arrayToLowercase = exports.arrayToUppercase = exports.trimArray = exports.hasDifferentStringsNoCase = void 0;
|
|
4
4
|
const array_1 = require("./array");
|
|
5
5
|
const array_unique_1 = require("./array.unique");
|
|
6
|
-
const string_1 = require("../string");
|
|
6
|
+
const string_1 = require("../string/string");
|
|
7
7
|
const set_1 = require("../set/set");
|
|
8
8
|
const iterable_map_1 = require("../iterable/iterable.map");
|
|
9
|
-
const
|
|
9
|
+
const map_1 = require("../value/map");
|
|
10
|
+
const transform_1 = require("../string/transform");
|
|
10
11
|
function hasDifferentStringsNoCase(a, b) {
|
|
11
12
|
return (0, set_1.hasDifferentValues)(a.map(string_1.caseInsensitiveString), b.map(string_1.caseInsensitiveString));
|
|
12
13
|
}
|
|
13
14
|
exports.hasDifferentStringsNoCase = hasDifferentStringsNoCase;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
exports.arrayToUppercase = arrayToUppercase;
|
|
18
|
-
function arrayToLowercase(input) {
|
|
19
|
-
return input.map((x) => x.toLowerCase());
|
|
20
|
-
}
|
|
21
|
-
exports.arrayToLowercase = arrayToLowercase;
|
|
15
|
+
exports.trimArray = (0, map_1.mapArrayFunction)(transform_1.stringTrimFunction);
|
|
16
|
+
exports.arrayToUppercase = (0, map_1.mapArrayFunction)(transform_1.stringToUppercaseFunction);
|
|
17
|
+
exports.arrayToLowercase = (0, map_1.mapArrayFunction)(transform_1.stringToLowercaseFunction);
|
|
22
18
|
function transformStrings(config) {
|
|
23
|
-
const transform =
|
|
24
|
-
|
|
19
|
+
const transform = (0, transform_1.transformStringFunction)(config);
|
|
20
|
+
if ((0, map_1.isMapIdentityFunction)(transform)) {
|
|
21
|
+
return (0, map_1.mapIdentityFunction)();
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return (0, map_1.mapArrayFunction)(transform);
|
|
25
|
+
}
|
|
25
26
|
}
|
|
26
27
|
exports.transformStrings = transformStrings;
|
|
27
28
|
function toCaseInsensitiveStringArray(values) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.string.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/array/array.string.ts"],"names":[],"mappings":";;;AAAA,mCAAuC;AACvC,iDAAoD;AAEpD,
|
|
1
|
+
{"version":3,"file":"array.string.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/array/array.string.ts"],"names":[],"mappings":";;;AAAA,mCAAuC;AACvC,iDAAoD;AAEpD,6CAAyD;AACzD,oCAAqF;AACrF,2DAAuD;AACvD,sCAAyG;AAEzG,mDAAuK;AAEvK,SAAgB,yBAAyB,CAAC,CAAW,EAAE,CAAW;IAChE,OAAO,IAAA,wBAAkB,EAAC,CAAC,CAAC,GAAG,CAAC,8BAAqB,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,8BAAqB,CAAC,CAAC,CAAC;AACxF,CAAC;AAFD,8DAEC;AAEY,QAAA,SAAS,GAAG,IAAA,sBAAgB,EAAC,8BAAkB,CAAC,CAAC;AACjD,QAAA,gBAAgB,GAAG,IAAA,sBAAgB,EAAC,qCAAyB,CAAC,CAAC;AAC/D,QAAA,gBAAgB,GAAG,IAAA,sBAAgB,EAAC,qCAAyB,CAAC,CAAC;AAI5E,SAAgB,gBAAgB,CAAC,MAAqC;IACpE,MAAM,SAAS,GAAG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YAChC,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;YACnC,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;YAChD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAZD,gEAYC;AAEM,MAAM,6CAA6C,GAA4C,CAAC,UAAkB,EAAE,EAAE;IAC3H,MAAM,YAAY,GAAG,UAAU,CAAC,iBAAiB,EAAE,CAAC;IACpD,OAAO,CAAC,MAAc,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;AACrF,CAAC,CAAC;AAHW,QAAA,6CAA6C,iDAGxD"}
|
package/src/lib/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './relation';
|
|
|
15
15
|
export * from './service';
|
|
16
16
|
export * from './set';
|
|
17
17
|
export * from './storage';
|
|
18
|
+
export * from './string';
|
|
18
19
|
export * from './tree';
|
|
19
20
|
export * from './value';
|
|
20
21
|
export * from './boolean';
|
|
@@ -28,5 +29,4 @@ export * from './number';
|
|
|
28
29
|
export * from './object';
|
|
29
30
|
export * from './page';
|
|
30
31
|
export * from './sort';
|
|
31
|
-
export * from './string';
|
|
32
32
|
export * from './type';
|
package/src/lib/index.js
CHANGED
|
@@ -18,6 +18,7 @@ tslib_1.__exportStar(require("./relation"), exports);
|
|
|
18
18
|
tslib_1.__exportStar(require("./service"), exports);
|
|
19
19
|
tslib_1.__exportStar(require("./set"), exports);
|
|
20
20
|
tslib_1.__exportStar(require("./storage"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./string"), exports);
|
|
21
22
|
tslib_1.__exportStar(require("./tree"), exports);
|
|
22
23
|
tslib_1.__exportStar(require("./value"), exports);
|
|
23
24
|
tslib_1.__exportStar(require("./boolean"), exports);
|
|
@@ -31,6 +32,5 @@ tslib_1.__exportStar(require("./number"), exports);
|
|
|
31
32
|
tslib_1.__exportStar(require("./object"), exports);
|
|
32
33
|
tslib_1.__exportStar(require("./page"), exports);
|
|
33
34
|
tslib_1.__exportStar(require("./sort"), exports);
|
|
34
|
-
tslib_1.__exportStar(require("./string"), exports);
|
|
35
35
|
tslib_1.__exportStar(require("./type"), exports);
|
|
36
36
|
//# sourceMappingURL=index.js.map
|
package/src/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/util/src/lib/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,sDAA4B;AAC5B,iDAAuB;AACvB,oDAA0B;AAC1B,kDAAwB;AACxB,mDAAyB;AACzB,qDAA2B;AAC3B,mDAAyB;AACzB,qDAA2B;AAC3B,gDAAsB;AACtB,kDAAwB;AACxB,iDAAuB;AACvB,oDAA0B;AAC1B,qDAA2B;AAC3B,oDAA0B;AAC1B,gDAAsB;AACtB,oDAA0B;AAC1B,iDAAuB;AACvB,kDAAwB;AACxB,oDAA0B;AAC1B,iDAAuB;AACvB,sDAA4B;AAC5B,qDAA2B;AAC3B,iDAAuB;AACvB,oDAA0B;AAC1B,gDAAsB;AACtB,mDAAyB;AACzB,mDAAyB;AACzB,iDAAuB;AACvB,iDAAuB;AACvB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/util/src/lib/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,sDAA4B;AAC5B,iDAAuB;AACvB,oDAA0B;AAC1B,kDAAwB;AACxB,mDAAyB;AACzB,qDAA2B;AAC3B,mDAAyB;AACzB,qDAA2B;AAC3B,gDAAsB;AACtB,kDAAwB;AACxB,iDAAuB;AACvB,oDAA0B;AAC1B,qDAA2B;AAC3B,oDAA0B;AAC1B,gDAAsB;AACtB,oDAA0B;AAC1B,mDAAyB;AACzB,iDAAuB;AACvB,kDAAwB;AACxB,oDAA0B;AAC1B,iDAAuB;AACvB,sDAA4B;AAC5B,qDAA2B;AAC3B,iDAAuB;AACvB,oDAA0B;AAC1B,gDAAsB;AACtB,mDAAyB;AACzB,mDAAyB;AACzB,iDAAuB;AACvB,iDAAuB;AACvB,iDAAuB"}
|
|
@@ -28,6 +28,9 @@ export interface ModelConversionOptions<I extends object> {
|
|
|
28
28
|
*/
|
|
29
29
|
definedOnly?: boolean;
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* A model conversion function. Performs a conversion on all non-null values.
|
|
33
|
+
*/
|
|
31
34
|
export declare type ModelConversionFieldValuesFunction<I extends object, O extends object> = ApplyMapFunctionWithOptions<Maybe<I>, O, ModelConversionOptions<I>>;
|
|
32
35
|
export declare function makeModelConversionFieldValuesFunction<I extends object, O extends object>(fields: ModelConversionFieldValuesConfig<I>): ModelConversionFieldValuesFunction<I, O>;
|
|
33
36
|
/**
|
|
@@ -94,3 +97,22 @@ export declare type ModelFieldMapToFunction<I, O> = ModelFieldMapFunction<I, O>;
|
|
|
94
97
|
* @returns
|
|
95
98
|
*/
|
|
96
99
|
export declare function modelFieldMapFunction<I, O>(config: ModelFieldMapConfig<I, O>): ModelFieldMapFunction<I, O>;
|
|
100
|
+
export declare type ModelFieldConversionsConfigRef<T extends object, O extends object> = {
|
|
101
|
+
readonly fields: ModelFieldConversionsConfig<T, O>;
|
|
102
|
+
};
|
|
103
|
+
export declare type ModelFieldConversionsRef<T extends object, O extends object> = {
|
|
104
|
+
readonly fieldConversions: ModelFieldConversions<T, O>;
|
|
105
|
+
};
|
|
106
|
+
export declare type ToModelFieldConversionsInput<T extends object, O extends object> = ModelFieldConversionsConfigRef<T, O> | ModelFieldConversionsRef<T, O>;
|
|
107
|
+
/**
|
|
108
|
+
* Converts the input to a ModelFieldConversions value.
|
|
109
|
+
*
|
|
110
|
+
* @param input
|
|
111
|
+
* @returns
|
|
112
|
+
*/
|
|
113
|
+
export declare function toModelFieldConversions<T extends object, O extends object>(input: ToModelFieldConversionsInput<T, O>): Required<{ [K in keyof T]: ModelFieldMapFunctions<T[K], ReplaceType<T, O, any>[K]>; }>;
|
|
114
|
+
export declare type ModelMapFunctinosRef<T extends object, O extends object> = {
|
|
115
|
+
readonly mapFunctions: ModelMapFunctions<T, O>;
|
|
116
|
+
};
|
|
117
|
+
export declare type ToModelMapFunctionsInput<T extends object, O extends object> = ToModelFieldConversionsInput<T, O> | ModelMapFunctinosRef<T, O>;
|
|
118
|
+
export declare function toModelMapFunctions<T extends object, O extends object>(input: ToModelMapFunctionsInput<T, O>): ModelMapFunctions<T, O>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/*eslint @typescript-eslint/no-explicit-any:"off"*/
|
|
3
3
|
// any is used with intent here, as there isn't enough typing information available when going from a parent of fields to the types of each child.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.modelFieldMapFunction = exports.modelFieldMapFunctions = exports.modelFieldConversions = exports.makeModelConversionFieldValuesFunction = exports.makeModelMapFunctions = void 0;
|
|
5
|
+
exports.toModelMapFunctions = exports.toModelFieldConversions = exports.modelFieldMapFunction = exports.modelFieldMapFunctions = exports.modelFieldConversions = exports.makeModelConversionFieldValuesFunction = exports.makeModelMapFunctions = void 0;
|
|
6
6
|
const getter_1 = require("../getter/getter");
|
|
7
7
|
const object_filter_pojo_1 = require("../object/object.filter.pojo");
|
|
8
8
|
const object_filter_tuple_1 = require("../object/object.filter.tuple");
|
|
@@ -24,7 +24,7 @@ exports.makeModelMapFunctions = makeModelMapFunctions;
|
|
|
24
24
|
function makeModelConversionFieldValuesFunction(fields) {
|
|
25
25
|
return (input, inputTarget, options) => {
|
|
26
26
|
const target = (inputTarget !== null && inputTarget !== void 0 ? inputTarget : {});
|
|
27
|
-
if (input) {
|
|
27
|
+
if (input != null) {
|
|
28
28
|
let targetFields = fields;
|
|
29
29
|
// if options are provided, filter down.
|
|
30
30
|
if (options) {
|
|
@@ -85,4 +85,28 @@ function modelFieldMapFunction(config) {
|
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
exports.modelFieldMapFunction = modelFieldMapFunction;
|
|
88
|
+
/**
|
|
89
|
+
* Converts the input to a ModelFieldConversions value.
|
|
90
|
+
*
|
|
91
|
+
* @param input
|
|
92
|
+
* @returns
|
|
93
|
+
*/
|
|
94
|
+
function toModelFieldConversions(input) {
|
|
95
|
+
var _a;
|
|
96
|
+
const conversions = (_a = input.fieldConversions) !== null && _a !== void 0 ? _a : modelFieldConversions(input.fields);
|
|
97
|
+
return conversions;
|
|
98
|
+
}
|
|
99
|
+
exports.toModelFieldConversions = toModelFieldConversions;
|
|
100
|
+
function toModelMapFunctions(input) {
|
|
101
|
+
let mapFunctions;
|
|
102
|
+
if (input.mapFunctions != null) {
|
|
103
|
+
mapFunctions = input.mapFunctions;
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
const conversions = toModelFieldConversions(input);
|
|
107
|
+
mapFunctions = makeModelMapFunctions(conversions);
|
|
108
|
+
}
|
|
109
|
+
return mapFunctions;
|
|
110
|
+
}
|
|
111
|
+
exports.toModelMapFunctions = toModelMapFunctions;
|
|
88
112
|
//# sourceMappingURL=model.conversion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.conversion.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/model/model.conversion.ts"],"names":[],"mappings":";AAAA,mDAAmD;AACnD,kJAAkJ;;;AAElJ,6CAAmE;AACnE,qEAA4D;AAC5D,uEAA+F;AAE/F,0CAA2C;AAG3C,sCAAyC;AAoBzC,SAAgB,qBAAqB,CAAqC,MAAmC;IAC3G,MAAM,IAAI,GAAG,IAAA,0CAAoB,EAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,gBAAgB,GAAwC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAwC,CAAC;IA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O,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AA5BD,sDA4BC;AAaD;;;;;GAKG;AACH,SAAgB,uBAAuB,CAAqC,KAAyC;;IACnH,MAAM,WAAW,GAAgC,MAAC,KAAwC,CAAC,gBAAgB,mCAAI,qBAAqB,CAAQ,KAA8C,CAAC,MAAM,CAAC,CAAC;IACnM,OAAO,WAAW,CAAC;AACrB,CAAC;AAHD,0DAGC;AAQD,SAAgB,mBAAmB,CAAqC,KAAqC;IAC3G,IAAI,YAAqC,CAAC;IAE1C,IAAK,KAAoC,CAAC,YAAY,IAAI,IAAI,EAAE;QAC9D,YAAY,GAAI,KAAoC,CAAC,YAAY,CAAC;KACnE;SAAM;QACL,MAAM,WAAW,GAAgC,uBAAuB,CAAC,KAA2C,CAAC,CAAC;QACtH,YAAY,GAAG,qBAAqB,CAAO,WAAW,CAAC,CAAC;KACzD;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAXD,kDAWC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/number/number.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"number.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/number/number.ts"],"names":[],"mappings":";;;AAOA;;;;;;GAMG;AACH,SAAgB,mBAAmB,CAAC,KAAoB,EAAE,OAAe;IACvE,MAAM,SAAS,GAAG,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,CAAC,CAAC,GAAG,OAAO,CAAC;IACzC,OAAO,SAAS,KAAK,CAAC,CAAC;AACzB,CAAC;AAHD,kDAGC;AASD;;;;;;GAMG;AACH,SAAgB,sBAAsB,CAAC,KAAa,EAAE,OAAe;IACnE,MAAM,KAAK,GAAG,KAAK,GAAG,OAAO,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACnC,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAErC,OAAO;QACL,KAAK;QACL,OAAO;QACP,WAAW,EAAE,SAAS,GAAG,OAAO;QAChC,YAAY,EAAE,UAAU,GAAG,OAAO;KACnC,CAAC;AACJ,CAAC;AAXD,wDAWC"}
|
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
import { Maybe } from '../value/maybe.type';
|
|
2
|
+
import { NumberString } from './number';
|
|
3
|
+
/**
|
|
4
|
+
* The number of decimal places ot use.
|
|
5
|
+
*/
|
|
6
|
+
export declare type NumberPrecision = number;
|
|
7
|
+
/**
|
|
8
|
+
* Same as cutToPrecision, but can take in a string or null/undefined.
|
|
9
|
+
*
|
|
10
|
+
* @param input
|
|
11
|
+
* @param precision
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare function cutValueToPrecision(input: Maybe<number | NumberString>, precision: NumberPrecision): number;
|
|
15
|
+
/**
|
|
16
|
+
* Rounds the input
|
|
17
|
+
*/
|
|
18
|
+
export declare type CutValueToPrecisionFunction = ((input: Maybe<number | NumberString>) => number) & {
|
|
19
|
+
readonly _precision: number;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Creates a CutValueToPrecisionFunction
|
|
23
|
+
*
|
|
24
|
+
* @param precision
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
export declare function cutValueToPrecisionFunction(precision: NumberPrecision): CutValueToPrecisionFunction;
|
|
1
28
|
/**
|
|
2
29
|
* Rounds the input number to the given precision.
|
|
3
30
|
*
|
|
@@ -5,7 +32,15 @@
|
|
|
5
32
|
* @param precision
|
|
6
33
|
* @returns
|
|
7
34
|
*/
|
|
8
|
-
export declare function roundToPrecision(value: number, precision:
|
|
35
|
+
export declare function roundToPrecision(value: number, precision: NumberPrecision): number;
|
|
36
|
+
/**
|
|
37
|
+
* Cuts the input number to the given precision. For example, 1.25 with precision 1 will not be rounded up to 1.3, but instead be "cut" to 1.2
|
|
38
|
+
*
|
|
39
|
+
* @param value
|
|
40
|
+
* @param precision
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
43
|
+
export declare function cutToPrecision(value: number, precision: NumberPrecision): number;
|
|
9
44
|
/**
|
|
10
45
|
* Rounds the number up to a specific "step" that contains it.
|
|
11
46
|
*
|
package/src/lib/number/round.js
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.roundNumberUpToStep = exports.roundToPrecision = void 0;
|
|
3
|
+
exports.roundNumberUpToStep = exports.cutToPrecision = exports.roundToPrecision = exports.cutValueToPrecisionFunction = exports.cutValueToPrecision = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Same as cutToPrecision, but can take in a string or null/undefined.
|
|
6
|
+
*
|
|
7
|
+
* @param input
|
|
8
|
+
* @param precision
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
function cutValueToPrecision(input, precision) {
|
|
12
|
+
return cutValueToPrecisionFunction(precision)(input);
|
|
13
|
+
}
|
|
14
|
+
exports.cutValueToPrecision = cutValueToPrecision;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a CutValueToPrecisionFunction
|
|
17
|
+
*
|
|
18
|
+
* @param precision
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
function cutValueToPrecisionFunction(precision) {
|
|
22
|
+
const fn = ((input) => {
|
|
23
|
+
let value;
|
|
24
|
+
switch (typeof input) {
|
|
25
|
+
case 'number':
|
|
26
|
+
value = input;
|
|
27
|
+
break;
|
|
28
|
+
case 'string':
|
|
29
|
+
value = Number(input);
|
|
30
|
+
break;
|
|
31
|
+
default:
|
|
32
|
+
value = 0;
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
return cutToPrecision(value, precision);
|
|
36
|
+
});
|
|
37
|
+
fn._precision = precision;
|
|
38
|
+
return fn;
|
|
39
|
+
}
|
|
40
|
+
exports.cutValueToPrecisionFunction = cutValueToPrecisionFunction;
|
|
4
41
|
// MARK: Number/Math
|
|
5
42
|
/**
|
|
6
43
|
* Rounds the input number to the given precision.
|
|
@@ -13,6 +50,19 @@ function roundToPrecision(value, precision) {
|
|
|
13
50
|
return +(Math.round(Number(value + 'e+' + precision)) + 'e-' + precision);
|
|
14
51
|
}
|
|
15
52
|
exports.roundToPrecision = roundToPrecision;
|
|
53
|
+
/**
|
|
54
|
+
* Cuts the input number to the given precision. For example, 1.25 with precision 1 will not be rounded up to 1.3, but instead be "cut" to 1.2
|
|
55
|
+
*
|
|
56
|
+
* @param value
|
|
57
|
+
* @param precision
|
|
58
|
+
* @returns
|
|
59
|
+
*/
|
|
60
|
+
function cutToPrecision(value, precision) {
|
|
61
|
+
// use floor for positive numbers, ceil for negative numbers
|
|
62
|
+
const rndFn = value > 0 ? Math.floor : Math.ceil;
|
|
63
|
+
return +(rndFn(Number(value + 'e+' + precision)) + 'e-' + precision);
|
|
64
|
+
}
|
|
65
|
+
exports.cutToPrecision = cutToPrecision;
|
|
16
66
|
/**
|
|
17
67
|
* Rounds the number up to a specific "step" that contains it.
|
|
18
68
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"round.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/number/round.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"round.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/number/round.ts"],"names":[],"mappings":";;;AAWA;;;;;;GAMG;AACH,SAAgB,mBAAmB,CAAC,KAAmC,EAAE,SAA0B;IACjG,OAAO,2BAA2B,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC;AACvD,CAAC;AAFD,kDAEC;AASD;;;;;GAKG;AACH,SAAgB,2BAA2B,CAAC,SAA0B;IACpE,MAAM,EAAE,GAA0C,CAAC,CAAC,KAAmC,EAAE,EAAE;QACzF,IAAI,KAAa,CAAC;QAElB,QAAQ,OAAO,KAAK,EAAE;YACp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ings":";;;AAAA,mDAAyB;AACzB,sDAA4B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MapFunction } from '
|
|
2
|
-
import { Maybe } from '
|
|
1
|
+
import { MapFunction } from '../value/map';
|
|
2
|
+
import { Maybe } from '../value/maybe.type';
|
|
3
3
|
export declare type MapStringFunction<T> = MapFunction<string, T>;
|
|
4
4
|
/**
|
|
5
5
|
* Represents a string that is made up of comma-separated values.
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/string/string.ts"],"names":[],"mappings":";;;AAkBA,SAAgB,qBAAqB,CAAC,KAAoB;IACxD,OAAO,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,iBAAiB,EAAE,CAAC;AACpC,CAAC;AAFD,sDAEC;AAID,SAAgB,yBAAyB,CAAc,KAA8B,EAAE,QAA8B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAiB;IAC3I,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAC5C,CAAC;AAHD,8DAGC;AAED,SAAgB,8BAA8B,CAAC,KAAkC;IAC/E,OAAO,IAAI,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACxE,CAAC;AAFD,wEAEC;AAED;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,KAAqB,EAAE,MAAM,GAAG,GAAG;IACvE,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC;KACrD;SAAM;QACL,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AAND,sDAMC;AAED;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,KAAa;IACjD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC;AAFD,sDAEC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { MapFunction } from '../value/map';
|
|
2
|
+
export declare function stringTrimFunction(input: string): string;
|
|
3
|
+
export declare function stringToUppercaseFunction(input: string): string;
|
|
4
|
+
export declare function stringToLowercaseFunction(input: string): string;
|
|
5
|
+
export declare type TransformStringFunctionConfig<S extends string = string> = {
|
|
6
|
+
/**
|
|
7
|
+
* Whether or not to trim the value.
|
|
8
|
+
*/
|
|
9
|
+
trim?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Whether or not to store all values as lowercase. Ignored if transform is provided.
|
|
12
|
+
*/
|
|
13
|
+
toLowercase?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether or not to store all values as uppercase. Ignored if transform is provided.
|
|
16
|
+
*/
|
|
17
|
+
toUppercase?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Optional transform function for text.
|
|
20
|
+
*/
|
|
21
|
+
transform?: TransformStringFunction<S>;
|
|
22
|
+
};
|
|
23
|
+
export declare type TransformStringFunction<S extends string = string> = MapFunction<S, S>;
|
|
24
|
+
export declare function transformStringFunction<S extends string = string>(config: TransformStringFunctionConfig): TransformStringFunction<S>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformStringFunction = exports.stringToLowercaseFunction = exports.stringToUppercaseFunction = exports.stringTrimFunction = void 0;
|
|
4
|
+
const map_1 = require("../value/map");
|
|
5
|
+
function stringTrimFunction(input) {
|
|
6
|
+
return input.trim();
|
|
7
|
+
}
|
|
8
|
+
exports.stringTrimFunction = stringTrimFunction;
|
|
9
|
+
function stringToUppercaseFunction(input) {
|
|
10
|
+
return input.toUpperCase();
|
|
11
|
+
}
|
|
12
|
+
exports.stringToUppercaseFunction = stringToUppercaseFunction;
|
|
13
|
+
function stringToLowercaseFunction(input) {
|
|
14
|
+
return input.toLowerCase();
|
|
15
|
+
}
|
|
16
|
+
exports.stringToLowercaseFunction = stringToLowercaseFunction;
|
|
17
|
+
function transformStringFunction(config) {
|
|
18
|
+
let baseTransform;
|
|
19
|
+
if (config.transform) {
|
|
20
|
+
baseTransform = config.transform;
|
|
21
|
+
}
|
|
22
|
+
else if (config.toUppercase) {
|
|
23
|
+
baseTransform = stringToUppercaseFunction;
|
|
24
|
+
}
|
|
25
|
+
else if (config.toLowercase) {
|
|
26
|
+
baseTransform = stringToLowercaseFunction;
|
|
27
|
+
}
|
|
28
|
+
let transform = baseTransform;
|
|
29
|
+
if (config.trim) {
|
|
30
|
+
if (baseTransform != null) {
|
|
31
|
+
transform = (x) => baseTransform(stringTrimFunction(x));
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
transform = stringTrimFunction;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (transform == null) {
|
|
38
|
+
transform = map_1.MAP_IDENTITY;
|
|
39
|
+
}
|
|
40
|
+
return transform;
|
|
41
|
+
}
|
|
42
|
+
exports.transformStringFunction = transformStringFunction;
|
|
43
|
+
//# sourceMappingURL=transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/string/transform.ts"],"names":[],"mappings":";;;AAAA,sCAAyD;AAGzD,SAAgB,kBAAkB,CAAC,KAAa;IAC9C,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AAFD,gDAEC;AAED,SAAgB,yBAAyB,CAAC,KAAa;IACrD,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;AAC7B,CAAC;AAFD,8DAEC;AAED,SAAgB,yBAAyB,CAAC,KAAa;IACrD,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;AAC7B,CAAC;AAFD,8DAEC;AAuBD,SAAgB,uBAAuB,CAA4B,MAAqC;IACtG,IAAI,aAA6C,CAAC;IAElD,IAAI,MAAM,CAAC,SAAS,EAAE;QACpB,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC;KAClC;SAAM,IAAI,MAAM,CAAC,WAAW,EAAE;QAC7B,aAAa,GAAG,yBAAyB,CAAC;KAC3C;SAAM,IAAI,MAAM,CAAC,WAAW,EAAE;QAC7B,aAAa,GAAG,yBAAyB,CAAC;KAC3C;IAED,IAAI,SAAS,GAAmC,aAAa,CAAC;IAE9D,IAAI,MAAM,CAAC,IAAI,EAAE;QACf,IAAI,aAAa,IAAI,IAAI,EAAE;YACzB,SAAS,GAAG,CAAC,CAAC,EAAE,EAAE,CAAE,aAAyC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;SACtF;aAAM;YACL,SAAS,GAAG,kBAAkB,CAAC;SAChC;KACF;IAED,IAAI,SAAS,IAAI,IAAI,EAAE;QACrB,SAAS,GAAG,kBAAuC,CAAC;KACrD;IAED,OAAO,SAAkD,CAAC;AAC5D,CAAC;AA1BD,0DA0BC"}
|
package/src/lib/value/index.d.ts
CHANGED
package/src/lib/value/index.js
CHANGED
|
@@ -10,4 +10,5 @@ tslib_1.__exportStar(require("./maybe"), exports);
|
|
|
10
10
|
tslib_1.__exportStar(require("./modifier"), exports);
|
|
11
11
|
tslib_1.__exportStar(require("./url"), exports);
|
|
12
12
|
tslib_1.__exportStar(require("./use"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./point"), exports);
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/value/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,qDAA2B;AAC3B,kDAAwB;AACxB,gDAAsB;AACtB,uDAA6B;AAC7B,kDAAwB;AACxB,qDAA2B;AAC3B,gDAAsB;AACtB,gDAAsB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/value/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,qDAA2B;AAC3B,kDAAwB;AACxB,gDAAsB;AACtB,uDAA6B;AAC7B,kDAAwB;AACxB,qDAA2B;AAC3B,gDAAsB;AACtB,gDAAsB;AACtB,kDAAwB"}
|
package/src/lib/value/map.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export declare type ApplyMapFunctionWithOptions<I, O, C> = (input: I, target?: M
|
|
|
23
23
|
export declare function mapArrayFunction<I, O>(mapFunction: MapFunction<I, O>): MapArrayFunction<MapFunction<I, O>>;
|
|
24
24
|
export declare const MAP_IDENTITY: (input: unknown) => unknown;
|
|
25
25
|
export declare function mapIdentityFunction<T>(): MapFunction<T, T>;
|
|
26
|
+
export declare function isMapIdentityFunction(fn: unknown): fn is typeof MAP_IDENTITY;
|
|
26
27
|
export declare type MapFunctionOutputPair<O, I = unknown> = {
|
|
27
28
|
input: I;
|
|
28
29
|
output: O;
|
package/src/lib/value/map.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapFunctionOutput = exports.wrapMapFunctionOutput = exports.mapFunctionOutputPair = exports.mapIdentityFunction = exports.MAP_IDENTITY = exports.mapArrayFunction = void 0;
|
|
3
|
+
exports.mapFunctionOutput = exports.wrapMapFunctionOutput = exports.mapFunctionOutputPair = exports.isMapIdentityFunction = exports.mapIdentityFunction = exports.MAP_IDENTITY = exports.mapArrayFunction = void 0;
|
|
4
4
|
const build_1 = require("./build");
|
|
5
5
|
function mapArrayFunction(mapFunction) {
|
|
6
6
|
return (input) => input.map(mapFunction);
|
|
@@ -12,6 +12,10 @@ function mapIdentityFunction() {
|
|
|
12
12
|
return exports.MAP_IDENTITY;
|
|
13
13
|
}
|
|
14
14
|
exports.mapIdentityFunction = mapIdentityFunction;
|
|
15
|
+
function isMapIdentityFunction(fn) {
|
|
16
|
+
return fn === exports.MAP_IDENTITY;
|
|
17
|
+
}
|
|
18
|
+
exports.isMapIdentityFunction = isMapIdentityFunction;
|
|
15
19
|
/**
|
|
16
20
|
* Wraps a MapFunction to instead provide the input and output values.
|
|
17
21
|
*
|
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":";;;AACA,mCAAgC;AA8BhC,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,mBAAmB;IACjC,OAAO,oBAAiC,CAAC;AAC3C,CAAC;AAFD,kDAEC;AAQD;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAiB,EAAqB;IACzE,OAAO,CAAC,KAAQ,EAAE,EAAE;QAClB,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;QAEzB,OAAO;YACL,KAAK;YACL,MAAM;SACP,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AATD,sDASC;AAQD;;;;GAIG;AACH,SAAgB,qBAAqB,CAAgC,EAAqB;IACxF,OAAO,CAAC,KAAQ,EAAE,EAAE;QAClB,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;QACzB,OAAO,iBAAiB,CAAC,MAAM,EAAE,KAAK,CA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,CAAC;IAC1C,CAAC,CAAC;AACJ,CAAC;AALD,sDAKC;AAED,SAAgB,iBAAiB,CAAgC,MAAS,EAAE,KAAQ;IAClF,OAAO,IAAA,aAAK,EAA0B;QACpC,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE;YACX,CAAC,CAAC,MAAM,GAAG,KAA0C,CAAC;QACxD,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAPD,8CAOC"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { Factory } from '../getter/getter';
|
|
2
|
+
import { NumberPrecision } from '../number/round';
|
|
3
|
+
/**
|
|
4
|
+
* Latitude value
|
|
5
|
+
*/
|
|
6
|
+
export declare type Latitude = number;
|
|
7
|
+
/**
|
|
8
|
+
* Longitude value
|
|
9
|
+
*/
|
|
10
|
+
export declare type Longitude = number;
|
|
11
|
+
export declare const MIN_LATITUDE_VALUE = -90;
|
|
12
|
+
export declare const MAX_LATITUDE_VALUE = 90;
|
|
13
|
+
export declare const MIN_LONGITUDE_VALUE = -180;
|
|
14
|
+
export declare const MAX_LONGITUDE_VALUE = 180;
|
|
15
|
+
export interface LatLngPoint {
|
|
16
|
+
lat: Latitude;
|
|
17
|
+
lng: Longitude;
|
|
18
|
+
}
|
|
19
|
+
export declare function latLngPoint(lat: Latitude, lng: Longitude): LatLngPoint;
|
|
20
|
+
export declare function isValidLatitude(lat: Latitude): boolean;
|
|
21
|
+
export declare function isValidLongitude(lat: Longitude): boolean;
|
|
22
|
+
export declare function defaultLatLngPoint(): LatLngPoint;
|
|
23
|
+
/**
|
|
24
|
+
* Returns true if the input point's lat/lng values are within the acceptable values range.
|
|
25
|
+
*
|
|
26
|
+
* @param input
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
export declare function isValidLatLngPoint(input: LatLngPoint): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* A lat,lng encoded value.
|
|
32
|
+
*/
|
|
33
|
+
export declare type LatLngString = `${Latitude},${Longitude}`;
|
|
34
|
+
export declare type LatLngPrecision = NumberPrecision;
|
|
35
|
+
/**
|
|
36
|
+
* Creates a LatLngString from the input.
|
|
37
|
+
*
|
|
38
|
+
* @param lat
|
|
39
|
+
* @param lng
|
|
40
|
+
*/
|
|
41
|
+
export declare function latLngString(lat: Latitude, lng?: Longitude): LatLngString;
|
|
42
|
+
export declare function latLngString(latLng: LatLngPoint): LatLngString;
|
|
43
|
+
export declare function latLngString(latLng: LatLngString): LatLngString;
|
|
44
|
+
/**
|
|
45
|
+
* A lat/lng regex with capture groups for lat and lng.
|
|
46
|
+
*
|
|
47
|
+
* Has a max precision of 10, which is easily precise enough for all GPS cases.
|
|
48
|
+
*
|
|
49
|
+
* https://stackoverflow.com/questions/3518504/regular-expression-for-matching-latitude-longitude-coordinates
|
|
50
|
+
*/
|
|
51
|
+
export declare const LAT_LNG_PATTERN: RegExp;
|
|
52
|
+
/**
|
|
53
|
+
* Checks whether or not the input has the expected pattern.
|
|
54
|
+
*
|
|
55
|
+
* @param input
|
|
56
|
+
*/
|
|
57
|
+
export declare function isLatLngString(input: string): input is LatLngString;
|
|
58
|
+
/**
|
|
59
|
+
* 111KM meter preicison, 0 decimal places
|
|
60
|
+
*/
|
|
61
|
+
export declare const LAT_LONG_100KM_PRECISION = 0;
|
|
62
|
+
/**
|
|
63
|
+
* 11.1KM meter preicison, 1 decimal place
|
|
64
|
+
*/
|
|
65
|
+
export declare const LAT_LONG_10KM_PRECISION = 1;
|
|
66
|
+
/**
|
|
67
|
+
* 1.11KM meter preicison, 2 decimal places
|
|
68
|
+
*/
|
|
69
|
+
export declare const LAT_LONG_1KM_PRECISION = 2;
|
|
70
|
+
/**
|
|
71
|
+
* 111 meter preicison, 3 decimal places
|
|
72
|
+
*/
|
|
73
|
+
export declare const LAT_LONG_100M_PRECISION = 3;
|
|
74
|
+
/**
|
|
75
|
+
* 11.1 meter preicison, 4 decimal places
|
|
76
|
+
*/
|
|
77
|
+
export declare const LAT_LONG_10M_PRECISION = 4;
|
|
78
|
+
/**
|
|
79
|
+
* 001.11 meter preicison, 5 decimal places
|
|
80
|
+
*/
|
|
81
|
+
export declare const LAT_LONG_1M_PRECISION = 5;
|
|
82
|
+
/**
|
|
83
|
+
* 011.10 centimeter preicison, 6 decimal places
|
|
84
|
+
*/
|
|
85
|
+
export declare const LAT_LONG_10CM_PRECISION = 6;
|
|
86
|
+
/**
|
|
87
|
+
* 001.11 centimeter precision, 7 decimal places
|
|
88
|
+
*/
|
|
89
|
+
export declare const LAT_LONG_1CM_PRECISION = 7;
|
|
90
|
+
/**
|
|
91
|
+
* 001.11 milimeter precision, 8 decimal places
|
|
92
|
+
*/
|
|
93
|
+
export declare const LAT_LONG_1MM_PRECISION = 8;
|
|
94
|
+
/**
|
|
95
|
+
* 0.1mm precision, 9 decimal places
|
|
96
|
+
*
|
|
97
|
+
* "Hey, check out this specific sand grain!"
|
|
98
|
+
*
|
|
99
|
+
* https://xkcd.com/2170/
|
|
100
|
+
*/
|
|
101
|
+
export declare const LAT_LONG_GRAINS_OF_SAND_PRECISION = 9;
|
|
102
|
+
/**
|
|
103
|
+
* Rounds the input latLng value to a given precision.
|
|
104
|
+
*/
|
|
105
|
+
export declare type LatLngPointPrecisionFunction = (latLngPoint: LatLngPoint) => LatLngPoint;
|
|
106
|
+
export declare function latLngPointPrecisionFunction(precision: LatLngPrecision): LatLngPointPrecisionFunction;
|
|
107
|
+
/**
|
|
108
|
+
* Converts the input to a LatLngString
|
|
109
|
+
*/
|
|
110
|
+
export declare type LatLngStringFunction = ((lat: Latitude | LatLngPoint | LatLngString | string, lng?: Longitude) => LatLngString) & ((latLng: string | LatLngString) => LatLngString) & ((latLng: LatLngPoint) => LatLngString) & ((lat: Latitude, lng?: Longitude) => LatLngString);
|
|
111
|
+
export interface LatLngStringFunctionConfig extends LatLngPointFunctionConfig {
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Creates a LatLngStringFunction
|
|
115
|
+
*
|
|
116
|
+
* @param precision
|
|
117
|
+
* @returns
|
|
118
|
+
*/
|
|
119
|
+
export declare function latLngStringFunction(config?: LatLngStringFunctionConfig): LatLngStringFunction;
|
|
120
|
+
/**
|
|
121
|
+
* Converts the input to a LatLngPoint
|
|
122
|
+
*/
|
|
123
|
+
export declare type LatLngPointFunction = ((lat: Latitude | LatLngPoint | LatLngString | string, lng?: Longitude) => LatLngPoint) & ((latLng: string | LatLngString) => LatLngPoint) & ((latLng: LatLngPoint) => LatLngPoint) & ((lat: Latitude, lng?: Longitude) => LatLngPoint);
|
|
124
|
+
export interface LatLngPointFunctionConfig {
|
|
125
|
+
/**
|
|
126
|
+
* LatLngPrecision to use
|
|
127
|
+
*/
|
|
128
|
+
precision?: LatLngPrecision;
|
|
129
|
+
/**
|
|
130
|
+
* Whether or not to validate and only return valid LatLng values.
|
|
131
|
+
*
|
|
132
|
+
* Is true by default.
|
|
133
|
+
*/
|
|
134
|
+
validate?: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* The default LatLngPoint to return.
|
|
137
|
+
*/
|
|
138
|
+
default?: Factory<LatLngPoint>;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Creates a LatLngPointFunction
|
|
142
|
+
*
|
|
143
|
+
* @param precision
|
|
144
|
+
* @returns
|
|
145
|
+
*/
|
|
146
|
+
export declare function latLngPointFunction(config?: LatLngPointFunctionConfig): LatLngPointFunction;
|
|
147
|
+
/**
|
|
148
|
+
* Creates a LatLngPoint from the input latLng string.
|
|
149
|
+
*
|
|
150
|
+
* @param latLngString
|
|
151
|
+
*/
|
|
152
|
+
export declare function latLngPointFromString(latLngString: LatLngString | string): LatLngPoint;
|
|
153
|
+
export declare function validLatLngPoint(latLngPoint: LatLngPoint, defaultValue?: Factory<LatLngPoint>): LatLngPoint;
|
|
154
|
+
/**
|
|
155
|
+
* Returns a valid LatLngPoint by validating the input and returns the input value if it is valid, or a default value that is valid.
|
|
156
|
+
*
|
|
157
|
+
* @param latLngPoint
|
|
158
|
+
*/
|
|
159
|
+
export declare type ValidLatLngPointFunction = (latLngPoint: LatLngPoint) => LatLngPoint;
|
|
160
|
+
export declare function validLatLngPointFunction(defaultValue?: Factory<LatLngPoint>): ValidLatLngPointFunction;
|
|
161
|
+
/**
|
|
162
|
+
* References a latLng using a LatLngPoint
|
|
163
|
+
*/
|
|
164
|
+
export declare type LatLngPointRef = {
|
|
165
|
+
readonly latLng: LatLngPoint;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* References a latLng using a LatLngString
|
|
169
|
+
*/
|
|
170
|
+
export declare type LatLngStringRef = {
|
|
171
|
+
readonly latLng: LatLngPoint;
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* An object that references a latLng
|
|
175
|
+
*/
|
|
176
|
+
export declare type LatLngRef = LatLngPointRef | LatLngStringRef;
|
|
177
|
+
/**
|
|
178
|
+
* A LatLngPointRef with arbitrary data
|
|
179
|
+
*/
|
|
180
|
+
export declare type LatLngDataPoint<T> = LatLngPointRef & {
|
|
181
|
+
readonly data: T;
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Converts the input value to a LatLngDataPoint
|
|
185
|
+
*/
|
|
186
|
+
export declare type LatLngDataPointFunction<T extends LatLngRef> = (data: T) => LatLngDataPoint<T>;
|
|
187
|
+
/**
|
|
188
|
+
* Creates a LatLngDataPointFunction
|
|
189
|
+
*
|
|
190
|
+
* @param precision
|
|
191
|
+
* @returns
|
|
192
|
+
*/
|
|
193
|
+
export declare function latLngDataPointFunction<T extends LatLngRef>(config?: LatLngPointFunctionConfig): LatLngDataPointFunction<T>;
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.latLngDataPointFunction = exports.validLatLngPointFunction = exports.validLatLngPoint = exports.latLngPointFromString = exports.latLngPointFunction = exports.latLngStringFunction = exports.latLngPointPrecisionFunction = exports.LAT_LONG_GRAINS_OF_SAND_PRECISION = exports.LAT_LONG_1MM_PRECISION = exports.LAT_LONG_1CM_PRECISION = exports.LAT_LONG_10CM_PRECISION = exports.LAT_LONG_1M_PRECISION = exports.LAT_LONG_10M_PRECISION = exports.LAT_LONG_100M_PRECISION = exports.LAT_LONG_1KM_PRECISION = exports.LAT_LONG_10KM_PRECISION = exports.LAT_LONG_100KM_PRECISION = exports.isLatLngString = exports.LAT_LNG_PATTERN = exports.latLngString = exports.isValidLatLngPoint = exports.defaultLatLngPoint = exports.isValidLongitude = exports.isValidLatitude = exports.latLngPoint = exports.MAX_LONGITUDE_VALUE = exports.MIN_LONGITUDE_VALUE = exports.MAX_LATITUDE_VALUE = exports.MIN_LATITUDE_VALUE = void 0;
|
|
4
|
+
const round_1 = require("../number/round");
|
|
5
|
+
exports.MIN_LATITUDE_VALUE = -90.0;
|
|
6
|
+
exports.MAX_LATITUDE_VALUE = 90.0;
|
|
7
|
+
exports.MIN_LONGITUDE_VALUE = -180.0;
|
|
8
|
+
exports.MAX_LONGITUDE_VALUE = 180.0;
|
|
9
|
+
function latLngPoint(lat, lng) {
|
|
10
|
+
return { lat, lng };
|
|
11
|
+
}
|
|
12
|
+
exports.latLngPoint = latLngPoint;
|
|
13
|
+
function isValidLatitude(lat) {
|
|
14
|
+
return lat >= exports.MIN_LATITUDE_VALUE && lat <= exports.MAX_LATITUDE_VALUE;
|
|
15
|
+
}
|
|
16
|
+
exports.isValidLatitude = isValidLatitude;
|
|
17
|
+
function isValidLongitude(lat) {
|
|
18
|
+
return lat >= exports.MIN_LONGITUDE_VALUE && lat <= exports.MAX_LONGITUDE_VALUE;
|
|
19
|
+
}
|
|
20
|
+
exports.isValidLongitude = isValidLongitude;
|
|
21
|
+
function defaultLatLngPoint() {
|
|
22
|
+
return { lat: 0, lng: 0 };
|
|
23
|
+
}
|
|
24
|
+
exports.defaultLatLngPoint = defaultLatLngPoint;
|
|
25
|
+
/**
|
|
26
|
+
* Returns true if the input point's lat/lng values are within the acceptable values range.
|
|
27
|
+
*
|
|
28
|
+
* @param input
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
function isValidLatLngPoint(input) {
|
|
32
|
+
return isValidLatitude(input.lat) && isValidLongitude(input.lng);
|
|
33
|
+
}
|
|
34
|
+
exports.isValidLatLngPoint = isValidLatLngPoint;
|
|
35
|
+
function latLngString(lat, lng) {
|
|
36
|
+
return latLngStringFunction()(lat, lng);
|
|
37
|
+
}
|
|
38
|
+
exports.latLngString = latLngString;
|
|
39
|
+
/**
|
|
40
|
+
* A lat/lng regex with capture groups for lat and lng.
|
|
41
|
+
*
|
|
42
|
+
* Has a max precision of 10, which is easily precise enough for all GPS cases.
|
|
43
|
+
*
|
|
44
|
+
* https://stackoverflow.com/questions/3518504/regular-expression-for-matching-latitude-longitude-coordinates
|
|
45
|
+
*/
|
|
46
|
+
exports.LAT_LNG_PATTERN = /(?<lat>^[-+]?(?:[1-8]?\d(?:\.\d{0,10})?|90(?:\.0{0,10})?))\s*,\s*(?<lng>[-+]?(?:180(?:\.0{0,10})?|(?:1[0-7]\d|[1-9]?\d)(?:\.\d{0,10})?))$/;
|
|
47
|
+
/**
|
|
48
|
+
* Checks whether or not the input has the expected pattern.
|
|
49
|
+
*
|
|
50
|
+
* @param input
|
|
51
|
+
*/
|
|
52
|
+
function isLatLngString(input) {
|
|
53
|
+
return exports.LAT_LNG_PATTERN.test(input);
|
|
54
|
+
}
|
|
55
|
+
exports.isLatLngString = isLatLngString;
|
|
56
|
+
/**
|
|
57
|
+
* 111KM meter preicison, 0 decimal places
|
|
58
|
+
*/
|
|
59
|
+
exports.LAT_LONG_100KM_PRECISION = 0;
|
|
60
|
+
/**
|
|
61
|
+
* 11.1KM meter preicison, 1 decimal place
|
|
62
|
+
*/
|
|
63
|
+
exports.LAT_LONG_10KM_PRECISION = 1;
|
|
64
|
+
/**
|
|
65
|
+
* 1.11KM meter preicison, 2 decimal places
|
|
66
|
+
*/
|
|
67
|
+
exports.LAT_LONG_1KM_PRECISION = 2;
|
|
68
|
+
/**
|
|
69
|
+
* 111 meter preicison, 3 decimal places
|
|
70
|
+
*/
|
|
71
|
+
exports.LAT_LONG_100M_PRECISION = 3;
|
|
72
|
+
/**
|
|
73
|
+
* 11.1 meter preicison, 4 decimal places
|
|
74
|
+
*/
|
|
75
|
+
exports.LAT_LONG_10M_PRECISION = 4;
|
|
76
|
+
/**
|
|
77
|
+
* 001.11 meter preicison, 5 decimal places
|
|
78
|
+
*/
|
|
79
|
+
exports.LAT_LONG_1M_PRECISION = 5;
|
|
80
|
+
/**
|
|
81
|
+
* 011.10 centimeter preicison, 6 decimal places
|
|
82
|
+
*/
|
|
83
|
+
exports.LAT_LONG_10CM_PRECISION = 6;
|
|
84
|
+
/**
|
|
85
|
+
* 001.11 centimeter precision, 7 decimal places
|
|
86
|
+
*/
|
|
87
|
+
exports.LAT_LONG_1CM_PRECISION = 7;
|
|
88
|
+
/**
|
|
89
|
+
* 001.11 milimeter precision, 8 decimal places
|
|
90
|
+
*/
|
|
91
|
+
exports.LAT_LONG_1MM_PRECISION = 8;
|
|
92
|
+
/**
|
|
93
|
+
* 0.1mm precision, 9 decimal places
|
|
94
|
+
*
|
|
95
|
+
* "Hey, check out this specific sand grain!"
|
|
96
|
+
*
|
|
97
|
+
* https://xkcd.com/2170/
|
|
98
|
+
*/
|
|
99
|
+
exports.LAT_LONG_GRAINS_OF_SAND_PRECISION = 9;
|
|
100
|
+
function latLngPointPrecisionFunction(precision) {
|
|
101
|
+
const precisionFunction = (0, round_1.cutValueToPrecisionFunction)(precision);
|
|
102
|
+
return (latLng) => {
|
|
103
|
+
const { lat: latInput, lng: lngInput } = latLng;
|
|
104
|
+
const lat = precisionFunction(latInput);
|
|
105
|
+
const lng = precisionFunction(lngInput);
|
|
106
|
+
return { lat, lng };
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
exports.latLngPointPrecisionFunction = latLngPointPrecisionFunction;
|
|
110
|
+
/**
|
|
111
|
+
* Creates a LatLngStringFunction
|
|
112
|
+
*
|
|
113
|
+
* @param precision
|
|
114
|
+
* @returns
|
|
115
|
+
*/
|
|
116
|
+
function latLngStringFunction(config) {
|
|
117
|
+
const fn = latLngPointFunction(config);
|
|
118
|
+
return (lat, lng) => {
|
|
119
|
+
let latLng = fn(lat, lng);
|
|
120
|
+
return `${latLng.lat},${latLng.lng}`;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
exports.latLngStringFunction = latLngStringFunction;
|
|
124
|
+
/**
|
|
125
|
+
* Creates a LatLngPointFunction
|
|
126
|
+
*
|
|
127
|
+
* @param precision
|
|
128
|
+
* @returns
|
|
129
|
+
*/
|
|
130
|
+
function latLngPointFunction(config) {
|
|
131
|
+
const { validate, default: defaultValue, precision = exports.LAT_LONG_1MM_PRECISION } = config !== null && config !== void 0 ? config : {};
|
|
132
|
+
const precisionFunction = latLngPointPrecisionFunction(precision);
|
|
133
|
+
const validateFunction = validLatLngPointFunction(defaultValue);
|
|
134
|
+
const mapFn = validate !== false ? (input) => precisionFunction(validateFunction(input)) : precisionFunction;
|
|
135
|
+
return (lat, lng) => {
|
|
136
|
+
let latLng;
|
|
137
|
+
const latType = typeof lat;
|
|
138
|
+
if (latType === 'string') {
|
|
139
|
+
latLng = latLngPointFromString(lat);
|
|
140
|
+
}
|
|
141
|
+
else if (latType === 'object') {
|
|
142
|
+
latLng = lat;
|
|
143
|
+
}
|
|
144
|
+
else if (lng != null) {
|
|
145
|
+
latLng = latLngPoint(lat, lng);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
throw new Error(`Invalid lat/lng input "${lat},${lng}"`);
|
|
149
|
+
}
|
|
150
|
+
return mapFn(latLng); // round to a given precision
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
exports.latLngPointFunction = latLngPointFunction;
|
|
154
|
+
/**
|
|
155
|
+
* Creates a LatLngPoint from the input latLng string.
|
|
156
|
+
*
|
|
157
|
+
* @param latLngString
|
|
158
|
+
*/
|
|
159
|
+
function latLngPointFromString(latLngString) {
|
|
160
|
+
const [latString, lngString] = latLngString.split(',');
|
|
161
|
+
const lat = Number(latString) || 0; // default lat and lng to 0 if not valid.
|
|
162
|
+
const lng = Number(lngString) || 0;
|
|
163
|
+
return { lat, lng };
|
|
164
|
+
}
|
|
165
|
+
exports.latLngPointFromString = latLngPointFromString;
|
|
166
|
+
function validLatLngPoint(latLngPoint, defaultValue) {
|
|
167
|
+
return validLatLngPointFunction(defaultValue)(latLngPoint);
|
|
168
|
+
}
|
|
169
|
+
exports.validLatLngPoint = validLatLngPoint;
|
|
170
|
+
function validLatLngPointFunction(defaultValue = defaultLatLngPoint) {
|
|
171
|
+
return (latLngPoint) => (isValidLatLngPoint(latLngPoint) ? latLngPoint : defaultValue());
|
|
172
|
+
}
|
|
173
|
+
exports.validLatLngPointFunction = validLatLngPointFunction;
|
|
174
|
+
/**
|
|
175
|
+
* Creates a LatLngDataPointFunction
|
|
176
|
+
*
|
|
177
|
+
* @param precision
|
|
178
|
+
* @returns
|
|
179
|
+
*/
|
|
180
|
+
function latLngDataPointFunction(config) {
|
|
181
|
+
const fn = latLngPointFunction(config);
|
|
182
|
+
return (data) => {
|
|
183
|
+
const latLng = fn(data.latLng);
|
|
184
|
+
return {
|
|
185
|
+
latLng,
|
|
186
|
+
data
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
exports.latLngDataPointFunction = latLngDataPointFunction;
|
|
191
|
+
//# sourceMappingURL=point.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/value/point.ts"],"names":[],"mappings":";;;AACA,2CAA+E;AAalE,QAAA,kBAAkB,GAAG,CAAC,IAAI,CAAC;AAC3B,QAAA,kBAAkB,GAAG,IAAI,CAAC;AAC1B,QAAA,mBAAmB,GAAG,CAAC,KAAK,CAAC;AAC7B,QAAA,mBAAmB,GAAG,KAAK,CAAC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AgB,CAAC,WAAwB,EAAE,YAAmC;IAC5F,OAAO,wBAAwB,CAAC,YAAY,CAAC,CAAC,WAAW,CAAC,CAAC;AAC7D,CAAC;AAFD,4CAEC;AASD,SAAgB,wBAAwB,CAAC,eAAqC,kBAAkB;IAC9F,OAAO,CAAC,WAAwB,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;AACxG,CAAC;AAFD,4DAEC;AAkCD;;;;;GAKG;AACH,SAAgB,uBAAuB,CAAsB,MAAkC;IAC7F,MAAM,EAAE,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACvC,OAAO,CAAC,IAAO,EAAE,EAAE;QACjB,MAAM,MAAM,GAAgB,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5C,OAAO;YACL,MAAM;YACN,IAAI;SACL,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AATD,0DASC"}
|
package/test/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
# [8.9.0](https://github.com/dereekb/dbx-components/compare/v8.8.1-dev...v8.9.0) (2022-06-30)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## [8.8.1](https://github.com/dereekb/dbx-components/compare/v8.8.0-dev...v8.8.1) (2022-06-29)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# [8.8.0](https://github.com/dereekb/dbx-components/compare/v8.7.6-dev...v8.8.0) (2022-06-29)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
5
17
|
## [8.7.6](https://github.com/dereekb/dbx-components/compare/v8.7.5-dev...v8.7.6) (2022-06-29)
|
|
6
18
|
|
|
7
19
|
|
package/test/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/util/test",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.9.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"typings": "./src/index.d.ts",
|
|
7
7
|
"dependencies": {},
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@dereekb/util": "8.
|
|
9
|
+
"@dereekb/util": "8.9.0",
|
|
10
10
|
"make-error": "^1.3.0",
|
|
11
11
|
"ts-essentials": "^9.1.2",
|
|
12
12
|
"extra-set": "^2.2.11",
|
package/src/lib/string.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../../../../packages/util/src/lib/string.ts"],"names":[],"mappings":";;;AAkBA,SAAgB,qBAAqB,CAAC,KAAoB;IACxD,OAAO,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,iBAAiB,EAAE,CAAC;AACpC,CAAC;AAFD,sDAEC;AAID,SAAgB,yBAAyB,CAAc,KAA8B,EAAE,QAA8B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAiB;IAC3I,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAC5C,CAAC;AAHD,8DAGC;AAED,SAAgB,8BAA8B,CAAC,KAAkC;IAC/E,OAAO,IAAI,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACxE,CAAC;AAFD,wEAEC;AAED;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,KAAqB,EAAE,MAAM,GAAG,GAAG;IACvE,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC;KACrD;SAAM;QACL,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AAND,sDAMC;AAED;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,KAAa;IACjD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC;AAFD,sDAEC"}
|