@onivoro/isomorphic-common 22.0.3 → 22.0.5

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.
Files changed (51) hide show
  1. package/dist/cjs/index.d.ts +10 -0
  2. package/dist/cjs/index.js +10 -0
  3. package/dist/cjs/lib/functions/format-usd.function.d.ts +1 -0
  4. package/dist/cjs/lib/functions/format-usd.function.js +7 -0
  5. package/dist/cjs/lib/functions/get-date-range-for-month.function.d.ts +4 -0
  6. package/dist/cjs/lib/functions/get-date-range-for-month.function.js +9 -0
  7. package/dist/cjs/lib/functions/is-valid-date.function.d.ts +1 -0
  8. package/dist/cjs/lib/functions/is-valid-date.function.js +7 -0
  9. package/dist/cjs/lib/functions/map-enum-to-array-of-values.function.d.ts +1 -0
  10. package/dist/cjs/lib/functions/map-enum-to-array-of-values.function.js +6 -0
  11. package/dist/cjs/lib/functions/map-enum-to-lookup-array.function.d.ts +2 -0
  12. package/dist/cjs/lib/functions/map-enum-to-lookup-array.function.js +7 -0
  13. package/dist/cjs/lib/functions/map-enum-to-options.function.d.ts +4 -0
  14. package/dist/cjs/lib/functions/map-enum-to-options.function.js +9 -0
  15. package/dist/cjs/lib/functions/remove-element-at-index.function.d.ts +1 -0
  16. package/dist/cjs/lib/functions/remove-element-at-index.function.js +12 -0
  17. package/dist/cjs/lib/functions/round.function.d.ts +1 -0
  18. package/dist/cjs/lib/functions/round.function.js +7 -0
  19. package/dist/cjs/lib/interfaces/lookup.interface.d.ts +4 -0
  20. package/dist/cjs/lib/interfaces/lookup.interface.js +2 -0
  21. package/dist/esm/index.d.ts +10 -0
  22. package/dist/esm/index.js +10 -0
  23. package/dist/esm/lib/functions/format-usd.function.d.ts +1 -0
  24. package/dist/esm/lib/functions/format-usd.function.js +7 -0
  25. package/dist/esm/lib/functions/get-date-range-for-month.function.d.ts +4 -0
  26. package/dist/esm/lib/functions/get-date-range-for-month.function.js +9 -0
  27. package/dist/esm/lib/functions/is-valid-date.function.d.ts +1 -0
  28. package/dist/esm/lib/functions/is-valid-date.function.js +7 -0
  29. package/dist/esm/lib/functions/map-enum-to-array-of-values.function.d.ts +1 -0
  30. package/dist/esm/lib/functions/map-enum-to-array-of-values.function.js +6 -0
  31. package/dist/esm/lib/functions/map-enum-to-lookup-array.function.d.ts +2 -0
  32. package/dist/esm/lib/functions/map-enum-to-lookup-array.function.js +7 -0
  33. package/dist/esm/lib/functions/map-enum-to-options.function.d.ts +4 -0
  34. package/dist/esm/lib/functions/map-enum-to-options.function.js +9 -0
  35. package/dist/esm/lib/functions/remove-element-at-index.function.d.ts +1 -0
  36. package/dist/esm/lib/functions/remove-element-at-index.function.js +12 -0
  37. package/dist/esm/lib/functions/round.function.d.ts +1 -0
  38. package/dist/esm/lib/functions/round.function.js +7 -0
  39. package/dist/esm/lib/interfaces/lookup.interface.d.ts +4 -0
  40. package/dist/esm/lib/interfaces/lookup.interface.js +2 -0
  41. package/dist/types/index.d.ts +10 -0
  42. package/dist/types/lib/functions/format-usd.function.d.ts +1 -0
  43. package/dist/types/lib/functions/get-date-range-for-month.function.d.ts +4 -0
  44. package/dist/types/lib/functions/is-valid-date.function.d.ts +1 -0
  45. package/dist/types/lib/functions/map-enum-to-array-of-values.function.d.ts +1 -0
  46. package/dist/types/lib/functions/map-enum-to-lookup-array.function.d.ts +2 -0
  47. package/dist/types/lib/functions/map-enum-to-options.function.d.ts +4 -0
  48. package/dist/types/lib/functions/remove-element-at-index.function.d.ts +1 -0
  49. package/dist/types/lib/functions/round.function.d.ts +1 -0
  50. package/dist/types/lib/interfaces/lookup.interface.d.ts +4 -0
  51. package/package.json +1 -1
