@chubbyts/chubbyts-decode-encode 2.4.0 → 2.4.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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # chubbyts-decode-encode
2
2
 
3
- [![CI](https://github.com/chubbyts/chubbyts-decode-encode/workflows/CI/badge.svg?branch=master)](https://github.com/chubbyts/chubbyts-decode-encode/actions?query=workflow%3ACI)
3
+ [![CI](https://github.com/chubbyts/chubbyts-decode-encode/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/chubbyts/chubbyts-decode-encode/actions/workflows/ci.yml)
4
4
  [![Coverage Status](https://coveralls.io/repos/github/chubbyts/chubbyts-decode-encode/badge.svg?branch=master)](https://coveralls.io/github/chubbyts/chubbyts-decode-encode?branch=master)
5
5
  [![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fchubbyts%2Fchubbyts-decode-encode%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/chubbyts/chubbyts-decode-encode/master)
6
6
  [![npm-version](https://img.shields.io/npm/v/@chubbyts/chubbyts-decode-encode.svg)](https://www.npmjs.com/package/@chubbyts/chubbyts-decode-encode)
@@ -24,18 +24,18 @@ A simple decode/encode solution for json / jsonx / url-encoded / xml / yaml.
24
24
  ## Requirements
25
25
 
26
26
  * node: 22
27
- * [@chubbyts/chubbyts-throwable-to-error][2]: ^2.2.0
27
+ * [@chubbyts/chubbyts-throwable-to-error][2]: ^2.3.0
28
28
  * [fast-xml-builder][3]: ^1.3.0
29
- * [fast-xml-parser][4]: ^5.7.3
30
- * [qs][5]: ^6.15.1
31
- * [yaml][6]: ^2.8.4
29
+ * [fast-xml-parser][4]: ^5.10.1
30
+ * [qs][5]: ^6.15.3
31
+ * [yaml][6]: ^2.9.0
32
32
 
33
33
  ## Installation
34
34
 
35
35
  Through [NPM](https://www.npmjs.com) as [@chubbyts/chubbyts-decode-encode][1].
36
36
 
37
37
  ```ts
38
- npm i @chubbyts/chubbyts-decode-encode@^2.4.0
38
+ npm i @chubbyts/chubbyts-decode-encode@^2.4.1
39
39
  ```
40
40
 
41
41
  ## Usage
package/dist/data.js CHANGED
@@ -3,4 +3,12 @@ export const isBoolean = (value) => typeof value === 'boolean';
3
3
  export const isNumber = (value) => typeof value === 'number';
4
4
  export const isString = (value) => typeof value === 'string';
5
5
  export const isArray = (value) => Array.isArray(value);
6
- export const isObject = (value) => value !== null && typeof value === 'object' && value.constructor.name == 'Object';
6
+ export const isObject = (value) => {
7
+ if (value === null || typeof value !== 'object') {
8
+ return false;
9
+ }
10
+ // prototype based check: constructor based checks crash on null prototype objects (Object.create(null))
11
+ // and can be shadowed by an attacker controlled own "constructor" property (e.g. {"constructor": 1})
12
+ const prototype = Object.getPrototypeOf(value);
13
+ return prototype === Object.prototype || prototype === null;
14
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chubbyts/chubbyts-decode-encode",
3
3
  "type": "module",
4
- "version": "2.4.0",
4
+ "version": "2.4.1",
5
5
  "description": "A simple decode/encode solution for json / jsonx / url-encoded / xml / yaml.",
6
6
  "keywords": [
7
7
  "chubbyts",
@@ -15,7 +15,10 @@
15
15
  ],
16
16
  "author": "Dominik Zogg",
17
17
  "license": "MIT",
18
- "repository": "chubbyts/chubbyts-decode-encode",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "chubbyts/chubbyts-decode-encode"
21
+ },
19
22
  "prettier": {
20
23
  "printWidth": 120,
21
24
  "tabWidth": 2,
@@ -51,21 +54,21 @@
51
54
  "node": ">=22"
52
55
  },
53
56
  "dependencies": {
54
- "@chubbyts/chubbyts-throwable-to-error": "^2.2.0",
57
+ "@chubbyts/chubbyts-throwable-to-error": "^2.3.0",
55
58
  "fast-xml-builder": "^1.3.0",
56
- "fast-xml-parser": "^5.7.3",
57
- "qs": "^6.15.1",
58
- "yaml": "^2.8.4"
59
+ "fast-xml-parser": "^5.10.1",
60
+ "qs": "^6.15.3",
61
+ "yaml": "^2.9.0"
59
62
  },
60
63
  "devDependencies": {
61
64
  "@chubbyts/chubbyts-function-mock": "^2.3.0",
62
65
  "@chubbyts/chubbyts-oxlint": "^1.0.0",
63
66
  "@stryker-mutator/core": "^9.6.1",
64
67
  "@stryker-mutator/vitest-runner": "^9.6.1",
65
- "@types/node": "^26.1.1",
68
+ "@types/node": "^26.1.2",
66
69
  "@types/qs": "^6.15.1",
67
70
  "@vitest/coverage-v8": "^4.1.10",
68
- "oxlint": "^1.75.0",
71
+ "oxlint": "^1.76.0",
69
72
  "prettier": "^3.9.6",
70
73
  "typescript": "^7.0.2",
71
74
  "vitest": "^4.1.10"