UNPKG

@rx-angular/cdk

Version:

@rx-angular/cdk is a Component Development Kit for ergonomic and highly performant angular applications. It helps to to build Large scale applications, UI libs, state management, rendering systems and much more. Furthermore the unique way of mixing reacti

20 lines (19 loc) 567 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.readJsonInTree = readJsonInTree; function readJsonInTree(host, path) { if (!host.exists(path)) { throw new Error(`Cannot find ${path}`); } const buffer = host.read(path); if (buffer != null) { const contents = buffer.toString('utf-8'); try { return JSON.parse(contents); } catch (e) { throw new Error(`Cannot parse ${path}: ${e.message}`); } } throw new Error(`cannot read ${path}`); }