@@ -5,14 +5,23 @@ export * from './lib/constants/millis-per-minute.constant';
5
5
  export * from './lib/functions/add-offset.function';
6
6
  export * from './lib/functions/camel-case.function';
7
7
  export * from './lib/functions/convert-object-to-literal.function';
8
+ export * from './lib/functions/format-usd.function';
8
9
  export * from './lib/functions/from-boolean-string.function';
9
10
  export * from './lib/functions/from-calendar-date.function';
10
11
  export * from './lib/functions/from-csv-string.function';
12
+ export * from './lib/functions/get-date-range-for-month.function';
13
+ export * from './lib/functions/is-symbol.function';
14
+ export * from './lib/functions/is-valid-date.function';
11
15
  export * from './lib/functions/kebab-case.function';
16
+ export * from './lib/functions/map-enum-to-array-of-values.function';
17
+ export * from './lib/functions/map-enum-to-lookup-array.function';
18
+ export * from './lib/functions/map-enum-to-options.function';
12
19
  export * from './lib/functions/money.function';
13
20
  export * from './lib/functions/parse-bool.function';
14
21
  export * from './lib/functions/properties-to-array.function';
15
22
  export * from './lib/functions/remove-alpha-chars.function';
23
+ export * from './lib/functions/remove-element-at-index.function';
24
+ export * from './lib/functions/round.function';
16
25
  export * from './lib/functions/sleep.function';
17
26
  export * from './lib/functions/sanitize-filename.function';
18
27
  export * from './lib/functions/snake-case.function';
@@ -31,3 +40,4 @@ export * from './lib/functions/words.function';
31
40
  export * from './lib/interfaces/axios-wrapped-nest-exception.interface';
32
41
  export * from './lib/interfaces/entity-provider.interface';
33
42
  export * from './lib/interfaces/keys-of.type';
43
+ export * from './lib/interfaces/lookup.interface';
package/dist/cjs/index.js CHANGED
@@ -21,14 +21,23 @@ __exportStar(require("./lib/constants/millis-per-minute.constant"), exports);
21
21
  __exportStar(require("./lib/functions/add-offset.function"), exports);
22
22
  __exportStar(require("./lib/functions/camel-case.function"), exports);
23
23
  __exportStar(require("./lib/functions/convert-object-to-literal.function"), exports);
24
+ __exportStar(require("./lib/functions/format-usd.function"), exports);
24
25
  __exportStar(require("./lib/functions/from-boolean-string.function"), exports);
25
26
  __exportStar(require("./lib/functions/from-calendar-date.function"), exports);
26
27
  __exportStar(require("./lib/functions/from-csv-string.function"), exports);
28
+ __exportStar(require("./lib/functions/get-date-range-for-month.function"), exports);
29
+ __exportStar(require("./lib/functions/is-symbol.function"), exports);
30
+ __exportStar(require("./lib/functions/is-valid-date.function"), exports);
27
31
  __exportStar(require("./lib/functions/kebab-case.function"), exports);
32
+ __exportStar(require("./lib/functions/map-enum-to-array-of-values.function"), exports);
33
+ __exportStar(require("./lib/functions/map-enum-to-lookup-array.function"), exports);
34
+ __exportStar(require("./lib/functions/map-enum-to-options.function"), exports);
28
35
  __exportStar(require("./lib/functions/money.function"), exports);
29
36
  __exportStar(require("./lib/functions/parse-bool.function"), exports);
30
37
  __exportStar(require("./lib/functions/properties-to-array.function"), exports);
31
38
  __exportStar(require("./lib/functions/remove-alpha-chars.function"), exports);
