Files
30-seconds-of-code/node_modules/ink/build/measure-text.js
2019-08-20 15:52:05 +02:00

21 lines
455 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _widestLine = _interopRequireDefault(require("widest-line"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _default = text => {
const width = (0, _widestLine.default)(text);
const height = text.split('\n').length;
return {
width,
height
};
};
exports.default = _default;