@mark1russell7/guidebook-preparedness 0.7.46 → 0.7.48

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 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/data/sources.ts","../src/data/steps.ts","../src/data/gaps.ts","../src/data/coverage.ts","../src/data/rules.ts","../src/data/chart.ts","../src/data/topics.ts","../src/data/units.ts","../src/data/tab-units.ts","../src/data/bundles.ts","../src/data/media.ts","../src/index.ts"],"mappings":";;;;;qBAOa;;qBAKA,kBAAkB;;qBCgFlB,qBAAqB;;;;;qBAkiBrB,oBAAoB;;qBAgSpB,gBAAgB;;qBCl5BhB,eAAe;;;;;qBCLf;;qBCEA,gBAAgB;;qBCwBhB;;qBAGA;;;;;qBAQA,iBAAiB;;qBCrCjB;;qBAyDA,iBAAiB;;qBCshFjB,sBAAsB;;qBCg+DtB,oBAAoB;;qBC7iJpB;;;;;;qBAOA;;qBAKA,kBAAkB;;;;;;qBAyBlB,gBAAgB;;qBCvChB,sBAAsB;;qBA8CtB,eAAe,SAAS,QAAQ,OAAO;WAAuB;WAA6B;;;;;;;;;qBAY3F,cAAc,SAAS;WAA0B,MAAM;WAAqB,MAAM;WAAqB;;;;;;qBAYvG,sBAAsB;;;;;qBCrDtB;;;;;qBAmBA;;qBAGA;;qBAGA;;;qBAIA;qBAEA,eAAe;;qBAGf,kBAAkB;;qBAGlB,OAAO"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/data/sources.ts","../src/data/steps.ts","../src/data/gaps.ts","../src/data/coverage.ts","../src/data/rules.ts","../src/data/chart.ts","../src/data/topics.ts","../src/data/units.ts","../src/data/tab-units.ts","../src/data/bundles.ts","../src/data/media.ts","../src/index.ts"],"mappings":";;;;;qBAOa;;qBAKA,kBAAkB;;qBCsFlB,qBAAqB;;;;;qBAkiBrB,oBAAoB;;qBAgSpB,gBAAgB;;qBCx5BhB,eAAe;;;;;qBCLf;;qBCEA,gBAAgB;;qBCwBhB;;qBAGA;;;;;qBAQA,iBAAiB;;qBCrCjB;;qBAyDA,iBAAiB;;qBCshFjB,sBAAsB;;qBCg+DtB,oBAAoB;;qBC7iJpB;;;;;;qBAOA;;qBAKA,kBAAkB;;;;;;qBAyBlB,gBAAgB;;qBCvChB,sBAAsB;;qBA8CtB,eAAe,SAAS,QAAQ,OAAO;WAAuB;WAA6B;;;;;;;;;qBAY3F,cAAc,SAAS;WAA0B,MAAM;WAAqB,MAAM;WAAqB;;;;;;qBAYvG,sBAAsB;;;;;qBCrDtB;;;;;qBAmBA;;qBAGA;;qBAGA;;;qBAIA;qBAEA,eAAe;;qBAGf,kBAAkB;;qBAGlB,OAAO"}
package/build/index.js CHANGED
@@ -534,20 +534,64 @@ function hazardsOf(steps) {
534
534
  };
535
535
  });
536
536
  }
537
+ // src/data/uses.ts
538
+ const WEATHER_RADIO = "communication.noaa-radio";
539
+ const TWO_WAY_RADIOS = "communication.frs-radio-pair";
540
+ const FLASHLIGHT = "light.flashlight";
541
+ const CELLS = "power.aa-alkaline";
542
+ const FIRST_AID_KIT = "first-aid.kit";
543
+ const SLEEPING_BAG = "heat.sleeping-bag";
544
+ /** The items that each step uses, by the `id` of the step. A test holds that each key is the id of a step. */
545
+ const STEP_USES = {
546
+ "met.winter.storm.ready.supplies": [
547
+ WEATHER_RADIO,
548
+ FLASHLIGHT,
549
+ CELLS
550
+ ],
551
+ "met.winter.storm.ready.car-kit": [FLASHLIGHT],
552
+ "met.tornado.P1.listen": [WEATHER_RADIO],
553
+ "cbrne.hazardous-materials.warned.listen": [WEATHER_RADIO],
554
+ "cbrne.radiological.ready.radio": [WEATHER_RADIO, CELLS],
555
+ "cbrne.radiological.warned.inside": [WEATHER_RADIO],
556
+ "health.medical-emergency.ready.first-aid-kit": [FIRST_AID_KIT],
557
+ "civic.ai-collapse.ready.radio": [WEATHER_RADIO, CELLS],
558
+ "civic.ai-collapse.P0.shelter": [WEATHER_RADIO],
559
+ "infra.power.grid-collapse.ready.warm": [SLEEPING_BAG],
560
+ "cbrne.nuclear-detonation.ready.alerts-and-radio": [WEATHER_RADIO, CELLS],
561
+ "security.nuclear-war.ready.radio": [WEATHER_RADIO, CELLS],
562
+ "security.nuclear-war.warned.public-warning": [WEATHER_RADIO],
563
+ "cbrne.emp.ready.spare-batteries": [CELLS],
564
+ "cbrne.emp.P1.listen-radio": [WEATHER_RADIO],
565
+ "security.armed-conflict.ready.radio": [WEATHER_RADIO, CELLS],
566
+ "power.grid.ready.flashlights": [FLASHLIGHT],
567
+ "phone.network.ready.radio": [WEATHER_RADIO, CELLS],
568
+ "phone.network.ready.radios": [TWO_WAY_RADIOS],
569
+ "phone.network.P4.two-way-radio": [TWO_WAY_RADIOS],
570
+ "network.access.ready.radio": [WEATHER_RADIO, CELLS],
571
+ "care.local.P3.medic": [FIRST_AID_KIT],
572
+ "fuel.retail.ready.warm-layers": [SLEEPING_BAG],
573
+ "home.dwelling.P1.radio": [WEATHER_RADIO, CELLS]
574
+ };
537
575
  // src/data/steps.ts
538
- /** 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. */
576
+ /**
577
+ * 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.
578
+ * The items that a step uses come from `STEP_USES`, by the id of the step.
579
+ */
539
580
  function stepsOf(on, rows) {
540
581
  const count = /* @__PURE__ */ new Map();
541
582
  return rows.map(([phase, name, action, sources, more = []]) => {
542
583
  const { needs = [], reasoning, society, when } = Array.isArray(more) ? { needs: more } : more;
543
584
  const order = (count.get(phase) ?? 0) + 1;
544
585
  count.set(phase, order);
586
+ const id = `${on}.${phase}.${name}`;
587
+ const uses = STEP_USES[id];
545
588
  return {
546
- id: `${on}.${phase}.${name}`,
589
+ id,
547
590
  on,
548
591
  phase,
549
592
  needs,
550
593
  do: action,
594
+ ...uses === void 0 ? {} : { uses },
551
595
  order,
552
596
  sources,
553
597
  ...reasoning === void 0 ? {} : { reasoning },