@wooksjs/http-body 0.4.27 → 0.4.28

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/dist/index.cjs CHANGED
@@ -47,8 +47,8 @@ function useBody() {
47
47
  const contentEncodings = () => init('contentEncodings', () => (contentEncoding || '')
48
48
  .split(',')
49
49
  .map(p => p.trim())
50
- .filter(Boolean));
51
- const parseBody = async () => init('parsed', async () => {
50
+ .filter(p => !!p));
51
+ const parseBody = () => init('parsed', async () => {
52
52
  const body = await uncompressBody(contentEncodings(), (await rawBody()).toString());
53
53
  if (isJson()) {
54
54
  return jsonParser(body);
@@ -106,7 +106,7 @@ function useBody() {
106
106
  }
107
107
  else {
108
108
  if (!line || line === '--') {
109
- valueMode = Boolean(key);
109
+ valueMode = !!key;
110
110
  if (valueMode) {
111
111
  key = key.replace(/^["']/, '').replace(/["']$/, '');
112
112
  }
package/dist/index.mjs CHANGED
@@ -45,8 +45,8 @@ function useBody() {
45
45
  const contentEncodings = () => init('contentEncodings', () => (contentEncoding || '')
46
46
  .split(',')
47
47
  .map(p => p.trim())
48
- .filter(Boolean));
49
- const parseBody = async () => init('parsed', async () => {
48
+ .filter(p => !!p));
49
+ const parseBody = () => init('parsed', async () => {
50
50
  const body = await uncompressBody(contentEncodings(), (await rawBody()).toString());
51
51
  if (isJson()) {
52
52
  return jsonParser(body);
@@ -104,7 +104,7 @@ function useBody() {
104
104
  }
105
105
  else {
106
106
  if (!line || line === '--') {
107
- valueMode = Boolean(key);
107
+ valueMode = !!key;
108
108
  if (valueMode) {
109
109
  key = key.replace(/^["']/, '').replace(/["']$/, '');
110
110
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wooksjs/http-body",
3
- "version": "0.4.27",
3
+ "version": "0.4.28",
4
4
  "description": "@wooksjs/http-body",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -39,7 +39,7 @@
39
39
  "url": "https://github.com/wooksjs/wooksjs/issues"
40
40
  },
41
41
  "peerDependencies": {
42
- "@wooksjs/event-http": "0.4.27"
42
+ "@wooksjs/event-http": "0.4.28"
43
43
  },
44
44
  "homepage": "https://github.com/wooksjs/wooksjs/tree/main/packages/http-body#readme"
45
45
  }