UNPKG

551 BJavaScriptView Raw
1export const MAX_TYPE_SUMMARY_LENGTH = 90;
2export const MAX_DEFAULT_VALUE_SUMMARY_LENGTH = 50;
3export function isTooLongForTypeSummary(value) {
4 return value.length > MAX_TYPE_SUMMARY_LENGTH;
5}
6export function isTooLongForDefaultValueSummary(value) {
7 return value.length > MAX_DEFAULT_VALUE_SUMMARY_LENGTH;
8}
9export function createSummaryValue(summary, detail) {
10 if (summary === detail) {
11 return {
12 summary
13 };
14 }
15
16 return {
17 summary,
18 detail
19 };
20}
21export const normalizeNewlines = string => string.replace(/\\r\\n/g, '\\n');
\No newline at end of file