MCPcopy Index your code
hub / github.com/ajatkj/scriptable / wrapText

Function wrapText

LSWeather.js:922–924  ·  view source on GitHub ↗
(s, w)

Source from the content-addressed store, hash-verified

920 let quoteWithAuthor = [];
921 // Wrap text
922 let wrapText = (s, w) => s.replace(
923 new RegExp(`(?![^\\n]{1,${w}}$)([^\\n]{1,${w}})\\s`, 'g'), ' $1| '
924 );
925 quoteWithAuthor = wrapText(response.content,QUOTE_WRAP_LENGTH).split('|');
926 quoteWithAuthor.push({rsize: DETAIL_RSIZE, title: "[" + response.author + "]"});
927 return {

Callers 3

fetchQuotesFunction · 0.70
weatherTextFunction · 0.70
calendarTextFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected