@dereekb/util 9.20.18 → 9.20.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [9.20.20](https://github.com/dereekb/dbx-components/compare/v9.20.19-dev...v9.20.20) (2023-01-23)
6
+
7
+
8
+
9
+ ## [9.20.19](https://github.com/dereekb/dbx-components/compare/v9.20.18-dev...v9.20.19) (2023-01-17)
10
+
11
+
12
+
5
13
  ## [9.20.18](https://github.com/dereekb/dbx-components/compare/v9.20.17-dev...v9.20.18) (2023-01-08)
6
14
 
7
15
 
@@ -2,6 +2,14 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [9.20.20](https://github.com/dereekb/dbx-components/compare/v9.20.19-dev...v9.20.20) (2023-01-23)
6
+
7
+
8
+
9
+ ## [9.20.19](https://github.com/dereekb/dbx-components/compare/v9.20.18-dev...v9.20.19) (2023-01-17)
10
+
11
+
12
+
5
13
  ## [9.20.18](https://github.com/dereekb/dbx-components/compare/v9.20.17-dev...v9.20.18) (2023-01-08)
6
14
 
7
15
 
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@dereekb/util/fetch",
3
- "version": "9.20.18",
3
+ "version": "9.20.20",
4
4
  "main": "./src/index.js",
5
5
  "types": "./src/index.d.ts",
6
6
  "dependencies": {},
7
7
  "peerDependencies": {
8
- "@dereekb/util": "9.20.18",
8
+ "@dereekb/util": "9.20.20",
9
9
  "lodash.isequal": "^4.5.0",
10
10
  "make-error": "^1.3.0",
11
11
  "class-validator": "^0.13.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/util",
3
- "version": "9.20.18",
3
+ "version": "9.20.20",
4
4
  "type": "commonjs",
5
5
  "exports": {
6
6
  ".": {
@@ -48,6 +48,17 @@ export declare type ISO8601DayString = string;
48
48
  */
49
49
  export declare const ISO8601_DAY_STRING_REGEX: RegExp;
50
50
  export declare function isISO8601DayString(input: string): input is ISO8601DayString;
51
+ /**
52
+ * Date that is represented by slashes. Is considered in the Month/Day/Year format.
53
+ */
54
+ export declare type MonthDaySlashDate = string;
55
+ /**
56
+ * Converts the input MonthDaySlashDate to an ISO8601DayString.
57
+ *
58
+ * @param slashDate
59
+ * @returns
60
+ */
61
+ export declare function monthDaySlashDateToDateString(slashDate: MonthDaySlashDate): ISO8601DayString;
51
62
  /**
52
63
  * Time in seconds (instead of ms) since the epoch.
53
64
  */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MS_IN_DAY = exports.MS_IN_HOUR = exports.MS_IN_MINUTE = exports.MINUTES_IN_HOUR = exports.MINUTES_IN_DAY = exports.isISO8601DayString = exports.ISO8601_DAY_STRING_REGEX = exports.isConsideredUtcTimezoneString = exports.UTC_TIMEZONE_STRING = void 0;
3
+ exports.MS_IN_DAY = exports.MS_IN_HOUR = exports.MS_IN_MINUTE = exports.MINUTES_IN_HOUR = exports.MINUTES_IN_DAY = exports.monthDaySlashDateToDateString = exports.isISO8601DayString = exports.ISO8601_DAY_STRING_REGEX = exports.isConsideredUtcTimezoneString = exports.UTC_TIMEZONE_STRING = void 0;
4
4
  exports.UTC_TIMEZONE_STRING = 'UTC';
5
5
  function isConsideredUtcTimezoneString(timezone) {
6
6
  return timezone == null || timezone === exports.UTC_TIMEZONE_STRING;
@@ -14,6 +14,27 @@ function isISO8601DayString(input) {
14
14
  return exports.ISO8601_DAY_STRING_REGEX.test(input);
15
15
  }
16
16
  exports.isISO8601DayString = isISO8601DayString;
17
+ /**
18
+ * Converts the input MonthDaySlashDate to an ISO8601DayString.
19
+ *
20
+ * @param slashDate
21
+ * @returns
22
+ */
23
+ function monthDaySlashDateToDateString(slashDate) {
24
+ let [month, day, year] = slashDate.split('/');
25
+ if (month.length === 1) {
26
+ month = `0${month}`;
27
+ }
28
+ if (day.length === 1) {
29
+ day = `0${day}`;
30
+ }
31
+ if (year.length === 2) {
32
+ year = `20${year}`;
33
+ }
34
+ const result = `${year}-${month}-${day}`;
35
+ return result;
36
+ }
37
+ exports.monthDaySlashDateToDateString = monthDaySlashDateToDateString;
17
38
  exports.MINUTES_IN_DAY = 1440;
18
39
  exports.MINUTES_IN_HOUR = 60;
19
40
  exports.MS_IN_MINUTE = 1000 * 60;
@@ -1 +1 @@
1
- {"version":3,"file":"date.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/date/date.ts"],"names":[],"mappings":";;;AA0Ba,QAAA,mBAAmB,GAAG,KAAK,CAAC;AAazC,SAAgB,6BAA6B,CAAC,QAA+B;IAC3E,OAAO,QAAQ,IAAI,IAAI,IAAI,QAAQ,KAAK,2BAAmB,CAAC;AAC9D,CAAC;AAFD,sEAEC;AAgBD;;GAEG;AACU,QAAA,wBAAwB,GAAG,qBAAqB,CAAC;AAE9D,SAAgB,kBAAkB,CAAC,KAAa;IAC9C,OAAO,gCAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC9C,CAAC;AAFD,gDAEC;AAkBY,QAAA,cAAc,GAAG,IAAI,CAAC;AACtB,QAAA,eAAe,GAAG,EAAE,CAAC;AACrB,QAAA,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC;AACzB,QAAA,UAAU,GAAG,oBAAY,GAAG,EAAE,CAAC;AAC/B,QAAA,SAAS,GAAG,kBAAU,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"date.js","sourceRoot":"","sources":["../../../../../../packages/util/src/lib/date/date.ts"],"names":[],"mappings":";;;AA0Ba,QAAA,mBAAmB,GAAG,KAAK,CAAC;AAazC,SAAgB,6BAA6B,CAAC,QAA+B;IAC3E,OAAO,QAAQ,IAAI,IAAI,IAAI,QAAQ,KAAK,2BAAmB,CAAC;AAC9D,CAAC;AAFD,sEAEC;AAgBD;;GAEG;AACU,QAAA,wBAAwB,GAAG,qBAAqB,CAAC;AAE9D,SAAgB,kBAAkB,CAAC,KAAa;IAC9C,OAAO,gCAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC9C,CAAC;AAFD,gDAEC;AAOD;;;;;GAKG;AACH,SAAgB,6BAA6B,CAAC,SAA4B;IACxE,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE9C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACtB,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC;KACrB;IAED,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;KACjB;IAED,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;KACpB;IAED,MAAM,MAAM,GAAG,GAAG,IAAI,IAAI,KAAK,IAAI,GAAG,EAAE,CAAC;IACzC,OAAO,MAAM,CAAC;AAChB,CAAC;AAjBD,sEAiBC;AAkBY,QAAA,cAAc,GAAG,IAAI,CAAC;AACtB,QAAA,eAAe,GAAG,EAAE,CAAC;AACrB,QAAA,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC;AACzB,QAAA,UAAU,GAAG,oBAAY,GAAG,EAAE,CAAC;AAC/B,QAAA,SAAS,GAAG,kBAAU,GAAG,EAAE,CAAC"}
package/test/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [9.20.20](https://github.com/dereekb/dbx-components/compare/v9.20.19-dev...v9.20.20) (2023-01-23)
6
+
7
+
8
+
9
+ ## [9.20.19](https://github.com/dereekb/dbx-components/compare/v9.20.18-dev...v9.20.19) (2023-01-17)
10
+
11
+
12
+
5
13
  ## [9.20.18](https://github.com/dereekb/dbx-components/compare/v9.20.17-dev...v9.20.18) (2023-01-08)
6
14
 
7
15
 
package/test/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@dereekb/util/test",
3
- "version": "9.20.18",
3
+ "version": "9.20.20",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
7
7
  "dependencies": {},
8
8
  "peerDependencies": {
9
- "@dereekb/util": "9.20.18",
9
+ "@dereekb/util": "9.20.20",
10
10
  "lodash.isequal": "^4.5.0",
11
11
  "make-error": "^1.3.0",
12
12
  "class-validator": "^0.13.2",