We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a48312e commit 362cbf6Copy full SHA for 362cbf6
dashi/src/lib/utils/objPath.ts
@@ -61,13 +61,18 @@ export function _setValue<S extends object>(
61
return obj;
62
}
63
64
-export function toObjPath(property: ObjPath | string): ObjPath {
+export function toObjPath(
65
+ property: ObjPath | string | number | undefined | null,
66
+): ObjPath {
67
if (Array.isArray(property)) {
68
return property as ObjPath;
69
- if (property === "") {
70
+ if (property === "" || !property) {
71
return [];
72
73
+ if (typeof property === "number") {
74
+ return [property];
75
+ }
76
const objPath: ObjPath = property.split(".");
77
for (let i = 0; i < objPath.length; i++) {
78
const index = Number(objPath[i]);
0 commit comments