1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
export type AstronomyPoint = {
moon_illumination: string; // "78",
moon_phase: string; // "Waxing Gibbous",
moonrise: string; //"04:34 PM",
moonset: string; //"04:59 AM",
sunrise: string; // "06:38 AM",
sunset: string; //"08:40 PM",
date: string; // "2023-05-01"
};
export type AstronomyData = AstronomyPoint[];
export async function wttrAstronomyData(
wttrJson: any // return of @me.wttrJson
): Promise<AstronomyData> {
const R = await import("npm:ramda");
return R.pipe(R.map((w) => ({ date: w.date, ...w.astronomy[0] })))(
wttrJson.weather
);
}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023