langsmith
Version:
Client library to connect to the LangSmith Observability and Evaluation Platform.
16 lines (15 loc) • 392 B
JavaScript
import mk_wcwidth from './wcwidth.js';
const mk_wcswidth = (pwcs) => {
let width = 0;
// eslint-disable-next-line no-plusplus
for (let i = 0; i < pwcs.length; i++) {
const charCode = pwcs.charCodeAt(i);
const w = mk_wcwidth(charCode);
if (w < 0) {
return -1;
}
width += w;
}
return width;
};
export default mk_wcswidth;