part1
This commit is contained in:
19
API.lang.md
19
API.lang.md
@@ -9,8 +9,7 @@ This document is auto-generated from the JSDoc comments in `src/store` by runnin
|
||||
Creates a new language by its ISO 639 code.
|
||||
|
||||
```js
|
||||
const fn = create(pool);
|
||||
const id = await fn('de');
|
||||
const id = await store.lang.create('de');
|
||||
// => 1
|
||||
```
|
||||
|
||||
@@ -21,8 +20,7 @@ const id = await fn('de');
|
||||
Deletes a language by its id.
|
||||
|
||||
```js
|
||||
const fn = del(pool);
|
||||
await fn(1);
|
||||
await store.lang.delete(1);
|
||||
```
|
||||
|
||||
## `lang.ensure`
|
||||
@@ -32,8 +30,7 @@ await fn(1);
|
||||
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');
|
||||
const id = await store.lang.ensure('de');
|
||||
// => 1
|
||||
```
|
||||
|
||||
@@ -44,9 +41,8 @@ const id = await fn('de');
|
||||
Returns a language row by its ISO 639 code.
|
||||
|
||||
```js
|
||||
const fn = getByIso639(pool);
|
||||
const lang = await fn('de');
|
||||
// => { id, iso639 }
|
||||
const lang = await store.lang.getByIso639('de');
|
||||
// => { id: 1, iso639: 'de' }
|
||||
```
|
||||
|
||||
## `lang.list`
|
||||
@@ -56,7 +52,6 @@ const lang = await fn('de');
|
||||
Lists all languages.
|
||||
|
||||
```js
|
||||
const fn = list(pool);
|
||||
const languages = await fn();
|
||||
// => [{ id, iso639 }]
|
||||
const languages = await store.lang.list();
|
||||
// => [{ id: 1, iso639: 'de' }]
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user