Skip to content

Commit 840d383

Browse files
committed
chore(release): update documentation
1 parent b34d854 commit 840d383

6 files changed

Lines changed: 104 additions & 107 deletions

File tree

packages/kitsu-core/README.md

Lines changed: 86 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
<p align=center><a href=https://github.com/wopian/kitsu/blob/master/packages/kitsu-core/MIGRATING.md>Migration guide</a> for v10 & previous major releases</p>
2626

27-
#
27+
#
2828

2929
## Features
3030

@@ -38,7 +38,7 @@
3838

3939
| Package | Package<br> Size\* | ESM Size† | Node | Chrome | Firefox | Safari | Edge |
4040
| -----------: | :----------------: | :-------: | :--: | :----: | :-----: | :----: | :--: |
41-
| `kitsu-core` | ≤ 1.5 kb | ≤ 1.4 KB | 12+ | 72+ | 78+ | 12.1+ | 86+ |
41+
| `kitsu-core` | ≤ 1.5 kb | ≤ 1.4 KB | 12+ | 72+ | 78+ | 12.1+ | 86+ |
4242

4343
\* Minified with brotli
4444
† EcmaScript Modules package size\*
@@ -91,43 +91,71 @@ All code released under [MIT]
9191

9292
#### Table of Contents
9393

