UNPKG

@signaldb/core

Version:

SignalDB is a client-side database that provides a simple MongoDB-like interface to the data with first-class typescript support to achieve an optimistic UI. Data persistence can be achieved by using storage providers that store the data through a JSON in

20 lines (19 loc) 402 B
function get(value, path) { const segments = path.split(/[.[\]]/g); if (segments[0] === "") segments.shift(); if (segments.at(-1) === "") segments.pop(); let current = value; for (const key of segments) { if (current == null || key.trim() === "") return; current = current[key]; } if (current === void 0) return; return current; } export { get as default };