mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2024-11-30 13:44:45 +01:00
1 line
No EOL
1.2 KiB
Text
1 line
No EOL
1.2 KiB
Text
{"version":3,"sources":["../src/index.js"],"names":["Wcwidth","require","module","exports","word","breakAtLength","charArr","index","indexOfLastFitChar","fittableLength","length","char","shift","currentLength"],"mappings":";;;;AAAA,IAAIA,UAAUC,QAAQ,SAAR,CAAd;AACAC,OAAOC,OAAP,GAAiB,UAASC,IAAT,EAAcC,aAAd,EAA4B;AAC5C,KAAIC,uCAAcF,IAAd,EAAJ;AACA,KAAIG,QAAQ,CAAZ;AACA,KAAIC,qBAAqB,CAAzB;AACA,KAAIC,iBAAiB,CAArB;AACA,QAAMH,QAAQI,MAAR,GAAiB,CAAvB,EAAyB;AACxB,MAAIC,OAAOL,QAAQM,KAAR,EAAX;AACA,MAAIC,gBAAgBJ,iBAAiBT,QAAQW,IAAR,CAArC;AACA,MAAGE,iBAAiBR,aAApB,EAAkC;AACjCG,wBAAqBD,KAArB;AACAE,oBAAiBI,aAAjB;AACAN;AACA,GAJD,MAKI;AACH;AACA;AACD;AACD;AACA,QAAOC,kBAAP;AACA,CAnBD","file":"index.js","sourcesContent":["var Wcwidth = require('wcwidth');\nmodule.exports = function(word,breakAtLength){\n\tvar charArr = [...word];\n\tvar index = 0;\n\tvar indexOfLastFitChar = 0;\n\tvar fittableLength = 0;\n\twhile(charArr.length > 0){\n\t\tvar char = charArr.shift();\n\t\tvar currentLength = fittableLength + Wcwidth(char);\n\t\tif(currentLength <= breakAtLength){\n\t\t\tindexOfLastFitChar = index;\n\t\t\tfittableLength = currentLength;\n\t\t\tindex++;\n\t\t}\n\t\telse{\n\t\t\tbreak;\n\t\t}\n\t}\n\t//break after this character\n\treturn indexOfLastFitChar;\n};\n"]} |