Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
modified: Date.parse(cleaned.modified),
lastPublisher,
owners: (cleaned.owners || []).map(formatUser),
bin: cleaned.bin,
types,
moduleTypes,
lastCrawl: new Date().toISOString(),
_searchInternal: {
alternativeNames,
},
};
const totalSize = sizeof(rawPkg);
if (totalSize > config.maxObjSize) {
const sizeDiff = sizeof(rawPkg.readme) - totalSize;
rawPkg.readme = `${truncate(
rawPkg.readme,
config.maxObjSize - sizeDiff
)} **TRUNCATED**`;
}
return traverse(rawPkg).forEach(maybeEscape);
}
function TruncateAcronym(longText, abbrev, len, targetLanguageBookName) {
const bookName = targetLanguageBookName || longText;
if (bookName.length + abbrev.length + 3 > len) {
return (
<div> {truncateItem( '('.concat(abbrev, ') ', bookName), len + 3) + '...' }
<span>{'('.concat(abbrev, ') ', bookName)}</span>
</div>
);
} else {
return (
<span> {'('.concat(abbrev, ') ', bookName)}</span>
);
}
}