You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/kitsu-core/README.md
+31-31Lines changed: 31 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,13 +116,13 @@ kitsuCore.camel(...)
116
116
117
117
### deattribute
118
118
119
-
[packages/kitsu-core/src/deattribute/index.js:29-51](https://github.com/wopian/kitsu/blob/570ef11d4ba811a0bf77a9e018d86f87ba6da961/packages/kitsu-core/src/deattribute/index.js#L29-L51"Source code on GitHub")
119
+
[packages/kitsu-core/src/deattribute/index.js:29-51](https://github.com/wopian/kitsu/blob/95eb9c1315f3ef229c3374e740e6af024b3ab60a/packages/kitsu-core/src/deattribute/index.js#L29-L51"Source code on GitHub")
120
120
121
121
Hoists attributes to be top-level
122
122
123
123
#### Parameters
124
124
125
-
-`data`**([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)\|[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array))** Resource data
125
+
-`data`**([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)\|[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>)** Resource data
Returns **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)\|[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array))** Deattributed resource data
159
+
Returns **([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)\|[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>)** Deattributed resource data
160
160
161
161
### deserialise
162
162
163
-
[packages/kitsu-core/src/deserialise/index.js:57-72](https://github.com/wopian/kitsu/blob/570ef11d4ba811a0bf77a9e018d86f87ba6da961/packages/kitsu-core/src/deserialise/index.js#L57-L72"Source code on GitHub")
163
+
[packages/kitsu-core/src/deserialise/index.js:57-72](https://github.com/wopian/kitsu/blob/95eb9c1315f3ef229c3374e740e6af024b3ab60a/packages/kitsu-core/src/deserialise/index.js#L57-L72"Source code on GitHub")
[packages/kitsu-core/src/error/index.js:27-33](https://github.com/wopian/kitsu/blob/570ef11d4ba811a0bf77a9e018d86f87ba6da961/packages/kitsu-core/src/error/index.js#L27-L33"Source code on GitHub")
215
+
[packages/kitsu-core/src/error/index.js:27-33](https://github.com/wopian/kitsu/blob/95eb9c1315f3ef229c3374e740e6af024b3ab60a/packages/kitsu-core/src/error/index.js#L27-L33"Source code on GitHub")
216
216
217
217
Uniform error handling for Axios, JSON:API and internal package errors. Mutated Error object is rethrown to the caller.
218
218
219
219
#### Parameters
220
220
221
-
-`E`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** The Error
221
+
-`Error`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** The Error
222
222
223
223
#### Examples
224
224
@@ -249,13 +249,13 @@ error({
249
249
250
250
### filterIncludes
251
251
252
-
[packages/kitsu-core/src/filterIncludes/index.js:33-46](https://github.com/wopian/kitsu/blob/570ef11d4ba811a0bf77a9e018d86f87ba6da961/packages/kitsu-core/src/filterIncludes/index.js#L33-L46"Source code on GitHub")
252
+
[packages/kitsu-core/src/filterIncludes/index.js:33-46](https://github.com/wopian/kitsu/blob/95eb9c1315f3ef229c3374e740e6af024b3ab60a/packages/kitsu-core/src/filterIncludes/index.js#L33-L46"Source code on GitHub")
253
253
254
254
Filters includes for the specific relationship requested
255
255
256
256
#### Parameters
257
257
258
-
-`included`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** The response included object
258
+
-`included`**[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>** The response included object
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** The matched includes
287
+
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>** The matched includes
288
288
289
289
### linkRelationships
290
290
291
-
[packages/kitsu-core/src/linkRelationships/index.js:97-117](https://github.com/wopian/kitsu/blob/570ef11d4ba811a0bf77a9e018d86f87ba6da961/packages/kitsu-core/src/linkRelationships/index.js#L97-L117"Source code on GitHub")
291
+
[packages/kitsu-core/src/linkRelationships/index.js:97-117](https://github.com/wopian/kitsu/blob/95eb9c1315f3ef229c3374e740e6af024b3ab60a/packages/kitsu-core/src/linkRelationships/index.js#L97-L117"Source code on GitHub")
292
292
293
293
Links relationships to included data
294
294
295
295
#### Parameters
296
296
297
297
-`data`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** The response data object
298
-
-`included`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** The response included object (optional, default `[]`)
298
+
-`included`**[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>?** The response included object (optional, default `[]`)
299
299
300
300
#### Examples
301
301
@@ -326,14 +326,14 @@ Returns **any** Parsed data
326
326
327
327
### query
328
328
329
-
[packages/kitsu-core/src/query/index.js:33-44](https://github.com/wopian/kitsu/blob/570ef11d4ba811a0bf77a9e018d86f87ba6da961/packages/kitsu-core/src/query/index.js#L33-L44"Source code on GitHub")
329
+
[packages/kitsu-core/src/query/index.js:33-44](https://github.com/wopian/kitsu/blob/95eb9c1315f3ef229c3374e740e6af024b3ab60a/packages/kitsu-core/src/query/index.js#L33-L44"Source code on GitHub")
330
330
331
331
Constructs a URL query string for JSON:API parameters
332
332
333
333
#### Parameters
334
334
335
-
-`params`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Parameters to parse
336
-
-`prefix`**[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Prefix for nested parameters - used internally (default `null`) (optional, default `null`)
335
+
-`params`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Parameters to parse
336
+
-`prefix`**[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Prefix for nested parameters - used internally (optional, default `null`)
[packages/kitsu-core/src/serialise/index.js:193-204](https://github.com/wopian/kitsu/blob/570ef11d4ba811a0bf77a9e018d86f87ba6da961/packages/kitsu-core/src/serialise/index.js#L193-L204"Source code on GitHub")
357
+
[packages/kitsu-core/src/serialise/index.js:191-202](https://github.com/wopian/kitsu/blob/95eb9c1315f3ef229c3374e740e6af024b3ab60a/packages/kitsu-core/src/serialise/index.js#L191-L202"Source code on GitHub")
358
358
359
359
Serialises an object into a JSON-API structure
360
360
361
361
#### Parameters
362
362
363
363
-`type`**[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Resource type
364
-
-`data`**([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)\|[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array))** The data (optional, default `{}`)
365
-
-`method`**[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Request type (PATCH, POST, DELETE) (optional, default `'POST'`)
366
-
-`options`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Optional configuration for camelCase and pluralisation handling (optional, default `{}`)
367
-
-`options.camelCaseTypes`**[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Convert library-entries and library_entries to libraryEntries (default no conversion). To use parameter, import camel from kitsu-core
368
-
-`options.pluralTypes`**[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Pluralise types (default no pluralisation). To use parameter, import pluralize (or another pluralisation npm package)
364
+
-`data`**([Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)\|[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)>)?** The data (optional, default `{}`)
365
+
-`method`**[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Request type (PATCH, POST, DELETE) (optional, default `'POST'`)
366
+
-`options`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Optional configuration for camelCase and pluralisation handling (optional, default `{}`)
367
+
-`options.camelCaseTypes`**[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Convert library-entries and library_entries to libraryEntries (default no conversion). To use parameter, import camel from kitsu-core (optional, default `s=>s`)
368
+
-`options.pluralTypes`**[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Pluralise types (default no pluralisation). To use parameter, import pluralize (or another pluralisation npm package) (optional, default `s=>s`)
[packages/kitsu-core/src/splitModel/index.js:29-39](https://github.com/wopian/kitsu/blob/570ef11d4ba811a0bf77a9e018d86f87ba6da961/packages/kitsu-core/src/splitModel/index.js#L29-L39"Source code on GitHub")
403
+
[packages/kitsu-core/src/splitModel/index.js:29-39](https://github.com/wopian/kitsu/blob/95eb9c1315f3ef229c3374e740e6af024b3ab60a/packages/kitsu-core/src/splitModel/index.js#L29-L39"Source code on GitHub")
404
404
405
405
Split model name from the model's resource URL
406
406
407
407
#### Parameters
408
408
409
409
-`url`**[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** URL path for the model
-`options.resourceCase`**[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Convert libraryEntries to library-entries or library_entries (default no conversion). To use parameter, import kebab or snake from kitsu-core
412
-
-`options.pluralModel`**[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Pluralise models (default no pluralisation). To use parameter, import pluralize (or another pluralisation npm package)
-`options.resourceCase`**[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Convert libraryEntries to library-entries or library_entries (default no conversion). To use parameter, import kebab or snake from kitsu-core (optional, default `s=>s`)
412
+
-`options.pluralModel`**[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** Pluralise models (default no pluralisation). To use parameter, import pluralize (or another pluralisation npm package)
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** Array containing the model name and the resource URL with pluralisation applied
442
+
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
443
443
444
444
### camel
445
445
446
-
[packages/kitsu-core/src/camel/index.js:14-14](https://github.com/wopian/kitsu/blob/570ef11d4ba811a0bf77a9e018d86f87ba6da961/packages/kitsu-core/src/camel/index.js#L14-L14"Source code on GitHub")
446
+
[packages/kitsu-core/src/camel/index.js:14-14](https://github.com/wopian/kitsu/blob/95eb9c1315f3ef229c3374e740e6af024b3ab60a/packages/kitsu-core/src/camel/index.js#L14-L14"Source code on GitHub")
447
447
448
448
Converts kebab-case and snake_case into camelCase
449
449
450
450
#### Parameters
451
451
452
-
-`s`**[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** String to convert
452
+
-`input`**[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** String to convert
[packages/kitsu-core/src/kebab/index.js:11-11](https://github.com/wopian/kitsu/blob/570ef11d4ba811a0bf77a9e018d86f87ba6da961/packages/kitsu-core/src/kebab/index.js#L11-L11"Source code on GitHub")
474
+
[packages/kitsu-core/src/kebab/index.js:11-11](https://github.com/wopian/kitsu/blob/95eb9c1315f3ef229c3374e740e6af024b3ab60a/packages/kitsu-core/src/kebab/index.js#L11-L11"Source code on GitHub")
[packages/kitsu-core/src/snake/index.js:11-11](https://github.com/wopian/kitsu/blob/570ef11d4ba811a0bf77a9e018d86f87ba6da961/packages/kitsu-core/src/snake/index.js#L11-L11"Source code on GitHub")
492
+
[packages/kitsu-core/src/snake/index.js:11-11](https://github.com/wopian/kitsu/blob/95eb9c1315f3ef229c3374e740e6af024b3ab60a/packages/kitsu-core/src/snake/index.js#L11-L11"Source code on GitHub")
0 commit comments