39
+ __exportStar(require("./lib/functions/remove-element-at-index.function"), exports);
40
+ __exportStar(require("./lib/functions/round.function"), exports);
32
41
  __exportStar(require("./lib/functions/sleep.function"), exports);
33
42
  __exportStar(require("./lib/functions/sanitize-filename.function"), exports);
34
43
  __exportStar(require("./lib/functions/snake-case.function"), exports);
@@ -47,3 +56,4 @@ __exportStar(require("./lib/functions/words.function"), exports);
47
56
  __exportStar(require("./lib/interfaces/axios-wrapped-nest-exception.interface"), exports);
48
57
  __exportStar(require("./lib/interfaces/entity-provider.interface"), exports);
49
58
  __exportStar(require("./lib/interfaces/keys-of.type"), exports);
59
+ __exportStar(require("./lib/interfaces/lookup.interface"), exports);
@@ -0,0 +1 @@
1
+ export declare function formatUsd(rawAmount?: number | string): string;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatUsd = formatUsd;
4
+ function formatUsd(rawAmount) {
5
+ const amount = Number(rawAmount) || 0;
6
+ return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(amount);
7
+ }
@@ -0,0 +1,4 @@
1
+ export declare function getDateRangeForMonth(year: number, month: number): {
2
+ startDate: Date;
3
+ endDate: Date;
4
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDateRangeForMonth = getDateRangeForMonth;
4
+ const millis_per_day_constant_1 = require("../constants/millis-per-day.constant");
5
+ function getDateRangeForMonth(year, month) {
6
+ const startDate = new Date(+Date.UTC(year, month + -1, 0) + millis_per_day_constant_1.MILLIS_PER_DAY);
7
+ const endDate = new Date(+Date.UTC(year, month + 0, 0) + millis_per_day_constant_1.MILLIS_PER_DAY);
8
+ return { startDate, endDate };
9
+ }
@@ -0,0 +1 @@
1
+ export declare function isValidDate(dateString: string | Date): Date | undefined;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isValidDate = isValidDate;
4
+ function isValidDate(dateString) {
5
+ const date = new Date(dateString);
6
+ return (date instanceof Date && !isNaN(date.getTime())) ? date : undefined;
7
+ }
@@ -0,0 +1 @@
1
+ export declare function mapEnumToArrayOfValues(enumeration: any): any;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapEnumToArrayOfValues = mapEnumToArrayOfValues;
4
+ function mapEnumToArrayOfValues(enumeration) {
5
+ return Object.entries(enumeration).map(([key, value]) => value);
6
+ }
@@ -0,0 +1,2 @@
1
+ import { ILookup } from "../interfaces/lookup.interface";
2
+ export declare function mapEnumToLookupArray<TEnum extends object>(enumeration: TEnum): ILookup<string, string>[];
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapEnumToLookupArray = mapEnumToLookupArray;
4
+ function mapEnumToLookupArray(enumeration) {
5
+ return Object.entries(enumeration)
6
+ .map(([key, value]) => ({ value, display: key.replace(/_/g, ' ') }));
7
+ }
@@ -0,0 +1,4 @@
1
+ export declare function mapEnumToOptions<TEntity extends object>(enumeration: TEntity, includeBlank?: boolean): {
2
+ value: any;
3
+ display: string;
4
+ }[];
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapEnumToOptions = mapEnumToOptions;
4
+ function mapEnumToOptions(enumeration, includeBlank = true) {
5
+ const enumArray = Object.entries(enumeration).map(([key, value]) => ({ value, display: key.replace(/_/g, ' ') }));
6
+ return includeBlank
7
+ ? [{ display: '', value: '' }, ...enumArray]
8
+ : enumArray;
9
+ }
@@ -0,0 +1 @@
1
+ export declare function removeElementAtIndex<T>(array: T[], indexToRemove: number): T[];
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.removeElementAtIndex = removeElementAtIndex;
4
+ function removeElementAtIndex(array, indexToRemove) {
5
+ const newArray = [];
6
+ (array || []).forEach((element, index) => {
7
+ if (index !== indexToRemove) {
8
+ newArray.push(element);
9
+ }
10
+ });
11
+ return newArray;
12
+ }
@@ -0,0 +1 @@
1
+ export declare function round(numberToRound: number, scalingFactor: number): number;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.round = round;
4
+ function round(numberToRound, scalingFactor) {
5
+ const scaledServingDose = numberToRound * scalingFactor;
6
+ return Math.round(scaledServingDose) / scalingFactor;
7
+ }
@@ -0,0 +1,4 @@
1
+ export interface ILookup<TDisplay, TValue> {
2
+ display: TDisplay;
3
+ value: TValue;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,14 +5,23 @@ export * from './lib/constants/millis-per-minute.constant';
5
5
  export * from './lib/functions/add-offset.function';
6
6
  export * from './lib/functions/camel-case.function';
7
7
  export * from './lib/functions/convert-object-to-literal.function';
8
+ export * from './lib/functions/format-usd.function';
8
9
  export * from './lib/functions/from-boolean-string.function';
9
10
  export * from './lib/functions/from-calendar-date.function';
10
11
  export * from './lib/functions/from-csv-string.function';
12
+ export * from './lib/functions/get-date-range-for-month.function';
13
+ export * from './lib/functions/is-symbol.function';
14
+ export * from './lib/functions/is-valid-date.function';
11
15
  export * from './lib/functions/kebab-case.function';
16
+ export * from './lib/functions/map-enum-to-array-of-values.function';
17
+ export * from './lib/functions/map-enum-to-lookup-array.function';
18
+ export * from './lib/functions/map-enum-to-options.function';
12
19
  export * from './lib/functions/money.function';
13
20
  export * from './lib/functions/parse-bool.function';
14
21
  export * from './lib/functions/properties-to-array.function';
15
22
  export * from './lib/functions/remove-alpha-chars.function';
23
+ export * from './lib/functions/remove-element-at-index.function';
24
+ export * from './lib/functions/round.function';
16
25
  export * from './lib/functions/sleep.function';
17
26
  export * from './lib/functions/sanitize-filename.function';
18
27
  export * from './lib/functions/snake-case.function';
@@ -31,3 +40,4 @@ export * from './lib/functions/words.function';
31
40
  export * from './lib/interfaces/axios-wrapped-nest-exception.interface';
32
41
  export * from './lib/interfaces/entity-provider.interface';
33
42
  export * from './lib/interfaces/keys-of.type';
43
+ export * from './lib/interfaces/lookup.interface';
package/dist/esm/index.js CHANGED
@@ -21,14 +21,23 @@ __exportStar(require("./lib/constants/millis-per-minute.constant"), exports);
21
21
  __exportStar(require("./lib/functions/add-offset.function"), exports);
22
22
  __exportStar(require("./lib/functions/camel-case.function"), exports);
23
23
  __exportStar(require("./lib/functions/convert-object-to-literal.function"), exports);
24
+ __exportStar(require("./lib/functions/format-usd.function"), exports);
24
25
  __exportStar(require("./lib/functions/from-boolean-string.function"), exports);
25
26
  __exportStar(require("./lib/functions/from-calendar-date.function"), exports);
26
27
  __exportStar(require("./lib/functions/from-csv-string.function"), exports);
28
+ __exportStar(require("./lib/functions/get-date-range-for-month.function"), exports);
29
+ __exportStar(require("./lib/functions/is-symbol.function"), exports);
30
+ __exportStar(require("./lib/functions/is-valid-date.function"), exports);
27
31
  __exportStar(require("./lib/functions/kebab-case.function"), exports);
32
+ __exportStar(require("./lib/functions/map-enum-to-array-of-values.function"), exports);
33
+ __exportStar(require("./lib/functions/map-enum-to-lookup-array.function"), exports);
34
+ __exportStar(require("./lib/functions/map-enum-to-options.function"), exports);
28
35
  __exportStar(require("./lib/functions/money.function"), exports);
29
36
  __exportStar(require("./lib/functions/parse-bool.function"), exports);
30
37
  __exportStar(require("./lib/functions/properties-to-array.function"), exports);
31
38
  __exportStar(require("./lib/functions/remove-alpha-chars.function"), exports);
39
+ __exportStar(require("./lib/functions/remove-element-at-index.function"), exports);
40
+ __exportStar(require("./lib/functions/round.function"), exports);
32
41
  __exportStar(require("./lib/functions/sleep.function"), exports);
33
42
  __exportStar(require("./lib/functions/sanitize-filename.function"), exports);
34
43
  __exportStar(require("./lib/functions/snake-case.function"), exports);
@@ -47,3 +56,4 @@ __exportStar(require("./lib/functions/words.function"), exports);
47
56
  __exportStar(require("./lib/interfaces/axios-wrapped-nest-exception.interface"), exports);
48
57
  __exportStar(require("./lib/interfaces/entity-provider.interface"), exports);
49
58
  __exportStar(require("./lib/interfaces/keys-of.type"), exports);
59
+ __exportStar(require("./lib/interfaces/lookup.interface"), exports);
@@ -0,0 +1 @@
1
+ export declare function formatUsd(rawAmount?: number | string): string;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatUsd = formatUsd;
4
+ function formatUsd(rawAmount) {
5
+ const amount = Number(rawAmount) || 0;
6
+ return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(amount);
7
+ }
@@ -0,0 +1,4 @@
1
+ export declare function getDateRangeForMonth(year: number, month: number): {
2
+ startDate: Date;
3
+ endDate: Date;
4
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDateRangeForMonth = getDateRangeForMonth;
4
+ const millis_per_day_constant_1 = require("../constants/millis-per-day.constant");
5
+ function getDateRangeForMonth(year, month) {
6
+ const startDate = new Date(+Date.UTC(year, month + -1, 0) + millis_per_day_constant_1.MILLIS_PER_DAY);
7
+ const endDate = new Date(+Date.UTC(year, month + 0, 0) + millis_per_day_constant_1.MILLIS_PER_DAY);
8
+ return { startDate, endDate };
9
+ }
@@ -0,0 +1 @@
1
+ export declare function isValidDate(dateString: string | Date): Date | undefined;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isValidDate = isValidDate;
4
+ function isValidDate(dateString) {
5
+ const date = new Date(dateString);
6
+ return (date instanceof Date && !isNaN(date.getTime())) ? date : undefined;
7
+ }
@@ -0,0 +1 @@
1
+ export declare function mapEnumToArrayOfValues(enumeration: any): any;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapEnumToArrayOfValues = mapEnumToArrayOfValues;
4
+ function mapEnumToArrayOfValues(enumeration) {
5
+ return Object.entries(enumeration).map(([key, value]) => value);
6
+ }
@@ -0,0 +1,2 @@
1
+ import { ILookup } from "../interfaces/lookup.interface";
2
+ export declare function mapEnumToLookupArray<TEnum extends object>(enumeration: TEnum): ILookup<string, string>[];
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapEnumToLookupArray = mapEnumToLookupArray;
4
+ function mapEnumToLookupArray(enumeration) {
5
+ return Object.entries(enumeration)
6
+ .map(([key, value]) => ({ value, display: key.replace(/_/g, ' ') }));
7
+ }
@@ -0,0 +1,4 @@
1
+ export declare function mapEnumToOptions<TEntity extends object>(enumeration: TEntity, includeBlank?: boolean): {
2
+ value: any;
3
+ display: string;
4
+ }[];
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapEnumToOptions = mapEnumToOptions;
4
+ function mapEnumToOptions(enumeration, includeBlank = true) {
5
+ const enumArray = Object.entries(enumeration).map(([key, value]) => ({ value, display: key.replace(/_/g, ' ') }));
6
+ return includeBlank
7
+ ? [{ display: '', value: '' }, ...enumArray]
8
+ : enumArray;
9
+ }
@@ -0,0 +1 @@
1
+ export declare function removeElementAtIndex<T>(array: T[], indexToRemove: number): T[];
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.removeElementAtIndex = removeElementAtIndex;
4
+ function removeElementAtIndex(array, indexToRemove) {
5
+ const newArray = [];
6
+ (array || []).forEach((element, index) => {
7
+ if (index !== indexToRemove) {
8
+ newArray.push(element);
9
+ }
10
+ });
11
+ return newArray;
12
+ }
@@ -0,0 +1 @@
1
+ export declare function round(numberToRound: number, scalingFactor: number): number;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.round = round;
4
+ function round(numberToRound, scalingFactor) {
5
+ const scaledServingDose = numberToRound * scalingFactor;
6
+ return Math.round(scaledServingDose) / scalingFactor;
7
+ }
@@ -0,0 +1,4 @@
1
+ export interface ILookup<TDisplay, TValue> {
2
+ display: TDisplay;
3
+ value: TValue;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,14 +5,23 @@ export * from './lib/constants/millis-per-minute.constant';
5
5
  export * from './lib/functions/add-offset.function';
6
6
  export * from './lib/functions/camel-case.function';
7
7
  export * from './lib/functions/convert-object-to-literal.function';
8
+ export * from './lib/functions/format-usd.function';
8
9
  export * from './lib/functions/from-boolean-string.function';
9
10
  export * from './lib/functions/from-calendar-date.function';
10
11
  export * from './lib/functions/from-csv-string.function';
12
+ export * from './lib/functions/get-date-range-for-month.function';
13
+ export * from './lib/functions/is-symbol.function';
14
+ export * from './lib/functions/is-valid-date.function';
11
15
  export * from './lib/functions/kebab-case.function';
16
+ export * from './lib/functions/map-enum-to-array-of-values.function';
17
+ export * from './lib/functions/map-enum-to-lookup-array.function';
18
+ export * from './lib/functions/map-enum-to-options.function';
12
19
  export * from './lib/functions/money.function';
13
20
  export * from './lib/functions/parse-bool.function';
14
21
  export * from './lib/functions/properties-to-array.function';
15
22
  export * from './lib/functions/remove-alpha-chars.function';
23
+ export * from './lib/functions/remove-element-at-index.function';
24
+ export * from './lib/functions/round.function';
16
25
  export * from './lib/functions/sleep.function';
17
26
  export * from './lib/functions/sanitize-filename.function';
18
27
  export * from './lib/functions/snake-case.function';
@@ -31,3 +40,4 @@ export * from './lib/functions/words.function';
31
40
  export * from './lib/interfaces/axios-wrapped-nest-exception.interface';
32
41
  export * from './lib/interfaces/entity-provider.interface';
33
42
  export * from './lib/interfaces/keys-of.type';
43
+ export * from './lib/interfaces/lookup.interface';
@@ -0,0 +1 @@
1
+ export declare function formatUsd(rawAmount?: number | string): string;
@@ -0,0 +1,4 @@
1
+ export declare function getDateRangeForMonth(year: number, month: number): {
2
+ startDate: Date;
3
+ endDate: Date;
4
+ };
@@ -0,0 +1 @@
1
+ export declare function isValidDate(dateString: string | Date): Date | undefined;
@@ -0,0 +1 @@
1
+ export declare function mapEnumToArrayOfValues(enumeration: any): any;
@@ -0,0 +1,2 @@
1
+ import { ILookup } from "../interfaces/lookup.interface";
2
+ export declare function mapEnumToLookupArray<TEnum extends object>(enumeration: TEnum): ILookup<string, string>[];
@@ -0,0 +1,4 @@
1
+ export declare function mapEnumToOptions<TEntity extends object>(enumeration: TEntity, includeBlank?: boolean): {
2
+ value: any;
3
+ display: string;
4
+ }[];
@@ -0,0 +1 @@
1
+ export declare function removeElementAtIndex<T>(array: T[], indexToRemove: number): T[];
@@ -0,0 +1 @@
1
+ export declare function round(numberToRound: number, scalingFactor: number): number;
@@ -0,0 +1,4 @@
1
+ export interface ILookup<TDisplay, TValue> {
2
+ display: TDisplay;
3
+ value: TValue;
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onivoro/isomorphic-common",
3
- "version": "22.0.3",
3
+ "version": "22.0.5",
4
4
  "repository": {
5
5
  "url": "git+https://github.com/onivoro/isomorphic-common.git"
6
6
  },