@sparted/shared-library 1.8.1 → 1.9.2
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/business/types/score.d.ts +1 -1
- package/business/types/score.js.map +1 -1
- package/date/get-iso-day-number.d.ts +1 -0
- package/date/get-iso-day-number.js +8 -0
- package/date/get-iso-day-number.js.map +1 -0
- package/date/get-start-of-day.d.ts +1 -0
- package/date/get-start-of-day.js +6 -0
- package/date/get-start-of-day.js.map +1 -1
- package/date/index.d.ts +1 -0
- package/date/index.js +3 -0
- package/date/index.js.map +1 -1
- package/index.js +3 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"score.js","sources":["../../../src/business/types/score.ts"],"sourcesContent":["export type Points = {\n question: number;\n chrono: number;\n bonus: number;\n};\n\nexport type LiveCampaignPoints = {\n question: number;\n chrono: number;\n bonus: number;\n adaptive: number;\n};\n\nexport type Stars = {\n question: number;\n chrono: number;\n bonus: number;\n};\n\nexport type Streaks = {\n totalPoints: number;\n streaksCount: number;\n streaksCountHistory: number[];\n};\n\nexport type Timer = {\n timespent: number;\n timeout: boolean;\n};\n\nexport type BaseScore = {\n id?: number;\n playerId: number;\n contentId: number;\n points: Points;\n timer: Timer;\n createdAt: Date;\n};\n\nexport type CampaignScore = BaseScore & {\n points: LiveCampaignPoints;\n campaignId: number;\n campaignContentId: number;\n sessionNumber?: number; // TODO: should be required after conversion\n};\n\nexport type WikiScore = BaseScore & {\n wikiId: number;\n campaignContentId: number;\n sessionNumber?: number;\n};\n\nexport type BattleScore = BaseScore & {\n battleId: number;\n};\n\nexport type Score = CampaignScore | WikiScore | BattleScore;\n\nexport const isCampaignScore = (score: Score): score is CampaignScore => 'campaignId' in score;\nexport const isWikiScore = (score: Score): score is WikiScore => 'wikiId' in score;\nexport const isBattleScore = (score: Score): score is BattleScore => 'battleId' in score;\n"],"names":[],"mappings":";;;;AA0DO,MAAM,eAAe,GAAG,CAAC,KAAY,KAA6B,YAAY,IAAI,MAAM;AACxF,MAAM,WAAW,GAAG,CAAC,KAAY,KAAyB,QAAQ,IAAI,MAAM;AAC5E,MAAM,aAAa,GAAG,CAAC,KAAY,KAA2B,UAAU,IAAI;;;;;;"}
|
|
1
|
+
{"version":3,"file":"score.js","sources":["../../../src/business/types/score.ts"],"sourcesContent":["export type Points = {\n question: number;\n chrono: number;\n bonus: number;\n};\n\nexport type LiveCampaignPoints = {\n question: number;\n chrono: number;\n bonus: number;\n adaptive: number | null;\n};\n\nexport type Stars = {\n question: number;\n chrono: number;\n bonus: number;\n};\n\nexport type Streaks = {\n totalPoints: number;\n streaksCount: number;\n streaksCountHistory: number[];\n};\n\nexport type Timer = {\n timespent: number;\n timeout: boolean;\n};\n\nexport type BaseScore = {\n id?: number;\n playerId: number;\n contentId: number;\n points: Points;\n timer: Timer;\n createdAt: Date;\n};\n\nexport type CampaignScore = BaseScore & {\n points: LiveCampaignPoints;\n campaignId: number;\n campaignContentId: number;\n sessionNumber?: number; // TODO: should be required after conversion\n};\n\nexport type WikiScore = BaseScore & {\n wikiId: number;\n campaignContentId: number;\n sessionNumber?: number;\n};\n\nexport type BattleScore = BaseScore & {\n battleId: number;\n};\n\nexport type Score = CampaignScore | WikiScore | BattleScore;\n\nexport const isCampaignScore = (score: Score): score is CampaignScore => 'campaignId' in score;\nexport const isWikiScore = (score: Score): score is WikiScore => 'wikiId' in score;\nexport const isBattleScore = (score: Score): score is BattleScore => 'battleId' in score;\n"],"names":[],"mappings":";;;;AA0DO,MAAM,eAAe,GAAG,CAAC,KAAY,KAA6B,YAAY,IAAI,MAAM;AACxF,MAAM,WAAW,GAAG,CAAC,KAAY,KAAyB,QAAQ,IAAI,MAAM;AAC5E,MAAM,aAAa,GAAG,CAAC,KAAY,KAA2B,UAAU,IAAI;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getIsoDayNumber: (date?: Date) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-iso-day-number.js","sources":["../../src/date/get-iso-day-number.ts"],"sourcesContent":["export const getIsoDayNumber = (date = new Date()) => ((date.getDay() + 6) % 7) + 1;\n"],"names":[],"mappings":";;;;AAAa,MAAA,eAAe,GAAG,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI;;;;"}
|
package/date/get-start-of-day.js
CHANGED
|
@@ -6,7 +6,13 @@ const startOfDay = (date) => {
|
|
|
6
6
|
const d = new Date(date);
|
|
7
7
|
d.setUTCHours(0, 0, 0, 0);
|
|
8
8
|
return d;
|
|
9
|
+
};
|
|
10
|
+
const startOfDayLocal = (date) => {
|
|
11
|
+
const d = new Date(date);
|
|
12
|
+
d.setHours(0, 0, 0, 0);
|
|
13
|
+
return d;
|
|
9
14
|
};
|
|
10
15
|
|
|
11
16
|
exports.startOfDay = startOfDay;
|
|
17
|
+
exports.startOfDayLocal = startOfDayLocal;
|
|
12
18
|
//# sourceMappingURL=get-start-of-day.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-start-of-day.js","sources":["../../src/date/get-start-of-day.ts"],"sourcesContent":["export const startOfDay = (date: Date) => {\n const d = new Date(date);\n d.setUTCHours(0, 0, 0, 0);\n return d;\n};\n"],"names":[],"mappings":";;;;AAAa,MAAA,UAAU,GAAG,CAAC,IAAU,KAAI;AACvC,IAAA,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1B,IAAA,OAAO,CAAC,CAAC;AACX
|
|
1
|
+
{"version":3,"file":"get-start-of-day.js","sources":["../../src/date/get-start-of-day.ts"],"sourcesContent":["export const startOfDay = (date: Date) => {\n const d = new Date(date);\n d.setUTCHours(0, 0, 0, 0);\n return d;\n};\n\nexport const startOfDayLocal = (date: Date) => {\n const d = new Date(date);\n d.setHours(0, 0, 0, 0);\n return d;\n};\n"],"names":[],"mappings":";;;;AAAa,MAAA,UAAU,GAAG,CAAC,IAAU,KAAI;AACvC,IAAA,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1B,IAAA,OAAO,CAAC,CAAC;AACX,EAAE;AAEW,MAAA,eAAe,GAAG,CAAC,IAAU,KAAI;AAC5C,IAAA,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACvB,IAAA,OAAO,CAAC,CAAC;AACX;;;;;"}
|
package/date/index.d.ts
CHANGED
package/date/index.js
CHANGED
|
@@ -11,6 +11,7 @@ var differenceInDays = require('./difference-in-days.js');
|
|
|
11
11
|
var addDays = require('./add-days.js');
|
|
12
12
|
var getStartOfDay = require('./get-start-of-day.js');
|
|
13
13
|
var toUtcDateString = require('./to-utc-date-string.js');
|
|
14
|
+
var getIsoDayNumber = require('./get-iso-day-number.js');
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
|
|
@@ -23,5 +24,7 @@ exports.shiftDateBy = shiftDateBy.shiftDateBy;
|
|
|
23
24
|
exports.differenceInDays = differenceInDays.differenceInDays;
|
|
24
25
|
exports.addDays = addDays.addDays;
|
|
25
26
|
exports.startOfDay = getStartOfDay.startOfDay;
|
|
27
|
+
exports.startOfDayLocal = getStartOfDay.startOfDayLocal;
|
|
26
28
|
exports.toUTCDateString = toUtcDateString.toUTCDateString;
|
|
29
|
+
exports.getIsoDayNumber = getIsoDayNumber.getIsoDayNumber;
|
|
27
30
|
//# sourceMappingURL=index.js.map
|
package/date/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/index.js
CHANGED
|
@@ -57,6 +57,7 @@ var differenceInDays = require('./date/difference-in-days.js');
|
|
|
57
57
|
var addDays = require('./date/add-days.js');
|
|
58
58
|
var getStartOfDay = require('./date/get-start-of-day.js');
|
|
59
59
|
var toUtcDateString = require('./date/to-utc-date-string.js');
|
|
60
|
+
var getIsoDayNumber = require('./date/get-iso-day-number.js');
|
|
60
61
|
|
|
61
62
|
|
|
62
63
|
|
|
@@ -152,5 +153,7 @@ exports.shiftDateBy = shiftDateBy.shiftDateBy;
|
|
|
152
153
|
exports.differenceInDays = differenceInDays.differenceInDays;
|
|
153
154
|
exports.addDays = addDays.addDays;
|
|
154
155
|
exports.startOfDay = getStartOfDay.startOfDay;
|
|
156
|
+
exports.startOfDayLocal = getStartOfDay.startOfDayLocal;
|
|
155
157
|
exports.toUTCDateString = toUtcDateString.toUTCDateString;
|
|
158
|
+
exports.getIsoDayNumber = getIsoDayNumber.getIsoDayNumber;
|
|
156
159
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|