Advertisement
Savelyev_Vyacheslav

orde

Nov 30th, 2022 (edited)
865
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     const fields = {
  2.         notVisible: [],
  3.         readonly: [],
  4.         async orderReadonly(val = this.readonly) {
  5.             if (this.readonly == val) {
  6.                 var arrayOrder = await newFormPage.getReadonlyFieldNames();
  7.                 this.readonly = arrayOrder.filter(async (field) => val.includes(field));
  8.                 return this.readonly;
  9.             } else {
  10.                 var arrayOrder = await newFormPage.getReadonlyFieldNames();
  11.                 val = arrayOrder.filter(async (field) => val.includes(field));
  12.                 return val;
  13.             }
  14.         },
  15.         minus: function (whole, part) {
  16.             const namesToDeleteSet = new Set(part);
  17.             return whole.filter((name) => {
  18.                 return !namesToDeleteSet.has(name);
  19.             });
  20.         },
  21.         plus: function (set1, set2) {
  22.             return set1.concat(set2);
  23.         },
  24.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement