You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const{ table }=require('table')constOSC='\u001B]';constBEL='\u0007';constSEP=';';consturl='https://example.com';consttext='This is a link to example.com';constlink=[OSC,'8',SEP,SEP,url,BEL,text,OSC,'8',SEP,SEP,BEL].join('');console.log(table([[link]]));
Output:
╔═══════════════════════════════╗
║ ttps://example.comThis is a link to exa ║
║ ttps://exammple.com ║
╚═══════════════════════════════╝
Additionally, if I change the text variable to be something shorter, i.e. foo, it throws an error:
Error: Subject parameter value width cannot be greater than the container width.
at alignString (/Users/ericbiewener/Repos/Walmart/github-api/node_modules/table/dist/alignString.js:78:11)
at /Users/ericbiewener/Repos/Walmart/github-api/node_modules/table/dist/alignTableData.js:27:41
at Array.map (<anonymous>)
at /Users/ericbiewener/Repos/Walmart/github-api/node_modules/table/dist/alignTableData.js:21:18
at Array.map (<anonymous>)
at alignTableData (/Users/ericbiewener/Repos/Walmart/github-api/node_modules/table/dist/alignTableData.js:20:15)
at table (/Users/ericbiewener/Repos/Walmart/github-api/node_modules/table/dist/table.js:102:38)
at Object.<anonymous> (/Users/ericbiewener/Repos/Walmart/github-api/src/test.js:24:13)
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
From testing, it appears that error gets thrown if text is shorter than url.
I'm using zsh, node v12.2.0, and OSX 10.15.5.
The text was updated successfully, but these errors were encountered:
Therefore, upgrading the slice-ansi version to 5.0.0 may fix the problem in the no-wrapping case.
On the other hand, slice-ansi 5.0.0 is a Pure ESM. Importing a Pure ESM requires that the importer also be an ESM. To import a Pure ESM, the import source must also be an ESM, i.e., it must wait for the work of #194.
I'm sorry, I have misunderstood something. chalk/slice-ansi#32 was just adding the test.
I'm testing this with the exact test case from this repo:
Output:
Additionally, if I change the
text
variable to be something shorter, i.e.foo
, it throws an error:From testing, it appears that error gets thrown if
text
is shorter thanurl
.I'm using zsh, node v12.2.0, and OSX 10.15.5.
The text was updated successfully, but these errors were encountered: