/** * This class contains methods to handle this application JSON data.
*/
export defaultclass JsonUtils {
/** * Parses an input, checks whether this input is valid and returns a JSON object. * * @param input - the input to parse * @returns {object} - if the input is a valid JSON object returns an object
*/ static parse(input) { if (!input) return; if (typeof input === 'string') {
let jsonRegex = /{(?:[^])*}/g;
let match = jsonRegex.exec(input); if (match) {
input = JSON.parse(match[0]);
} else {
input = {output: input};
}
} return input;
}
/** * Returns a static string representing the mime type supported by this package * * @returns {string} constant string 'application/vnd.francy+json'
*/ static get MIME() { return'application/vnd.francy+json';
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.