@dereekb/util 8.8.1 → 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 CHANGED
@@ -2,6 +2,15 @@
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
+
5
14
  ## [8.8.1](https://github.com/dereekb/dbx-components/compare/v8.8.0-dev...v8.8.1) (2022-06-29)
6
15
 
7
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/util",
3
- "version": "8.8.1",
3
+ "version": "8.9.0",
4
4
  "type": "commonjs",
5
5
  "exports": {
6
6
  ".": {
@@ -1,25 +1,13 @@
1
1
  import { ReadKeyFunction, ReadKeysFunction } from '../key';
2
- import { DecisionFunctionFactory, MapFunction } from '../value';
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 function arrayToUppercase(input: string[]): string[];
5
- export declare function arrayToLowercase(input: string[]): string[];
6
- export declare type TransformStringsConfig = {
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: TransformStringsConfig): TransformStringsFunction;
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 TransformStringsConfig {
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 value_1 = require("../value");
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
- function arrayToUppercase(input) {
15
- return input.map((x) => x.toUpperCase());
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 = config.transform ? (0, value_1.mapArrayFunction)(config.transform) : config.toLowercase ? arrayToLowercase : config.toUppercase ? arrayToUppercase : (0, value_1.mapIdentityFunction)();
24
- return transform;
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,sCAAkD;AAClD,oCAAqF;AACrF,2DAAuD;AACvD,oCAAuG;AAEvG,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;AAED,SAAgB,gBAAgB,CAAC,KAAe;IAC9C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAC3C,CAAC;AAFD,4CAEC;AAED,SAAgB,gBAAgB,CAAC,KAAe;IAC9C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAC3C,CAAC;AAFD,4CAEC;AAoBD,SAAgB,gBAAgB,CAAC,MAA8B;IAC7D,MAAM,SAAS,GAA6B,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAA,wBAAgB,EAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAA,2BAAmB,GAAE,CAAC;IAC1M,OAAO,SAAS,CAAC;AACnB,CAAC;AAHD,4CAGC;AAED,SAAgB,4BAA4B,CAAC,MAAwB;IACnE,OAAO,IAAA,0BAAW,EAAiB,MAAM,EAAE,8BAAqB,CAAC,CAAC;AACpE,CAAC;AAFD,oEAEC;AAED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AO,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"}
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,IAAA,mCAAuB,EAAC,MAAM,CAAC,CAAC;IAElD,IAAI,IAAA,2BAAqB,EAAC,SAAS,CAAC,EAAE;QACpC,OAAO,IAAA,yBAAmB,GAAE,CAAC;KAC9B;SAAM;QACL,OAAO,IAAA,sBAAgB,EAAC,SAAS,CAAC,CAAC;KACpC;AACH,CAAC;AARD,4CAQC;AAED,SAAgB,4BAA4B,CAAC,MAAwB;IACnE,OAAO,IAAA,0BAAW,EAAiB,MAAM,EAAE,8BAAqB,CAAC,CAAC;AACpE,CAAC;AAFD,oEAEC;AAED,SAAgB,4BAA4B,CAAC,MAAwB;IACnE,OAAO,KAAK,CAAC,IAAI,CAAC,+BAA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,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;AACrF,CAAC,CAAC;AAHW,QAAA,6CAA6C,iDAGxD"}
@@ -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
@@ -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,mDAAyB;AACzB,iDAAuB"}
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"}
@@ -1,4 +1,8 @@
1
1
  import { Maybe } from '../value/maybe.type';
2
+ /**
3
+ * A string represented within a number.
4
+ */
5
+ export declare type NumberString = string;
2
6
  /**
3
7
  * Returns true if the input value is divisible by the divisor.
4
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"number.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/number/number.ts"],"names":[],"mappings":";;;AAEA;;;;;;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
+ {"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: number): number;
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
  *
@@ -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":";;;AAAA,oBAAoB;AACpB;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAAC,KAAa,EAAE,SAAiB;IAC/D,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAC5E,CAAC;AAFD,4CAEC;AAED;;;;;;;;GAQG;AACH,SAAgB,mBAAmB,CAAC,KAAa,EAAE,IAAY;IAC7D,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;AACxC,CAAC;AAFD,kDAEC"}
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;YACpB,KAAK,QAAQ;gBACX,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;YACR,KAAK,QAAQ;gBACX,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;gBACtB,MAAM;YACR;gBACE,KAAK,GAAG,CAAC,CAAC;gBACV,MAAM;SACT;QAED,OAAO,cAAc,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC1C,CAAC,CAAgC,CAAC;IAClC,EAAE,CAAC,UAAU,GAAG,SAAS,CAAC;IAC1B,OAAO,EAAiC,CAAC;AAC3C,CAAC;AApBD,kEAoBC;AAED,oBAAoB;AACpB;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAAC,KAAa,EAAE,SAA0B;IACxE,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAC5E,CAAC;AAFD,4CAEC;AAED;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,KAAa,EAAE,SAA0B;IACtE,4DAA4D;IAC5D,MAAM,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IACjD,OAAO,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AACvE,CAAC;AAJD,wCAIC;AAED;;;;;;;;GAQG;AACH,SAAgB,mBAAmB,CAAC,KAAa,EAAE,IAAY;IAC7D,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;AACxC,CAAC;AAFD,kDAEC"}
@@ -0,0 +1,2 @@
1
+ export * from './string';
2
+ export * from './transform';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./string"), exports);
5
+ tslib_1.__exportStar(require("./transform"), exports);
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/string/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,sDAA4B"}
@@ -1,5 +1,5 @@
1
- import { MapFunction } from './value/map';
2
- import { Maybe } from './value/maybe.type';
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"}
@@ -7,3 +7,4 @@ export * from './maybe';
7
7
  export * from './modifier';
8
8
  export * from './url';
9
9
  export * from './use';
10
+ export * from './point';
@@ -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"}
@@ -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;
@@ -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
  *
@@ -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,CAAC,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,C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,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;AAOzC,SAAgB,WAAW,CAAC,GAAa,EAAE,GAAc;IACvD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACtB,CAAC;AAFD,kCAEC;AAED,SAAgB,eAAe,CAAC,GAAa;IAC3C,OAAO,GAAG,IAAI,0BAAkB,IAAI,GAAG,IAAI,0BAAkB,CAAC;AAChE,CAAC;AAFD,0CAEC;AAED,SAAgB,gBAAgB,CAAC,GAAc;IAC7C,OAAO,GAAG,IAAI,2BAAmB,IAAI,GAAG,IAAI,2BAAmB,CAAC;AAClE,CAAC;AAFD,4CAEC;AAED,SAAgB,kBAAkB;IAChC,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;AAC5B,CAAC;AAFD,gDAEC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,KAAkB;IACnD,OAAO,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,gBAAgB,CAAC,KAAK,CAAC,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,CAAC;AATD,0DASC"}
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
+ # [8.9.0](https://github.com/dereekb/dbx-components/compare/v8.8.1-dev...v8.9.0) (2022-06-30)
6
+
7
+
8
+
5
9
  ## [8.8.1](https://github.com/dereekb/dbx-components/compare/v8.8.0-dev...v8.8.1) (2022-06-29)
6
10
 
7
11
 
package/test/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@dereekb/util/test",
3
- "version": "8.8.1",
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.8.1",
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",
@@ -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"}