This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function deepClone<T>(obj: any): T { | |
if (obj === null || typeof (obj) !== 'object' || 'isActiveClone' in obj) { | |
return obj; | |
} | |
const clone = obj instanceof Date ? new Date(obj) : new obj.constructor(); | |
for (const key in obj) { | |
if (Object.prototype.hasOwnProperty.call(obj, key)) { | |
obj.isActiveClone = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {EventEmitter} from '@angular/core'; | |
var DOWN_EVENT = 'pointerdown'; | |
var MOVE_EVENT = 'pointermove'; | |
var UP_EVENT = 'pointerup'; | |
var CANCEL_EVENT = 'pointercancel'; | |
if (!('PointerEvent' in window)) { | |
DOWN_EVENT = 'touchstart'; | |
MOVE_EVENT = 'touchmove'; |