meta-fca 2.5.5 → 2.5.7
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/utils.js +91 -38
package/package.json
CHANGED
package/utils.js
CHANGED
@@ -1365,43 +1365,96 @@ function getAppState(jar) {
|
|
1365
1365
|
.concat(jar.getCookies("https://facebook.com"))
|
1366
1366
|
.concat(jar.getCookies("https://www.messenger.com"));
|
1367
1367
|
}
|
1368
|
+
function getData_Path(Obj , Arr, Stt) {
|
1369
|
+
//default stt = 0
|
1370
|
+
if (Arr.length === 0 && Obj != undefined) {
|
1371
|
+
return Obj; //object
|
1372
|
+
}
|
1373
|
+
else if (Obj == undefined) {
|
1374
|
+
return Stt;
|
1375
|
+
}
|
1376
|
+
const head = Arr[0];
|
1377
|
+
if (head == undefined) {
|
1378
|
+
return Stt;
|
1379
|
+
}
|
1380
|
+
const tail = Arr.slice(1);
|
1381
|
+
return getData_Path(Obj[head], tail, Stt++);
|
1382
|
+
}
|
1383
|
+
|
1384
|
+
|
1385
|
+
function setData_Path(obj, path, value) {
|
1386
|
+
if (!path.length) {
|
1387
|
+
return obj;
|
1388
|
+
}
|
1389
|
+
const currentKey = path[0];
|
1390
|
+
let currentObj = obj[currentKey];
|
1391
|
+
|
1392
|
+
if (!currentObj) {
|
1393
|
+
obj[currentKey] = value;
|
1394
|
+
currentObj = obj[currentKey];
|
1395
|
+
}
|
1396
|
+
path.shift();
|
1397
|
+
if (!path.length) {
|
1398
|
+
currentObj = value;
|
1399
|
+
} else {
|
1400
|
+
currentObj = setData_Path(currentObj, path, value);
|
1401
|
+
}
|
1402
|
+
|
1403
|
+
return obj;
|
1404
|
+
}
|
1405
|
+
|
1406
|
+
function getPaths(obj, parentPath = []) {
|
1407
|
+
let paths = [];
|
1408
|
+
for (let prop in obj) {
|
1409
|
+
if (typeof obj[prop] === "object") {
|
1410
|
+
paths = paths.concat(getPaths(obj[prop], [...parentPath, prop]));
|
1411
|
+
} else {
|
1412
|
+
paths.push([...parentPath, prop]);
|
1413
|
+
}
|
1414
|
+
}
|
1415
|
+
return paths;
|
1416
|
+
}
|
1368
1417
|
module.exports = {
|
1369
|
-
isReadableStream,
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1418
|
+
isReadableStream:isReadableStream,
|
1419
|
+
get:get,
|
1420
|
+
post:post,
|
1421
|
+
postFormData:postFormData,
|
1422
|
+
generateThreadingID:generateThreadingID,
|
1423
|
+
generateOfflineThreadingID:generateOfflineThreadingID,
|
1424
|
+
getGUID:getGUID,
|
1425
|
+
getFrom:getFrom,
|
1426
|
+
makeParsable:makeParsable,
|
1427
|
+
arrToForm:arrToForm,
|
1428
|
+
getSignatureID:getSignatureID,
|
1429
|
+
getJar: request.jar,
|
1430
|
+
generateTimestampRelative:generateTimestampRelative,
|
1431
|
+
makeDefaults:makeDefaults,
|
1432
|
+
parseAndCheckLogin:parseAndCheckLogin,
|
1433
|
+
getGender: getGenderByPhysicalMethod,
|
1434
|
+
getData_Path,
|
1435
|
+
setData_Path,
|
1436
|
+
getPaths,
|
1437
|
+
saveCookies,
|
1438
|
+
getType,
|
1439
|
+
_formatAttachment,
|
1440
|
+
formatHistoryMessage,
|
1441
|
+
formatID,
|
1442
|
+
formatMessage,
|
1443
|
+
formatDeltaEvent,
|
1444
|
+
formatDeltaMessage,
|
1445
|
+
formatProxyPresence,
|
1446
|
+
formatPresence,
|
1447
|
+
formatTyp,
|
1448
|
+
formatDeltaReadReceipt,
|
1449
|
+
formatCookie,
|
1450
|
+
formatThread,
|
1451
|
+
formatReadReceipt,
|
1452
|
+
formatRead,
|
1453
|
+
generatePresence,
|
1454
|
+
generateAccessiblityCookie,
|
1455
|
+
formatDate,
|
1456
|
+
decodeClientPayload,
|
1457
|
+
getAppState,
|
1458
|
+
getAdminTextMessageType,
|
1459
|
+
setProxy
|
1407
1460
|
};
|