UNPKG

@yookue/ts-lang-utils

Version:

Common lang utilities for typescript

10 lines 230 B
import _typeof from "@babel/runtime/helpers/esm/typeof"; export function isJsonString(text) { if (!text) { return false; } try { return _typeof(JSON.parse(text)) === 'object'; } catch (ignored) {} return false; }