Sha256: eed67705189534b646a482759dfae4031f2720b7eede9d4d81736ae50b71bac6

Contents?: true

Size: 1.22 KB

Versions: 23

Compression:

Stored size: 1.22 KB

Contents

{"version":3,"sources":["../src/wrapString.js"],"names":["subject","size","subjectSlice","chunks","push","trim"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA;;;;;;;;;;;oBAWgBA,O,EAASC,I,KAAS;AAChC,MAAIC,YAAJ;AAEAA,EAAAA,YAAY,GAAGF,OAAf;AAEA,QAAMG,MAAM,GAAG,EAAf;;AAEA,KAAG;AACDA,IAAAA,MAAM,CAACC,IAAP,CAAY,wBAAMF,YAAN,EAAoB,CAApB,EAAuBD,IAAvB,CAAZ;AAEAC,IAAAA,YAAY,GAAG,wBAAMA,YAAN,EAAoBD,IAApB,EAA0BI,IAA1B,EAAf;AACD,GAJD,QAIS,0BAAYH,YAAZ,CAJT;;AAMA,SAAOC,MAAP;AACD,C","sourcesContent":["import slice from 'slice-ansi';\nimport stringWidth from 'string-width';\n\n/**\n * Creates an array of strings split into groups the length of size.\n * This function works with strings that contain ASCII characters.\n *\n * wrapText is different from would-be \"chunk\" implementation\n * in that whitespace characters that occur on a chunk size limit are trimmed.\n *\n * @param {string} subject\n * @param {number} size\n * @returns {Array}\n */\nexport default (subject, size) => {\n  let subjectSlice;\n\n  subjectSlice = subject;\n\n  const chunks = [];\n\n  do {\n    chunks.push(slice(subjectSlice, 0, size));\n\n    subjectSlice = slice(subjectSlice, size).trim();\n  } while (stringWidth(subjectSlice));\n\n  return chunks;\n};\n"],"file":"wrapString.js"}

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
trusty-cms-5.0.7 node_modules/table/dist/wrapString.js.map
trusty-cms-5.0.6 node_modules/table/dist/wrapString.js.map
trusty-cms-5.0.5 node_modules/table/dist/wrapString.js.map
trusty-cms-5.0.4 node_modules/table/dist/wrapString.js.map
trusty-cms-5.0.3 node_modules/table/dist/wrapString.js.map
trusty-cms-5.0.2 node_modules/table/dist/wrapString.js.map
trusty-cms-5.0.1 node_modules/table/dist/wrapString.js.map
trusty-cms-4.3.5 node_modules/table/dist/wrapString.js.map
trusty-cms-5.0.0 node_modules/table/dist/wrapString.js.map
trusty-cms-4.3.4 node_modules/table/dist/wrapString.js.map
trusty-cms-4.3.3 node_modules/table/dist/wrapString.js.map
trusty-cms-4.3.2 node_modules/table/dist/wrapString.js.map
trusty-cms-4.3.1 node_modules/table/dist/wrapString.js.map
trusty-cms-4.3 node_modules/table/dist/wrapString.js.map
trusty-cms-4.2.3 node_modules/table/dist/wrapString.js.map
trusty-cms-4.2.2 node_modules/table/dist/wrapString.js.map
trusty-cms-4.2.1 node_modules/table/dist/wrapString.js.map
trusty-cms-4.2 node_modules/table/dist/wrapString.js.map
trusty-cms-4.1.9 node_modules/table/dist/wrapString.js.map
trusty-cms-4.1.8 node_modules/table/dist/wrapString.js.map