This commit is contained in:
seb
2026-08-07 04:05:01 +02:00
parent 4833acd680
commit 1e89e19863
22 changed files with 1433 additions and 2 deletions

62
API.lang.md Normal file
View File

@@ -0,0 +1,62 @@
# 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.
```js
const fn = create(pool);
const id = await fn('de');
// => 1
```
## `lang.delete`
*Source: `src/store/lang/delete.js`*
Deletes a language by its id.
```js
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.
```js
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.
```js
const fn = getByIso639(pool);
const lang = await fn('de');
// => { id, iso639 }
```
## `lang.list`
*Source: `src/store/lang/list.js`*
Lists all languages.
```js
const fn = list(pool);
const languages = await fn();
// => [{ id, iso639 }]
```