From 51296d01af77f3d9d77eb2f6873ed66f4c9d6616 Mon Sep 17 00:00:00 2001 From: Emmanuel Raviart Date: Sun, 15 Dec 2024 23:49:03 +0100 Subject: [PATCH] Create types JorfArticleMetaArticle & LegiArticleMetaArticle --- src/lib/legal/index.ts | 2 ++ src/lib/legal/jorf.ts | 18 ++++++++++-------- src/lib/legal/legi.ts | 16 +++++++++------- src/scripts/export_consolidated_text_to_git.ts | 1 + 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/lib/legal/index.ts b/src/lib/legal/index.ts index 1bb1bf0..ca82315 100644 --- a/src/lib/legal/index.ts +++ b/src/lib/legal/index.ts @@ -39,6 +39,7 @@ export { type JorfArticle, type JorfArticleEtat, type JorfArticleLienArticleOrigine, + type JorfArticleMetaArticle, type JorfArticleNature, type JorfArticleOrigine, type JorfArticleTexteNature, @@ -97,6 +98,7 @@ export { type LegiArticleLienArticleOrigine, type LegiArticleLienNature, type LegiArticleLienType, + type LegiArticleMetaArticle, type LegiArticleNature, type LegiArticleOrigine, type LegiArticleTexteNature, diff --git a/src/lib/legal/jorf.ts b/src/lib/legal/jorf.ts index a430e71..13877cb 100644 --- a/src/lib/legal/jorf.ts +++ b/src/lib/legal/jorf.ts @@ -68,14 +68,7 @@ export interface JorfArticle { URL: string } META_SPEC: { - META_ARTICLE: { - DATE_DEBUT: string - DATE_FIN: string - /// Mots-clés - MCS_ART?: { MC: string[] } - NUM?: string - TYPE?: JorfArticleType - } + META_ARTICLE: JorfArticleMetaArticle } } VERSIONS: { @@ -98,6 +91,15 @@ export type JorfArticleEtat = (typeof allJorfArticleEtats)[number] export type JorfArticleLienArticleOrigine = (typeof allJorfArticleLienArticleOrigines)[number] +export interface JorfArticleMetaArticle { + DATE_DEBUT: string + DATE_FIN: string + /// Mots-clés + MCS_ART?: { MC: string[] } + NUM?: string + TYPE?: JorfArticleType +} + export type JorfArticleNature = (typeof allJorfArticleNatures)[number] export type JorfArticleOrigine = (typeof allJorfArticleOrigines)[number] diff --git a/src/lib/legal/legi.ts b/src/lib/legal/legi.ts index c4a8863..840e3b3 100644 --- a/src/lib/legal/legi.ts +++ b/src/lib/legal/legi.ts @@ -37,13 +37,7 @@ export interface LegiArticle { URL: string } META_SPEC: { - META_ARTICLE: { - DATE_DEBUT: string - DATE_FIN: string - ETAT?: LegiArticleEtat - NUM?: string - TYPE?: LegiArticleType - } + META_ARTICLE: LegiArticleMetaArticle } } NOTA?: { @@ -85,6 +79,14 @@ export type LegiArticleLienNature = (typeof allLegiArticleLienNatures)[number] export type LegiArticleLienType = (typeof allLegiArticleLienTypes)[number] +export interface LegiArticleMetaArticle { + DATE_DEBUT: string + DATE_FIN: string + ETAT?: LegiArticleEtat + NUM?: string + TYPE?: LegiArticleType +} + export type LegiArticleNature = (typeof allLegiArticleNatures)[number] export type LegiArticleOrigine = (typeof allLegiArticleOrigines)[number] diff --git a/src/scripts/export_consolidated_text_to_git.ts b/src/scripts/export_consolidated_text_to_git.ts index d8fbbe0..ec86125 100644 --- a/src/scripts/export_consolidated_text_to_git.ts +++ b/src/scripts/export_consolidated_text_to_git.ts @@ -19,6 +19,7 @@ import type { } from "$lib/legal/jorf" import type { LegiArticle, + LegiArticleMetaArticle, LegiArticleTm, LegiSectionTa, LegiSectionTaLienArt,