@valkyriestudios/utils 8.2.0 → 8.3.0
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/CHANGELOG.md +11 -0
- package/deep/get.js +1 -1
- package/package.json +4 -3
- package/src/deep/get.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic
|
|
6
6
|
Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [8.3.0] - 2023-12-06
|
|
9
|
+
### Added
|
|
10
|
+
- Dev Dep: babel-plugin-module-extension@0.1.3
|
|
11
|
+
|
|
12
|
+
### Improved
|
|
13
|
+
- Dev Dep: Upgrade eslint to 8.55.0
|
|
14
|
+
- Rerun benchmark for v8 on intel i9
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- deep/get: Fix edge case issue where cursor is not an object or array when parts still exist afterwards
|
|
18
|
+
|
|
8
19
|
## [8.2.0] - 2023-11-29
|
|
9
20
|
### Improved
|
|
10
21
|
- Dev Dep: Upgrade @babel/core to 7.23.5
|
package/deep/get.js
CHANGED
|
@@ -20,7 +20,7 @@ function deepGet(obj, path) {
|
|
|
20
20
|
var ix = parseInt(parts.shift());
|
|
21
21
|
if (!Number.isInteger(ix) || ix < 0 || ix > cursor.length - 1) return undefined;
|
|
22
22
|
cursor = cursor[ix];
|
|
23
|
-
} else {
|
|
23
|
+
} else if (Object.prototype.toString.call(cursor) === _is.PROTO_OBJ) {
|
|
24
24
|
var key = parts.shift();
|
|
25
25
|
if (!cursor.hasOwnProperty(key)) return undefined;
|
|
26
26
|
cursor = cursor[key];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valkyriestudios/utils",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.0",
|
|
4
4
|
"description": "A collection of single-function utilities for common tasks",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"lint": "npm run lint:src && npm run lint:test",
|
|
24
24
|
"lint:src": "./node_modules/.bin/eslint --ext .js,.mjs ./src",
|
|
25
25
|
"lint:test": "./node_modules/.bin/eslint --ext .js,.mjs ./test",
|
|
26
|
-
"build": "npm run lint && npm run test:coverage &&
|
|
26
|
+
"build": "npm run lint && npm run test:coverage && npx babel src --out-dir ./",
|
|
27
27
|
"codecov": "codecov"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
|
@@ -39,9 +39,10 @@
|
|
|
39
39
|
"@babel/core": "^7.23.5",
|
|
40
40
|
"@babel/preset-env": "^7.23.5",
|
|
41
41
|
"@babel/register": "^7.22.15",
|
|
42
|
+
"babel-plugin-module-extension": "^0.1.3",
|
|
42
43
|
"babel-plugin-transform-minify-booleans": "^6.9.4",
|
|
43
44
|
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
44
45
|
"c8": "^8.0.1",
|
|
45
|
-
"eslint": "^8.
|
|
46
|
+
"eslint": "^8.55.0"
|
|
46
47
|
}
|
|
47
48
|
}
|
package/src/deep/get.mjs
CHANGED
|
@@ -32,7 +32,7 @@ export default function deepGet (obj, path, get_parent = false) {
|
|
|
32
32
|
const ix = parseInt(parts.shift());
|
|
33
33
|
if (!Number.isInteger(ix) || ix < 0 || ix > (cursor.length - 1)) return undefined;
|
|
34
34
|
cursor = cursor[ix];
|
|
35
|
-
} else {
|
|
35
|
+
} else if (Object.prototype.toString.call(cursor) === PROTO_OBJ) {
|
|
36
36
|
const key = parts.shift();
|
|
37
37
|
if (!cursor.hasOwnProperty(key)) return undefined;
|
|
38
38
|
cursor = cursor[key];
|