Changing util.js to export an object

This allows the methods to be spied on in tests
This commit is contained in:
Jeff Avallone committed 2014-12-20 10:25:32 -05:00
1 parent 8a9a129856
commit 6c5b36f334
9 files changed
+31 -31

No files matched your search

+4 -4
View File
@@ -1,6 +1,6 @@
import _ from 'lodash';
export function customEvent(name, detail) {
function customEvent(name, detail) {
var evt = document.createEvent('Event');
evt.initEvent(name, true, true);
evt.detail = detail;
@@ -8,7 +8,7 @@ export function customEvent(name, detail) {
}
export function normalizeBBox(box) {
function normalizeBBox(box) {
return _.extend({
ax: box.x,
ax2: box.x2,
@@ -16,7 +16,7 @@ export function normalizeBBox(box) {
}, box);
}
export function spaceHorizontally(items, options) {
function spaceHorizontally(items, options) {
var verticalCenter = 0;
options = _.defaults(options || {}, {
@@ -44,7 +44,7 @@ export function spaceHorizontally(items, options) {
}
}
export function spaceVertically(items, options) {
function spaceVertically(items, options) {
var horizontalCenter = 0;
options = _.defaults(options || {}, {