Skip to content
← Public packages

@kentcdodds/christ-paintings

Official Latter-day Saint paintings of Jesus Christ, one at a time, to show children during church, plus coloring pages of the Savior. Swipe to move. Works offline.

FollowForkOpen app

src/index.ts

24 lines · 1021 B · TypeScript
Raw
import { COLORING_PAGES } from './coloring.ts'
import { PAINTINGS } from './paintings.ts'

/**
 * List the paintings and coloring pages the Christ Paintings app shows, in order.
 * Use when an agent needs the titles, artists, or Church source pages (for example to
 * say which painting is which, or to link one).
 *
 * @param input - `{}` (no options)
 * @returns `{ count, paintings: [{ id, title, artist, sourceUrl }], coloringPages: [{ id, title, sourceUrl }] }`
 *
 * @example
 * import listPaintings from 'kody:@kentcdodds/christ-paintings'
 *
 * const { count, paintings } = await listPaintings({})
 */
export default async function listPaintings(input: Record<string, never> = {}) {
	if (input && Object.keys(input).length) throw new Error('listPaintings takes no options')
	return {
		count: PAINTINGS.length,
		paintings: PAINTINGS.map(({ id, title, artist, sourceUrl }) => ({ id, title, artist, sourceUrl })),
		coloringPages: COLORING_PAGES.map(({ id, title, sourceUrl }) => ({ id, title, sourceUrl })),
	}
}