From eb47b05fe4cbaf07d6c80ac997254134bae9e246 Mon Sep 17 00:00:00 2001 From: Anton Date: Sat, 6 Jan 2024 13:35:08 +0100 Subject: [PATCH] move getValue to utils --- src/Utils/GetValue.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/Utils/GetValue.ts diff --git a/src/Utils/GetValue.ts b/src/Utils/GetValue.ts new file mode 100644 index 00000000..f4003921 --- /dev/null +++ b/src/Utils/GetValue.ts @@ -0,0 +1,8 @@ +export function getValue(obj, path) { + if (obj) { + for (var i = 0, path = path.split('.'), len = path.length; i < len; i++) { + obj = obj[path[i]]; + }; + return obj; + } +}; \ No newline at end of file