turf-common 1.2.1-beta.47 → 1.2.1-beta.48

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.
@@ -43,5 +43,12 @@ export declare class TurfAvailability implements ITurfAvailability {
43
43
  getTotalTime(): number;
44
44
  getCode(): string;
45
45
  parse(): void;
46
+ static parse(eventCode: string): {
47
+ pitchIdCodes: string[];
48
+ startDateCode: string;
49
+ endDateCode: string;
50
+ fromTimeCode: string;
51
+ toTimeCode: string;
52
+ };
46
53
  }
47
54
  export {};
@@ -187,6 +187,18 @@ var TurfAvailability = /** @class */ (function () {
187
187
  this.fromTimeCode = timeCodeRange.slice(0, 4);
188
188
  this.toTimeCode = timeCodeRange.slice(4, 8);
189
189
  };
190
+ TurfAvailability.parse = function (eventCode) {
191
+ var eventCodes = eventCode.split("#");
192
+ var dateCodeRange = eventCodes[1];
193
+ var timeCodeRange = eventCodes[2];
194
+ return {
195
+ pitchIdCodes: eventCodes[3].split(",").map(function (id) { return id.padStart(2, "0"); }),
196
+ startDateCode: dateCodeRange.slice(0, 6),
197
+ endDateCode: dateCodeRange.slice(6, 12),
198
+ fromTimeCode: timeCodeRange.slice(0, 4),
199
+ toTimeCode: timeCodeRange.slice(4, 8),
200
+ };
201
+ };
190
202
  return TurfAvailability;
191
203
  }());
192
204
  exports.TurfAvailability = TurfAvailability;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turf-common",
3
- "version": "1.2.1-beta.47",
3
+ "version": "1.2.1-beta.48",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",