This file contains hidden or 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 {Plugin, Viewport} from 'pixi-viewport'; | |
import {DisplayObject} from 'pixi.js'; | |
type Options = { | |
moveSpeed: number; | |
moveReverse: boolean; | |
zoomSpeed: number; | |
zoomReverse: boolean; | |
limitToObjectBounds?: DisplayObject; | |
limitToObjectBoundsBy?: number; |
This file contains hidden or 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 const initLogger = ()=>{ | |
['log', 'warn', 'error'].forEach((methodName) => { | |
const originalMethod = console[methodName]; | |
console[methodName] = (...args) => { | |
let initiator = 'unknown place'; | |
const timestamp = new Date().toISOString(); | |
try { | |
throw new Error(); | |
} catch (e) { |
This file contains hidden or 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
/** | |
* Takes an array or a single number and flattens it into a result array. | |
* | |
* @param input: Array|any | |
* @param resultArray: Array|null - optional. array into which all inputs get flattened into. Uses an empty array if none provided. | |
*/ | |
const flatten = function (input, resultArray = []) { | |
if (!Array.isArray(resultArray)) | |
throw new Error('ResultArray must be an array') |
This file contains hidden or 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
/** | |
* Created by iyobo on 2017-04-25. | |
*/ | |
function appendRecursively(formData, collection, parentkey, parentIsArray) { | |
//console.log(...arguments) | |
for (let k in collection) { | |
const val = collection[k]; | |
if (val === undefined) continue; |