@socialgouv/kali-data-types 2.625.0 → 2.627.0
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
CHANGED
package/src/index.js
CHANGED
|
@@ -11,6 +11,7 @@ const getArticles = require("./libs/getArticles");
|
|
|
11
11
|
const getIndexedArticle = require("./libs/getIndexedArticle");
|
|
12
12
|
const hasAgreement = require("./libs/hasAgreement");
|
|
13
13
|
const hasArticle = require("./libs/hasArticle");
|
|
14
|
+
const getAgreementsWithNoId = require("./libs/getAgreementsWithNoId");
|
|
14
15
|
|
|
15
16
|
module.exports = {
|
|
16
17
|
getAgreement,
|
|
@@ -18,6 +19,7 @@ module.exports = {
|
|
|
18
19
|
getAgreementArticlesWithPath,
|
|
19
20
|
getAgreementIdFromIdOrIdcc,
|
|
20
21
|
getAgreements,
|
|
22
|
+
getAgreementsWithNoId,
|
|
21
23
|
getArticleWithParentSections,
|
|
22
24
|
getArticleWithPath,
|
|
23
25
|
getArticles,
|
|
@@ -10,7 +10,9 @@ const INDEXED_AGREEMENTS =
|
|
|
10
10
|
* @returns {KaliData.IndexedAgreement[]}
|
|
11
11
|
*/
|
|
12
12
|
function getAgreements() {
|
|
13
|
-
|
|
13
|
+
const containsId = convention => typeof convention.id === "string";
|
|
14
|
+
|
|
15
|
+
return INDEXED_AGREEMENTS.filter(containsId);
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
module.exports = getAgreements;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
const INDEXED_AGREEMENTS =
|
|
4
|
+
/** @type {KaliData.IndexedAgreement[]} */
|
|
5
|
+
(require("../../data/index.json"));
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Get the full list of indexed agreements.
|
|
9
|
+
*
|
|
10
|
+
* @returns {KaliData.IndexedAgreement[]}
|
|
11
|
+
*/
|
|
12
|
+
function getAgreementsWithNoId() {
|
|
13
|
+
const containsNoId = convention => typeof convention.id === "undefined";
|
|
14
|
+
|
|
15
|
+
return INDEXED_AGREEMENTS.filter(containsNoId);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
module.exports = getAgreementsWithNoId;
|