@techmely/utils
Version:
Collection of helpful JavaScript / TypeScript utils
16 lines (11 loc) • 328 B
JavaScript
;
/*!
* @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);
}
exports.get = get;