@tricoteuses/assemblee 2.5.3 → 2.5.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.
- package/lib/loaders.js +35 -42
- package/package.json +1 -1
package/lib/loaders.js
CHANGED
|
@@ -752,25 +752,18 @@ function* z(t, s, e, r, l, d = "json", { enriched: _ = !1, log: j = !1, noValida
|
|
|
752
752
|
_ ? "_enrichi" : "_nettoye"
|
|
753
753
|
)
|
|
754
754
|
);
|
|
755
|
-
for (const
|
|
756
|
-
if (!
|
|
755
|
+
for (const D of P(x, l)) {
|
|
756
|
+
if (!D[D.length - 1].endsWith(".json"))
|
|
757
757
|
continue;
|
|
758
|
-
const
|
|
759
|
-
j && console.log(`Loading file: ${
|
|
760
|
-
let
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
} catch (p) {
|
|
764
|
-
console.warn(
|
|
765
|
-
`[iterLoadAssembleeItems] skipped invalid JSON: ${D} (${p.message})`
|
|
766
|
-
);
|
|
767
|
-
continue;
|
|
768
|
-
}
|
|
769
|
-
F.has(X.uid) || (F.add(X.uid), yield {
|
|
758
|
+
const X = i.join(x, ...D);
|
|
759
|
+
j && console.log(`Loading file: ${X}…`);
|
|
760
|
+
let V = n.readFileSync(X, { encoding: "utf8" });
|
|
761
|
+
const $ = y ? JSON.parse(V) : r(V);
|
|
762
|
+
F.has($.uid) || (F.add($.uid), yield {
|
|
770
763
|
datasetLegislature: v.legislature,
|
|
771
|
-
filePath:
|
|
772
|
-
item:
|
|
773
|
-
},
|
|
764
|
+
filePath: X,
|
|
765
|
+
item: $
|
|
766
|
+
}, V = null);
|
|
774
767
|
}
|
|
775
768
|
}
|
|
776
769
|
F.clear();
|
|
@@ -1026,7 +1019,7 @@ function ve(t, s, e, { enriched: r = !1, log: l = !1 } = {}) {
|
|
|
1026
1019
|
v[f.uid] === void 0 && (v[f.uid] = f);
|
|
1027
1020
|
}
|
|
1028
1021
|
}
|
|
1029
|
-
const b = {}, x = {},
|
|
1022
|
+
const b = {}, x = {}, D = {}, O = {};
|
|
1030
1023
|
if (s & I.DossiersLegislatifs)
|
|
1031
1024
|
for (const o of A.dossiersLegislatifs) {
|
|
1032
1025
|
if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
|
|
@@ -1053,10 +1046,10 @@ function ve(t, s, e, { enriched: r = !1, log: l = !1 } = {}) {
|
|
|
1053
1046
|
const S = n.readFileSync(g, {
|
|
1054
1047
|
encoding: "utf8"
|
|
1055
1048
|
}), f = R.toDossierParlementaire(S), L = f.titreDossier;
|
|
1056
|
-
L.senatChemin && x[L.senatChemin] === void 0 && (x[L.senatChemin] = f), L.titreChemin &&
|
|
1049
|
+
L.senatChemin && x[L.senatChemin] === void 0 && (x[L.senatChemin] = f), L.titreChemin && D[L.titreChemin] === void 0 && (D[L.titreChemin] = f), O[f.uid] === void 0 && (O[f.uid] = f);
|
|
1057
1050
|
}
|
|
1058
1051
|
}
|
|
1059
|
-
let
|
|
1052
|
+
let X = {};
|
|
1060
1053
|
if (s & I.Photos) {
|
|
1061
1054
|
{
|
|
1062
1055
|
const o = i.join(
|
|
@@ -1068,7 +1061,7 @@ function ve(t, s, e, { enriched: r = !1, log: l = !1 } = {}) {
|
|
|
1068
1061
|
if (n.existsSync(o)) {
|
|
1069
1062
|
l && console.log(`Loading file: ${o}`);
|
|
1070
1063
|
const m = n.readFileSync(o, { encoding: "utf8" });
|
|
1071
|
-
Object.assign(
|
|
1064
|
+
Object.assign(X, JSON.parse(m));
|
|
1072
1065
|
} else l && console.log(`Ignoring missing file: ${o}`);
|
|
1073
1066
|
}
|
|
1074
1067
|
{
|
|
@@ -1080,11 +1073,11 @@ function ve(t, s, e, { enriched: r = !1, log: l = !1 } = {}) {
|
|
|
1080
1073
|
if (n.existsSync(o)) {
|
|
1081
1074
|
l && console.log(`Loading file: ${o}`);
|
|
1082
1075
|
const m = n.readFileSync(o, { encoding: "utf8" });
|
|
1083
|
-
Object.assign(
|
|
1076
|
+
Object.assign(X, JSON.parse(m));
|
|
1084
1077
|
} else l && console.log(`Ignoring missing file: ${o}`);
|
|
1085
1078
|
}
|
|
1086
1079
|
}
|
|
1087
|
-
const
|
|
1080
|
+
const V = {};
|
|
1088
1081
|
if (s & I.Scrutins)
|
|
1089
1082
|
for (const o of A.scrutins) {
|
|
1090
1083
|
if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
|
|
@@ -1101,10 +1094,10 @@ function ve(t, s, e, { enriched: r = !1, log: l = !1 } = {}) {
|
|
|
1101
1094
|
const S = n.readFileSync(g, {
|
|
1102
1095
|
encoding: "utf8"
|
|
1103
1096
|
}), f = Z.toScrutin(S);
|
|
1104
|
-
|
|
1097
|
+
V[f.uid] === void 0 && (V[f.uid] = f);
|
|
1105
1098
|
}
|
|
1106
1099
|
}
|
|
1107
|
-
const
|
|
1100
|
+
const $ = {};
|
|
1108
1101
|
if (s & I.Questions)
|
|
1109
1102
|
for (const o of A.questions) {
|
|
1110
1103
|
if (o.ignoreForWeb || e !== a.All && o.legislature !== a.All && e !== o.legislature)
|
|
@@ -1121,7 +1114,7 @@ function ve(t, s, e, { enriched: r = !1, log: l = !1 } = {}) {
|
|
|
1121
1114
|
const S = n.readFileSync(g, {
|
|
1122
1115
|
encoding: "utf8"
|
|
1123
1116
|
}), f = B.toQuestion(S);
|
|
1124
|
-
|
|
1117
|
+
$[f.uid] === void 0 && ($[f.uid] = f);
|
|
1125
1118
|
}
|
|
1126
1119
|
}
|
|
1127
1120
|
const p = {};
|
|
@@ -1149,15 +1142,15 @@ function ve(t, s, e, { enriched: r = !1, log: l = !1 } = {}) {
|
|
|
1149
1142
|
amendementByUid: v,
|
|
1150
1143
|
documentByUid: b,
|
|
1151
1144
|
dossierParlementaireBySenatChemin: x,
|
|
1152
|
-
dossierParlementaireByTitreChemin:
|
|
1145
|
+
dossierParlementaireByTitreChemin: D,
|
|
1153
1146
|
dossierParlementaireByUid: O,
|
|
1154
1147
|
organeByUid: _,
|
|
1155
|
-
photoByUid:
|
|
1148
|
+
photoByUid: X,
|
|
1156
1149
|
reunionByUid: j,
|
|
1157
1150
|
reunionsByDay: y,
|
|
1158
1151
|
reunionsByDossierUid: F,
|
|
1159
|
-
scrutinByUid:
|
|
1160
|
-
questionByUid:
|
|
1152
|
+
scrutinByUid: V,
|
|
1153
|
+
questionByUid: $,
|
|
1161
1154
|
compteRenduByUid: p
|
|
1162
1155
|
};
|
|
1163
1156
|
}
|
|
@@ -1218,7 +1211,7 @@ function Ie(t, s, e, { log: r = !1 } = {}) {
|
|
|
1218
1211
|
for (const g of c.amendements)
|
|
1219
1212
|
F[g.uid] === void 0 && (F[g.uid] = g);
|
|
1220
1213
|
}
|
|
1221
|
-
const v = {}, b = {}, x = {},
|
|
1214
|
+
const v = {}, b = {}, x = {}, D = {};
|
|
1222
1215
|
if (s & I.DossiersLegislatifs)
|
|
1223
1216
|
for (const p of A.dossiersLegislatifs) {
|
|
1224
1217
|
if (p.ignoreForWeb || e !== a.All && p.legislature !== a.All && e !== p.legislature)
|
|
@@ -1233,7 +1226,7 @@ function Ie(t, s, e, { log: r = !1 } = {}) {
|
|
|
1233
1226
|
v[c.uid] === void 0 && (v[c.uid] = c);
|
|
1234
1227
|
for (const c of u.dossiersParlementaires) {
|
|
1235
1228
|
const g = c.titreDossier;
|
|
1236
|
-
g.senatChemin && b[g.senatChemin] === void 0 && (b[g.senatChemin] = c), g.titreChemin && x[g.titreChemin] === void 0 && (x[g.titreChemin] = c),
|
|
1229
|
+
g.senatChemin && b[g.senatChemin] === void 0 && (b[g.senatChemin] = c), g.titreChemin && x[g.titreChemin] === void 0 && (x[g.titreChemin] = c), D[c.uid] === void 0 && (D[c.uid] = c);
|
|
1237
1230
|
}
|
|
1238
1231
|
}
|
|
1239
1232
|
const O = {};
|
|
@@ -1265,7 +1258,7 @@ function Ie(t, s, e, { log: r = !1 } = {}) {
|
|
|
1265
1258
|
} else r && console.log(`Ignoring missing file: ${o}`);
|
|
1266
1259
|
}
|
|
1267
1260
|
}
|
|
1268
|
-
const
|
|
1261
|
+
const X = {};
|
|
1269
1262
|
if (s & I.Scrutins)
|
|
1270
1263
|
for (const p of A.scrutins) {
|
|
1271
1264
|
if (p.ignoreForWeb || e !== a.All && p.legislature !== a.All && e !== p.legislature)
|
|
@@ -1277,9 +1270,9 @@ function Ie(t, s, e, { log: r = !1 } = {}) {
|
|
|
1277
1270
|
r && console.log(`Loading file: ${o}`);
|
|
1278
1271
|
const m = n.readFileSync(o, { encoding: "utf8" }), u = Z.toScrutins(m);
|
|
1279
1272
|
for (const c of u.scrutins)
|
|
1280
|
-
|
|
1273
|
+
X[c.uid] === void 0 && (X[c.uid] = c);
|
|
1281
1274
|
}
|
|
1282
|
-
const
|
|
1275
|
+
const V = {};
|
|
1283
1276
|
if (s & I.Questions)
|
|
1284
1277
|
for (const p of A.questions) {
|
|
1285
1278
|
if (p.ignoreForWeb || e !== a.All && p.legislature !== a.All && e !== p.legislature)
|
|
@@ -1291,9 +1284,9 @@ function Ie(t, s, e, { log: r = !1 } = {}) {
|
|
|
1291
1284
|
r && console.log(`Loading file: ${o}`);
|
|
1292
1285
|
const m = n.readFileSync(o, { encoding: "utf8" }), u = B.toQuestions(m);
|
|
1293
1286
|
for (const c of u.questions)
|
|
1294
|
-
|
|
1287
|
+
V[c.uid] === void 0 && (V[c.uid] = c);
|
|
1295
1288
|
}
|
|
1296
|
-
const
|
|
1289
|
+
const $ = {};
|
|
1297
1290
|
if (s & I.ComptesRendusSeances)
|
|
1298
1291
|
for (const p of A.comptesRendusSeances) {
|
|
1299
1292
|
if (p.ignoreForWeb || e !== a.All && p.legislature !== a.All && e !== p.legislature)
|
|
@@ -1305,7 +1298,7 @@ function Ie(t, s, e, { log: r = !1 } = {}) {
|
|
|
1305
1298
|
r && console.log(`Loading file: ${o}`);
|
|
1306
1299
|
const m = n.readFileSync(o, { encoding: "utf8" }), u = J.toComptesRendus(m);
|
|
1307
1300
|
for (const c of u.comptesRendus)
|
|
1308
|
-
|
|
1301
|
+
$[c.uid] === void 0 && ($[c.uid] = c);
|
|
1309
1302
|
}
|
|
1310
1303
|
return {
|
|
1311
1304
|
acteurByUid: l,
|
|
@@ -1313,15 +1306,15 @@ function Ie(t, s, e, { log: r = !1 } = {}) {
|
|
|
1313
1306
|
documentByUid: v,
|
|
1314
1307
|
dossierParlementaireBySenatChemin: b,
|
|
1315
1308
|
dossierParlementaireByTitreChemin: x,
|
|
1316
|
-
dossierParlementaireByUid:
|
|
1309
|
+
dossierParlementaireByUid: D,
|
|
1317
1310
|
organeByUid: d,
|
|
1318
1311
|
photoByUid: O,
|
|
1319
1312
|
reunionByUid: _,
|
|
1320
1313
|
reunionsByDay: j,
|
|
1321
1314
|
reunionsByDossierUid: y,
|
|
1322
|
-
scrutinByUid:
|
|
1323
|
-
questionByUid:
|
|
1324
|
-
compteRenduByUid:
|
|
1315
|
+
scrutinByUid: X,
|
|
1316
|
+
questionByUid: V,
|
|
1317
|
+
compteRenduByUid: $
|
|
1325
1318
|
};
|
|
1326
1319
|
}
|
|
1327
1320
|
function be(t, s, e) {
|