@middy/http-content-negotiation 2.5.6 → 3.0.0-alpha.3

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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017-2021 Luciano Mammino, will Farrell and the [Middy team](https://github.com/middyjs/middy/graphs/contributors)
3
+ Copyright (c) 2017-2022 Luciano Mammino, will Farrell and the [Middy team](https://github.com/middyjs/middy/graphs/contributors)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -117,7 +117,7 @@ handler
117
117
  }))
118
118
  .use(httpErrorHandler())
119
119
 
120
- module.exports = { handler }
120
+ export default { handler }
121
121
  ```
122
122
 
123
123
 
@@ -133,7 +133,7 @@ Everyone is very welcome to contribute to this repository. Feel free to [raise i
133
133
 
134
134
  ## License
135
135
 
136
- Licensed under [MIT License](LICENSE). Copyright (c) 2017-2021 Luciano Mammino, will Farrell, and the [Middy team](https://github.com/middyjs/middy/graphs/contributors).
136
+ Licensed under [MIT License](LICENSE). Copyright (c) 2017-2022 Luciano Mammino, will Farrell, and the [Middy team](https://github.com/middyjs/middy/graphs/contributors).
137
137
 
138
138
  <a href="https://app.fossa.io/projects/git%2Bgithub.com%2Fmiddyjs%2Fmiddy?ref=badge_large">
139
139
  <img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmiddyjs%2Fmiddy.svg?type=large" alt="FOSSA Status" style="max-width:100%;">
package/index.js CHANGED
@@ -1,7 +1,8 @@
1
- const charset = require('negotiator/lib/charset.js')
2
- const encoding = require('negotiator/lib/encoding.js')
3
- const language = require('negotiator/lib/language.js')
4
- const mediaType = require('negotiator/lib/mediaType.js')
1
+ import charset from 'negotiator/lib/charset.js'
2
+ import encoding from 'negotiator/lib/encoding.js'
3
+ import language from 'negotiator/lib/language.js'
4
+ import mediaType from 'negotiator/lib/mediaType.js'
5
+ import { createError } from '@middy/util'
5
6
 
6
7
  const parseFn = {
7
8
  Charset: charset,
@@ -89,10 +90,9 @@ const parseHeader = (
89
90
  event[resultName] = event[resultsName][0]
90
91
 
91
92
  if (failOnMismatch && event[resultName] === undefined) {
92
- const { createError } = require('@middy/util')
93
93
  // NotAcceptable
94
94
  throw createError(406, `Unsupported ${type}. Acceptable values: ${availableValues.join(', ')}`)
95
95
  }
96
96
  }
97
97
 
98
- module.exports = httpContentNegotiationMiddleware
98
+ export default httpContentNegotiationMiddleware
package/package.json CHANGED
@@ -1,23 +1,25 @@
1
1
  {
2
2
  "name": "@middy/http-content-negotiation",
3
- "version": "2.5.6",
3
+ "version": "3.0.0-alpha.3",
4
4
  "description": "Http content negotiation middleware for the middy framework",
5
- "type": "commonjs",
5
+ "type": "module",
6
6
  "engines": {
7
- "node": ">=12"
7
+ "node": ">=14"
8
8
  },
9
9
  "engineStrict": true,
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
13
- "main": "index.js",
13
+ "exports": "./index.js",
14
14
  "types": "index.d.ts",
15
15
  "files": [
16
+ "index.js",
16
17
  "index.d.ts"
17
18
  ],
18
19
  "scripts": {
19
20
  "test": "npm run test:unit",
20
- "test:unit": "ava"
21
+ "test:unit": "ava",
22
+ "test:benchmark": "node __benchmarks__/index.js"
21
23
  },
22
24
  "license": "MIT",
23
25
  "keywords": [
@@ -46,11 +48,11 @@
46
48
  },
47
49
  "homepage": "https://github.com/middyjs/middy#readme",
48
50
  "dependencies": {
49
- "@middy/util": "^2.5.6",
51
+ "@middy/util": "^3.0.0-alpha.3",
50
52
  "negotiator": "0.6.2"
51
53
  },
52
54
  "devDependencies": {
53
- "@middy/core": "^2.5.6"
55
+ "@middy/core": "^3.0.0-alpha.3"
54
56
  },
55
- "gitHead": "0c789f55b4adf691f977b0d9904d1a805bb3bb2b"
57
+ "gitHead": "1441158711580313765e6d156046ef0fade0d156"
56
58
  }