952 B
952 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 id = await store.lang.create('de');
// => 1
lang.delete
Source: src/store/lang/delete.js
Deletes a language by its id.
await store.lang.delete(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 id = await store.lang.ensure('de');
// => 1
lang.getByIso639
Source: src/store/lang/getByIso639.js
Returns a language row by its ISO 639 code.
const lang = await store.lang.getByIso639('de');
// => { id: 1, iso639: 'de' }
lang.list
Source: src/store/lang/list.js
Lists all languages.
const languages = await store.lang.list();
// => [{ id: 1, iso639: 'de' }]