@orpc/shared
Advanced tools
Comparing version 0.0.3 to 0.0.4
import { isPlainObject } from "is-what"; | ||
import { isPlainObject as isPlainObject2 } from "is-what"; | ||
import { guard, mapEntries, omit, trim } from "radash"; | ||
import { guard, mapEntries, mapValues, omit, trim } from "radash"; | ||
function parseJSONSafely(text) { | ||
@@ -28,5 +28,11 @@ if (text === "") return void 0; | ||
for (const segment of segments) { | ||
if (typeof currentRef !== "object" && typeof currentRef !== "function" || currentRef === null) { | ||
return void 0; | ||
} | ||
currentRef = currentRef[preSegment]; | ||
preSegment = segment; | ||
} | ||
if (typeof currentRef !== "object" && typeof currentRef !== "function" || currentRef === null) { | ||
return void 0; | ||
} | ||
return currentRef[preSegment]; | ||
@@ -55,2 +61,3 @@ } | ||
mapEntries, | ||
mapValues, | ||
omit, | ||
@@ -57,0 +64,0 @@ parseJSONSafely, |
@@ -5,3 +5,3 @@ export type * from 'type-fest'; | ||
export { isPlainObject } from 'is-what'; | ||
export { guard, trim, mapEntries, omit } from 'radash'; | ||
export { guard, trim, mapEntries, omit, mapValues } from 'radash'; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@orpc/shared", | ||
"type": "module", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "unnoq", |
@@ -7,2 +7,2 @@ export type * from 'type-fest' | ||
export { isPlainObject } from 'is-what' | ||
export { guard, trim, mapEntries, omit } from 'radash' | ||
export { guard, trim, mapEntries, omit, mapValues } from 'radash' |
@@ -35,2 +35,9 @@ import { isPlainObject } from 'is-what' | ||
for (const segment of segments) { | ||
if ( | ||
(typeof currentRef !== 'object' && typeof currentRef !== 'function') || | ||
currentRef === null | ||
) { | ||
return undefined | ||
} | ||
currentRef = currentRef[preSegment] | ||
@@ -40,2 +47,9 @@ preSegment = segment | ||
if ( | ||
(typeof currentRef !== 'object' && typeof currentRef !== 'function') || | ||
currentRef === null | ||
) { | ||
return undefined | ||
} | ||
return currentRef[preSegment] | ||
@@ -42,0 +56,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
73123
395