MCPcopy Index your code
hub / github.com/tensorflow/tfjs-examples / limitStringToLength

Function limitStringToLength

electron/renderer.js:163–169  ·  view source on GitHub ↗

Helper method for limiting the number of characters shown on screen.

(str, limit = 50)

Source from the content-addressed store, hash-verified

161
162/** Helper method for limiting the number of characters shown on screen. */
163function limitStringToLength(str, limit = 50) {
164 if (str.length <= limit) {
165 return str;
166 } else {
167 return `...${str.slice(str.length - limit)}`;
168 }
169}
170
171/**
172 * Create and material-design card for a search match and add

Callers 1

createFoundCardFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected