regexper-static/src/js/util.js

18 lines
305 B
JavaScript
Raw Normal View History

2014-12-19 17:06:21 +00:00
import _ from 'lodash';
export function customEvent(name, detail) {
var evt = document.createEvent('Event');
evt.initEvent(name, true, true);
evt.detail = detail;
return evt;
}
2014-12-19 17:06:21 +00:00
export function normalizeBBox(box) {
return _.extend({
ax: box.x,
ax2: box.x2,
ay: box.cy
}, box);
}