Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
CodeQL library for JavaScript/TypeScript
codeql/javascript-all 2.6.3 (changelog, source)

Predicate truncate

Gets str or a truncated version of str with explanation appended if its length exceeds maxLength.

For example, the truncation of "long_string" for maxLength = 5 and explanation " ..." is "long_ ...".

Import path

import javascript
string truncate(string str, int maxLength, string explanation)