readMeteorStrengthfunction
What a page's meteors-strength attribute means: a number from 0 (no streaks are drawn) to 1 (the full look), given as it is written; with none, or something that
is not a number, METEOR_STRENGTH_DEFAULT. A number outside the range is brought to its nearest end.
Import it
import { readMeteorStrength } from "@johnmorrisdotca/chikyu-earth/meteors";
Definition
function readMeteorStrength(given: string | null): number
Parameters
| Name | Type | Description |
|---|---|---|
given | string | null | The attribute's value, or |
Returns
number
How strongly the streaks are drawn, between 0 and 1.
Examples
import { readMeteorStrength } from "@johnmorrisdotca/chikyu-earth/meteors";
console.log(readMeteorStrength(null), readMeteorStrength("0.3"), readMeteorStrength("7"), readMeteorStrength("-1"), readMeteorStrength("soft")); // 1 0.3 1 0 11 0.3 1 0 1What it prints (run when this page was built)