@mark1russell7/guidebook-preparedness 0.7.49 → 0.7.50
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/build/index.d.ts.map +1 -1
- package/build/index.js +19 -1
- package/build/index.js.map +1 -1
- package/package.json +2 -2
- package/src/data/persons.ts +21 -0
- package/src/data/steps.ts +4 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@mark1russell7/guidebook-preparedness",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.50",
|
|
5
5
|
"description": "The preparedness content of the guidebook: cited sources, the steps and marked gaps of 12 cases and 6 cuts, 40 topics in 12 areas, and the catalog of offline bundles.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"guidebook",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@mark1russell7/guidebook": "0.7.0",
|
|
60
60
|
"@mark1russell7/guidebook-library": "0.5.0",
|
|
61
|
-
"@mark1russell7/guidebook-plans": "0.3.
|
|
61
|
+
"@mark1russell7/guidebook-plans": "0.3.10",
|
|
62
62
|
"@mark1russell7/guidebook-topics": "0.1.9",
|
|
63
63
|
"@mark1russell7/vex": "^0.20.2"
|
|
64
64
|
},
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// The groups of persons that each step protects, by the id of the step. Each group is in `PERSON_GROUPS` of `@mark1russell7/guidebook-plans`.
|
|
2
|
+
// A step gets a group only when its action names the persons of the group: infants and baby formula, children, older adults or pregnancy.
|
|
3
|
+
// A step that names a child under 2 gets the groups `infant` and `child`.
|
|
4
|
+
|
|
5
|
+
import type { PersonGroup } from "@mark1russell7/guidebook-plans";
|
|
6
|
+
|
|
7
|
+
/** The groups of persons that each step protects, by the `id` of the step. A test holds that each key is the id of a step. */
|
|
8
|
+
export const STEP_PERSONS: Readonly<Record<string, readonly PersonGroup[]>> = {
|
|
9
|
+
"met.tropical.hurricane.warned.neighbors": ["older-adult"],
|
|
10
|
+
"met.tropical.hurricane.P3.mold": ["child"],
|
|
11
|
+
"met.heat.extreme.P1.check": ["older-adult"],
|
|
12
|
+
"fire.structure.ready.children": ["child"],
|
|
13
|
+
"fire.wildfire.P1.n95": ["infant", "child"],
|
|
14
|
+
"infra.supply-chain.food.ready.household": ["infant"],
|
|
15
|
+
"infra.supply-chain.food.P2.formula": ["infant"],
|
|
16
|
+
"cbrne.nuclear-detonation.P2.pregnant-care": ["pregnant"],
|
|
17
|
+
"security.armed-conflict.P3.children": ["child"],
|
|
18
|
+
"water.main.P1.unsafe": ["infant"],
|
|
19
|
+
"network.access.P5.teach-children": ["child"],
|
|
20
|
+
"food.retail.P3.share-by-need": ["child"],
|
|
21
|
+
};
|
package/src/data/steps.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import type { Phase, Society, Step } from "@mark1russell7/guidebook-plans";
|
|
5
5
|
import { app, key, lit, ref, serialize } from "@mark1russell7/vex";
|
|
6
6
|
import type { Expr } from "@mark1russell7/vex";
|
|
7
|
+
import { STEP_PERSONS } from "./persons.ts";
|
|
7
8
|
import { STEP_USES } from "./uses.ts";
|
|
8
9
|
|
|
9
10
|
/** One row of a key: the phase, a short name, the action, the sources and the needs that the step protects. */
|
|
@@ -13,7 +14,7 @@ type Row = readonly [phase: Phase, name: string, action: string, sources: readon
|
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* This function makes the steps of a key from its rows. The order of a step is its position among the rows of its phase.
|
|
16
|
-
* The items that a step uses come from `STEP_USES`, by the id of the step.
|
|
17
|
+
* The items that a step uses come from `STEP_USES`, and its groups of persons come from `STEP_PERSONS`, by the id of the step.
|
|
17
18
|
*/
|
|
18
19
|
function stepsOf(on: string, rows: readonly Row[]): Step[] {
|
|
19
20
|
const count = new Map<Phase, number>();
|
|
@@ -23,7 +24,8 @@ function stepsOf(on: string, rows: readonly Row[]): Step[] {
|
|
|
23
24
|
count.set(phase, order);
|
|
24
25
|
const id = `${on}.${phase}.${name}`;
|
|
25
26
|
const uses = STEP_USES[id];
|
|
26
|
-
|
|
27
|
+
const persons = STEP_PERSONS[id];
|
|
28
|
+
return { id, on, phase, needs, do: action, ...(uses === undefined ? {} : { uses }), ...(persons === undefined ? {} : { persons }), order, sources, ...(reasoning === undefined ? {} : { reasoning }), ...(society === undefined ? {} : { society }), ...(when === undefined ? {} : { when }) };
|
|
27
29
|
});
|
|
28
30
|
}
|
|
29
31
|
|