refactor(all): allow external imports

This commit is contained in:
Manu Mtz.-Almeida
2018-04-24 15:10:15 +02:00
parent 0c1476e0ff
commit 053c375521
160 changed files with 3451 additions and 770 deletions

View File

@ -1,11 +1,16 @@
import { EventEmitter } from '@stencil/core';
export function reorderArray(array: any[], indexes: {from: number, to: number}): any[] {
const element = array[indexes.from];
array.splice(indexes.from, 1);
array.splice(indexes.to, 0, element);
return array;
}
export function clamp(min: number, n: number, max: number) {
return Math.max(min, Math.min(n, max));
}
export function isDef(v: any): boolean { return v !== undefined && v !== null; }
export function assert(actual: any, reason: string) {
if (!actual) {
const message = 'ASSERT: ' + reason;