UNPKG

@techmely/utils

Version:

Collection of helpful JavaScript / TypeScript utils

14 lines (10 loc) 310 B
/*! * @techmely/utils * Copyright(c) 2021-2024 Techmely <techmely.creation@gmail.com> * MIT Licensed */ // src/get/index.ts function get(from, selector) { return selector.replace(/\[([^\[\]]*)\]/g, ".$1.").split(".").filter((t) => t !== "").reduce((acc, curr) => acc?.[curr], from); } export { get };