981 B
981 B
lang
This document is auto-generated from the JSDoc comments in src/store by running npm run api-doc.
lang.create
Source: src/store/lang/create.js
Creates a new language by its ISO 639 code.
const fn = create(pool);
const id = await fn('de');
// => 1
lang.delete
Source: src/store/lang/delete.js
Deletes a language by its id.
const fn = del(pool);
await fn(1);
lang.ensure
Source: src/store/lang/ensure.js
Returns the id of a language by ISO code, creating it if it does not exist.
const fn = ensure(pool);
const id = await fn('de');
// => 1
lang.getByIso639
Source: src/store/lang/getByIso639.js
Returns a language row by its ISO 639 code.
const fn = getByIso639(pool);
const lang = await fn('de');
// => { id, iso639 }
lang.list
Source: src/store/lang/list.js
Lists all languages.
const fn = list(pool);
const languages = await fn();
// => [{ id, iso639 }]