@tricoteuses/senat 2.15.2 → 2.15.3

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.d.ts CHANGED
@@ -89,4 +89,4 @@ export declare function iterLoadSenatCirconscriptions(dataDir: string, options?:
89
89
  export declare function iterLoadSenatOrganismes(dataDir: string, options?: {}): Generator<IterItem<OrganismeResult>>;
90
90
  export declare function iterLoadSenatSenateurs(dataDir: string, options?: {}): Generator<IterItem<SenateurResult>>;
91
91
  export declare function iterLoadSenatQuestions(dataDir: string, legislature: number, options?: {}): Generator<IterItem<QuestionResult>>;
92
- export declare function iterLoadSenatScrutins(dataDir: string, legislature: number, options?: {}): Generator<IterItem<ScrutinResult>>;
92
+ export declare function iterLoadSenatScrutins(dataDir: string, session: number | undefined, options?: {}): Generator<IterItem<ScrutinResult>>;
package/lib/loaders.js CHANGED
@@ -227,8 +227,8 @@ export function* iterLoadSenatQuestions(dataDir, legislature, options = {}) {
227
227
  yield questionItem;
228
228
  }
229
229
  }
230
- export function* iterLoadSenatScrutins(dataDir, legislature, options = {}) {
231
- for (const scrutinItem of iterLoadSenatItems(dataDir, datasets.dosleg.database, legislature, undefined, options)) {
230
+ export function* iterLoadSenatScrutins(dataDir, session, options = {}) {
231
+ for (const scrutinItem of iterLoadSenatItems(dataDir, "scrutins", session, undefined, options)) {
232
232
  yield scrutinItem;
233
233
  }
234
234
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import { iterLoadSenatScrutins } from "../loaders";
2
+ import commandLineArgs from "command-line-args";
3
+ import { dataDirDefaultOption } from "./shared/cli_helpers";
4
+ const optionsDefinitions = [dataDirDefaultOption];
5
+ const options = commandLineArgs(optionsDefinitions);
6
+ const noValidation = false;
7
+ const session = 2024;
8
+ for (const { item: scrutin } of iterLoadSenatScrutins(options["dataDir"], session, { noValidation: noValidation })) {
9
+ console.log(scrutin["numero"]);
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tricoteuses/senat",
3
- "version": "2.15.2",
3
+ "version": "2.15.3",
4
4
  "description": "Handle French Sénat's open data",
5
5
  "keywords": [
6
6
  "France",
@@ -56,6 +56,7 @@
56
56
  "prepare": "npm run build",
57
57
  "prepublishOnly": "npm run build",
58
58
  "prettier": "prettier --write 'src/**/*.ts' 'tests/**/*.test.ts'",
59
+ "test:iter_load": "tsx src/scripts/test_iter_load.ts",
59
60
  "type-check": "tsc --noEmit",
60
61
  "type-check:watch": "npm run type-check -- --watch"
61
62
  },