temba 0.12.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +7 -9
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -246,22 +246,20 @@ To change the response body of a `GET` request, configure a `responseBodyInterce
246
246
 
247
247
  ```js
248
248
  const config = {
249
- responseBodyInterceptor: (resourceName, id, responseBody) => {
250
- return resourceName === 'movies' ? {
249
+ responseBodyInterceptor: (resourceName, responseBody, id) => {
250
+ if (resourceName === 'movies') {
251
251
  if (id) {
252
252
  // responseBody is an object
253
253
  return {
254
254
  ...responseBody,
255
255
  stuff: 'more stuff',
256
256
  }
257
- } : {
257
+ } else {
258
258
  // responseBody is an array
259
- return responseBody.map(x => (
260
- {
261
- ...x,
262
- stuff: 'more stuff'
263
- }
264
- ))
259
+ return responseBody.map((x) => ({
260
+ ...x,
261
+ stuff: 'more stuff',
262
+ }))
265
263
  }
266
264
  }
267
265
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "temba",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Get a simple MongoDB REST API with zero coding in less than 30 seconds (seriously).",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {