create-filegrc 0.21.12 → 0.21.14
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/package.json +1 -1
- package/src/defaults.js +13 -1
- package/src/index.js +2 -2
- package/template/package.json +1 -1
package/package.json
CHANGED
package/src/defaults.js
CHANGED
|
@@ -1133,7 +1133,7 @@ export function baselineRecordFiles(effectiveDate, starter = "security") {
|
|
|
1133
1133
|
obligationId: obligation.id,
|
|
1134
1134
|
activityDefinitionVersion: "1",
|
|
1135
1135
|
recurrence: obligation.recurrence.mode === "calendar"
|
|
1136
|
-
? { ...obligation.recurrence, anchorDate: effectiveDate }
|
|
1136
|
+
? { ...obligation.recurrence, anchorDate: starterCalendarAnchor(obligation.recurrence, effectiveDate) }
|
|
1137
1137
|
: obligation.recurrence,
|
|
1138
1138
|
...(obligation.window ? { window: obligation.window } : {}),
|
|
1139
1139
|
...(starterObligationSelector(obligation.id) ? { selector: starterObligationSelector(obligation.id), completionCoverage: "point-in-time" } : {}),
|
|
@@ -1256,6 +1256,18 @@ function calendar(unit, interval, anchorDate) {
|
|
|
1256
1256
|
};
|
|
1257
1257
|
}
|
|
1258
1258
|
|
|
1259
|
+
function starterCalendarAnchor(recurrence, effectiveDate) {
|
|
1260
|
+
if (recurrence.anchorDate) return recurrence.anchorDate;
|
|
1261
|
+
if (recurrence.anchorMode === "activation" || recurrence.unit !== "month") return effectiveDate;
|
|
1262
|
+
if (recurrence.interval === 1) return `${effectiveDate.slice(0, 7)}-01`;
|
|
1263
|
+
if (recurrence.interval === 3) {
|
|
1264
|
+
const month = Number(effectiveDate.slice(5, 7));
|
|
1265
|
+
const quarterMonth = Math.floor((month - 1) / 3) * 3 + 1;
|
|
1266
|
+
return `${effectiveDate.slice(0, 4)}-${String(quarterMonth).padStart(2, "0")}-01`;
|
|
1267
|
+
}
|
|
1268
|
+
return effectiveDate;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1259
1271
|
function event(eventType) {
|
|
1260
1272
|
return { mode: "event", eventType };
|
|
1261
1273
|
}
|
package/src/index.js
CHANGED
|
@@ -524,13 +524,13 @@ async function runCombinedSetup(target, input) {
|
|
|
524
524
|
async function writeMinimalLockfile(target, name, versionRange) {
|
|
525
525
|
const lock = {
|
|
526
526
|
name,
|
|
527
|
-
version: "0.21.
|
|
527
|
+
version: "0.21.14",
|
|
528
528
|
lockfileVersion: 3,
|
|
529
529
|
requires: true,
|
|
530
530
|
packages: {
|
|
531
531
|
"": {
|
|
532
532
|
name,
|
|
533
|
-
version: "0.21.
|
|
533
|
+
version: "0.21.14",
|
|
534
534
|
dependencies: { filegrc: versionRange }
|
|
535
535
|
}
|
|
536
536
|
}
|