MCPcopy Index your code
hub / github.com/easydiffusion/easydiffusion / truncate

Function truncate

ui/plugins/ui/jasmine/jasmine.js:6912–6919  ·  view source on GitHub ↗
(s, maxlen)

Source from the content-addressed store, hash-verified

6910 }
6911
6912 function truncate(s, maxlen) {
6913 if (s.length <= maxlen) {
6914 return { value: s, truncated: false }
6915 }
6916
6917 s = s.substring(0, maxlen - 4) + " ..."
6918 return { value: s, truncated: true }
6919 }
6920
6921 function MaxCharsReachedError() {
6922 this.message = "Exceeded " + j$.MAX_PRETTY_PRINT_CHARS + " characters while pretty-printing a value"

Callers 1

appendMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected