mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 09:03:02 +00:00
feat: migrate to esm
This commit is contained in:
@@ -19,12 +19,12 @@
|
||||
* If the path doesn't exist, undefined is returned.
|
||||
*/
|
||||
export function get<U = unknown>(object: object, path: string): U {
|
||||
return path.split('.').reduce(
|
||||
return path.split(".").reduce(
|
||||
(accumulator, current) =>
|
||||
accumulator?.hasOwnProperty(current)
|
||||
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(accumulator as any)[current]
|
||||
: undefined,
|
||||
object,
|
||||
object
|
||||
) as unknown as U;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user