@boneframework/native-components
Version:
Expo React Native Components for Bone Framework
14 lines (12 loc) • 365 B
text/typescript
const hasJsonStructure = (str) => {
if (typeof str !== 'string') return false;
try {
const result = JSON.parse(str);
const type = Object.prototype.toString.call(result);
return type === '[object Object]'
|| type === '[object Array]';
} catch (err) {
return false;
}
}
export default {hasJsonStructure};