add layers for new image and new game

This commit is contained in:
Zutatensuppe 2021-05-21 00:43:02 +02:00
parent e9b209edf1
commit bdd061dd1a
18 changed files with 551 additions and 99 deletions

View file

@ -148,6 +148,18 @@ const hash = (str: string): number => {
return hash;
}
function asQueryArgs(data: any) {
const q = []
for (let k in data) {
const pair = [k, data[k]].map(encodeURIComponent)
q.push(pair.join('='))
}
if (q.length === 0) {
return ''
}
return `?${q.join('&')}`
}
export default {
hash,
uniqId,
@ -165,4 +177,6 @@ export default {
decodeGame,
coordByTileIdx,
asQueryArgs,
}