94-
- [deattribute](#deattribute)
94+
- [camel](#camel)
9595
- [Parameters](#parameters)
9696
- [Examples](#examples)
97-
- [deserialise](#deserialise)
97+
- [deattribute](#deattribute)
9898
- [Parameters](#parameters-1)
9999
- [Examples](#examples-1)
100-
- [error](#error)
100+
- [deserialise](#deserialise)
101101
- [Parameters](#parameters-2)
102102
- [Examples](#examples-2)
103-
- [filterIncludes](#filterincludes)
103+
- [error](#error)
104104
- [Parameters](#parameters-3)
105105
- [Examples](#examples-3)
106-
- [linkRelationships](#linkrelationships)
106+
- [filterIncludes](#filterincludes)
107107
- [Parameters](#parameters-4)
108108
- [Examples](#examples-4)
109-
- [query](#query)
109+
- [kebab](#kebab)
110110
- [Parameters](#parameters-5)
111111
- [Examples](#examples-5)
112-
- [serialise](#serialise)
112+
- [linkRelationships](#linkrelationships)
113113
- [Parameters](#parameters-6)
114114
- [Examples](#examples-6)
115-
- [splitModel](#splitmodel)
115+
- [query](#query)
116116
- [Parameters](#parameters-7)
117117
- [Examples](#examples-7)
118-
- [camel](#camel)
118+
- [serialise](#serialise)
119119
- [Parameters](#parameters-8)
120120
- [Examples](#examples-8)
121-
- [kebab](#kebab)
121+
- [snake](#snake)
122122
- [Parameters](#parameters-9)
123123
- [Examples](#examples-9)
124-
- [snake](#snake)
124+
- [splitModel](#splitmodel)
125125
- [Parameters](#parameters-10)
126126
- [Examples](#examples-10)
127127

128+
### camel
129+
130+
[packages/kitsu-core/src/camel/index.js:14-14](https://github.com/wopian/kitsu/blob/b34d85434473d745bfc9ce5784704ddc3855dd3c/packages/kitsu-core/src/camel/index.js#L14-L14 "Source code on GitHub")
131+
132+
Converts kebab-case and snake_case into camelCase
133+
134+
#### Parameters
135+
136+
- `input` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** String to convert
137+
138+
#### Examples
139+
140+
Convert kebab-case
141+
142+
143+
```javascript
144+
camel('hello-world') // 'helloWorld'
145+
```
146+
147+
Convert snake_case
148+
149+
150+
```javascript
151+
camel('hello_world') // 'helloWorld'
152+
```
153+
154+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** camelCase formatted string
155+
128156
### deattribute
129157

130-
[packages/kitsu-core/src/deattribute/index.js:29-51](https://github.com/wopian/kitsu/blob/e1b988cb961081f12309f5e881d63d123be7f4cf/packages/kitsu-core/src/deattribute/index.js#L29-L51 "Source code on GitHub")
158+
[packages/kitsu-core/src/deattribute/index.js:29-51](https://github.com/wopian/kitsu/blob/b34d85434473d745bfc9ce5784704ddc3855dd3c/packages/kitsu-core/src/deattribute/index.js#L29-L51 "Source code on GitHub")
131159

132160
Hoists attributes to be top-level
133161

@@ -171,7 +199,7 @@ Returns **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
171199

172200
### deserialise
173201

174-
[packages/kitsu-core/src/deserialise/index.js:57-72](https://github.com/wopian/kitsu/blob/e1b988cb961081f12309f5e881d63d123be7f4cf/packages/kitsu-core/src/deserialise/index.js#L57-L72 "Source code on GitHub")
202+
[packages/kitsu-core/src/deserialise/index.js:57-72](https://github.com/wopian/kitsu/blob/b34d85434473d745bfc9ce5784704ddc3855dd3c/packages/kitsu-core/src/deserialise/index.js#L57-L72 "Source code on GitHub")
175203

176204
Deserialises a JSON-API response
177205

@@ -223,7 +251,7 @@ Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
223251

224252
### error
225253

226-
[packages/kitsu-core/src/error/index.js:27-33](https://github.com/wopian/kitsu/blob/e1b988cb961081f12309f5e881d63d123be7f4cf/packages/kitsu-core/src/error/index.js#L27-L33 "Source code on GitHub")
254+
[packages/kitsu-core/src/error/index.js:27-33](https://github.com/wopian/kitsu/blob/b34d85434473d745bfc9ce5784704ddc3855dd3c/packages/kitsu-core/src/error/index.js#L27-L33 "Source code on GitHub")
227255

228256
Uniform error handling for Axios, JSON:API and internal package errors. Mutated Error object is rethrown to the caller.
229257

@@ -260,14 +288,14 @@ error({
260288

261289
### filterIncludes
262290

263-
[packages/kitsu-core/src/filterIncludes/index.js:33-46](https://github.com/wopian/kitsu/blob/e1b988cb961081f12309f5e881d63d123be7f4cf/packages/kitsu-core/src/filterIncludes/index.js#L33-L46 "Source code on GitHub")
291+
[packages/kitsu-core/src/filterIncludes/index.js:33-46](https://github.com/wopian/kitsu/blob/b34d85434473d745bfc9ce5784704ddc3855dd3c/packages/kitsu-core/src/filterIncludes/index.js#L33-L46 "Source code on GitHub")
264292

265293
Filters includes for the specific relationship requested
266294

267295
#### Parameters
268296

269297
- `included` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>** The response included object
270-
- `relationship` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
298+
- `relationship` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
271299
- `relationship.id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The relationship ID
272300
- `relationship.type` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The relationship type
273301

@@ -297,9 +325,27 @@ const response = filterIncludes(includes, relationship)
297325

298326
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>** The matched includes
299327

328+
### kebab
329+
330+
[packages/kitsu-core/src/kebab/index.js:11-11](https://github.com/wopian/kitsu/blob/b34d85434473d745bfc9ce5784704ddc3855dd3c/packages/kitsu-core/src/kebab/index.js#L11-L11 "Source code on GitHub")
331+
332+
Converts camelCase into kebab-case
333+
334+
#### Parameters
335+
336+
- `input` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** camelCase string
337+
338+
#### Examples
339+
340+
```javascript
341+
kebab('helloWorld') // 'hello-world'
342+
```
343+
344+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** kebab-case formatted string
345+
300346
### linkRelationships
301347

302-
[packages/kitsu-core/src/linkRelationships/index.js:97-117](https://github.com/wopian/kitsu/blob/e1b988cb961081f12309f5e881d63d123be7f4cf/packages/kitsu-core/src/linkRelationships/index.js#L97-L117 "Source code on GitHub")
348+
[packages/kitsu-core/src/linkRelationships/index.js:97-117](https://github.com/wopian/kitsu/blob/b34d85434473d745bfc9ce5784704ddc3855dd3c/packages/kitsu-core/src/linkRelationships/index.js#L97-L117 "Source code on GitHub")
303349

304350
Links relationships to included data
305351

@@ -337,7 +383,7 @@ Returns **any** Parsed data
337383

338384
### query
339385

340-
[packages/kitsu-core/src/query/index.js:33-44](https://github.com/wopian/kitsu/blob/e1b988cb961081f12309f5e881d63d123be7f4cf/packages/kitsu-core/src/query/index.js#L33-L44 "Source code on GitHub")
386+
[packages/kitsu-core/src/query/index.js:33-44](https://github.com/wopian/kitsu/blob/b34d85434473d745bfc9ce5784704ddc3855dd3c/packages/kitsu-core/src/query/index.js#L33-L44 "Source code on GitHub")
341387

342388
Constructs a URL query string for JSON:API parameters
343389

@@ -365,7 +411,7 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
365411

366412
### serialise
367413

368-
[packages/kitsu-core/src/serialise/index.js:210-221](https://github.com/wopian/kitsu/blob/e1b988cb961081f12309f5e881d63d123be7f4cf/packages/kitsu-core/src/serialise/index.js#L210-L221 "Source code on GitHub")
414+
[packages/kitsu-core/src/serialise/index.js:210-221](https://github.com/wopian/kitsu/blob/b34d85434473d745bfc9ce5784704ddc3855dd3c/packages/kitsu-core/src/serialise/index.js#L210-L221 "Source code on GitHub")
369415

370416
Serialises an object into a JSON-API structure
371417

@@ -409,9 +455,27 @@ const output = serialise(model, obj, 'PATCH')
409455

410456
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** The serialised data
411457

458+
### snake
459+
460+
[packages/kitsu-core/src/snake/index.js:11-11](https://github.com/wopian/kitsu/blob/b34d85434473d745bfc9ce5784704ddc3855dd3c/packages/kitsu-core/src/snake/index.js#L11-L11 "Source code on GitHub")
461+
462+
Converts camelCase into snake_case
463+
464+
#### Parameters
465+
466+
- `input` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** camelCase string
467+
468+
#### Examples
469+
470+
```javascript
471+
snake('helloWorld') // 'hello_world'
472+
```
473+
474+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** snake_case formatted string
475+
412476
### splitModel
413477

414-
[packages/kitsu-core/src/splitModel/index.js:29-39](https://github.com/wopian/kitsu/blob/e1b988cb961081f12309f5e881d63d123be7f4cf/packages/kitsu-core/src/splitModel/index.js#L29-L39 "Source code on GitHub")
478+
[packages/kitsu-core/src/splitModel/index.js:29-39](https://github.com/wopian/kitsu/blob/b34d85434473d745bfc9ce5784704ddc3855dd3c/packages/kitsu-core/src/splitModel/index.js#L29-L39 "Source code on GitHub")
415479

416480
Split model name from the model's resource URL
417481

@@ -451,67 +515,3 @@ splitModel('libraryEntries', { resourceCase: snake })
451515
```
452516

453517
Returns **\[[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String), [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)]** } Array containing the model name and the resource URL with pluralisation applied
454-
455-
### camel
456-
457-
[packages/kitsu-core/src/camel/index.js:14-14](https://github.com/wopian/kitsu/blob/e1b988cb961081f12309f5e881d63d123be7f4cf/packages/kitsu-core/src/camel/index.js#L14-L14 "Source code on GitHub")
458-
459-
Converts kebab-case and snake_case into camelCase
460-
461-
#### Parameters
462-
463-
- `input` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** String to convert
464-
465-
#### Examples
466-
467-
Convert kebab-case
468-
469-
470-
```javascript
471-
camel('hello-world') // 'helloWorld'
472-
```
473-
474-
Convert snake_case
475-
476-
477-
```javascript
478-
camel('hello_world') // 'helloWorld'
479-
```
480-
481-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** camelCase formatted string
482-
483-
### kebab
484-
485-
[packages/kitsu-core/src/kebab/index.js:11-11](https://github.com/wopian/kitsu/blob/e1b988cb961081f12309f5e881d63d123be7f4cf/packages/kitsu-core/src/kebab/index.js#L11-L11 "Source code on GitHub")
486-
487-
Converts camelCase into kebab-case
488-
489-
#### Parameters
490-
491-
- `input` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** camelCase string
492-
493-
#### Examples
494-
495-
```javascript
496-
kebab('helloWorld') // 'hello-world'
497-
```
498-
499-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** kebab-case formatted string
500-
501-
### snake
502-
503-
[packages/kitsu-core/src/snake/index.js:11-11](https://github.com/wopian/kitsu/blob/e1b988cb961081f12309f5e881d63d123be7f4cf/packages/kitsu-core/src/snake/index.js#L11-L11 "Source code on GitHub")
504-
505-
Converts camelCase into snake_case
506-
507-
#### Parameters
508-
509-
- `input` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** camelCase string
510-
511-
#### Examples
512-
513-
```javascript
514-
snake('helloWorld') // 'hello_world'
515-
```
516-
517-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** snake_case formatted string
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
declare function _default(input: string): string;
2-
export default _default;
1+
export function camel(input: string): string;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
export * from "./camel";
12
export * from "./deattribute";
23
export * from "./deserialise";
34
export * from "./error";
45
export * from "./filterIncludes";
6+
export * from "./kebab";
57
export * from "./linkRelationships";
68
export * from "./query";
79
export * from "./serialise";
10+
export * from "./snake";
811
export * from "./splitModel";
9-
export { default as camel } from "./camel";
10-
export { default as kebab } from "./kebab";
11-
export { default as snake } from "./snake";
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
declare function _default(input: string): string;
2-
export default _default;
1+
export function kebab(input: string): string;
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
declare function _default(input: string): string;
2-
export default _default;
1+
export function snake(input: string): string;

0 commit comments

Comments
 (0)