mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
refactor(all): allow external imports
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user