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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils.js +91 -38
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meta-fca",
3
- "version": "2.5.5",
3
+ "version": "2.5.7",
4
4
  "description": "Comback :))",
5
5
  "main": "index.js",
6
6
  "scripts": {
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
- get,
1371
- post,
1372
- postFormData,
1373
- generateThreadingID,
1374
- generateOfflineThreadingID,
1375
- getGUID,
1376
- getFrom,
1377
- makeParsable,
1378
- arrToForm,
1379
- getSignatureID,
1380
- getJar: request.jar,
1381
- generateTimestampRelative,
1382
- makeDefaults,
1383
- parseAndCheckLogin,
1384
- saveCookies,
1385
- getType,
1386
- _formatAttachment,
1387
- formatHistoryMessage,
1388
- formatID,
1389
- formatMessage,
1390
- formatDeltaEvent,
1391
- formatDeltaMessage,
1392
- formatProxyPresence,
1393
- formatPresence,
1394
- formatTyp,
1395
- formatDeltaReadReceipt,
1396
- formatCookie,
1397
- formatThread,
1398
- formatReadReceipt,
1399
- formatRead,
1400
- generatePresence,
1401
- generateAccessiblityCookie,
1402
- formatDate,
1403
- decodeClientPayload,
1404
- getAppState,
1405
- getAdminTextMessageType,
1406
- setProxy
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
  };