@tricoteuses/senat 2.5.7 → 2.5.8

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.
@@ -1,5 +1,5 @@
1
1
  import { JSDOM } from "jsdom";
2
- import { AKN_WORKFLOW_IDENTIFICATION_STRUCTURE_REGEXP, AKN_IDENTIFICATION_STRUCTURE_REGEXP, } from "../scripts/datautil";
2
+ import { AKN_IDENTIFICATION_STRUCTURE_REGEXP, AKN_WORKFLOW_IDENTIFICATION_STRUCTURE_REGEXP } from "../scripts/datautil";
3
3
  import { DivisionType, } from "../types/texte";
4
4
  function buildWorklow(metaElement) {
5
5
  const stepElements = metaElement.querySelectorAll("workflow step");
@@ -136,6 +136,7 @@ export function transformTexte(document) {
136
136
  ?.getAttribute("value") ?? "";
137
137
  const identificationParts = AKN_IDENTIFICATION_STRUCTURE_REGEXP.exec(identification)?.groups;
138
138
  const bodyElement = document.querySelector("body");
139
+ const sessionYears = identificationParts?.["session"]?.split("-") || null;
139
140
  const datePresentation = metaElement
140
141
  ?.querySelector("FRBRdate[name='#presentation']")
141
142
  ?.getAttribute("date");
@@ -160,7 +161,7 @@ export function transformTexte(document) {
160
161
  ?.querySelector("FRBRalias[name='url-AN']")
161
162
  ?.getAttribute("value") || null,
162
163
  type: identificationParts?.["type"] || null,
163
- session: identificationParts?.["session"] || null,
164
+ session: sessionYears && sessionYears.length > 0 ? sessionYears[0] : null,
164
165
  numero: identificationParts?.["numTexte"]
165
166
  ? parseInt(identificationParts["numTexte"])
166
167
  : null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tricoteuses/senat",
3
- "version": "2.5.7",
3
+ "version": "2.5.8",
4
4
  "description": "Handle French Sénat's open data",
5
5
  "keywords": [
6
6
  "France",