qidian-shared 1.0.27 → 1.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1273,9 +1273,20 @@ function extractSlotsWithoutPrefix(slots, prefix) {
1273
1273
  }
1274
1274
  return res;
1275
1275
  }
1276
+ function filterSlots(slots, filterName) {
1277
+ const res = [];
1278
+ for (const key in slots) {
1279
+ if (filterName.includes(key)) continue;
1280
+ res.push(key);
1281
+ }
1282
+ return res;
1283
+ }
1276
1284
  function easyCopy(data) {
1277
1285
  return JSON.parse(JSON.stringify(data));
1278
1286
  }
1287
+ function checkSameObject(newData, oldData) {
1288
+ return JSON.stringify(newData) === JSON.stringify(oldData);
1289
+ }
1279
1290
  function valueFillter(val, keys, data) {
1280
1291
  if (!val) return val;
1281
1292
  return val.replace(/(?:\${([^}]*)})|(?:\$([^&?\b]*))/g, ($1, $2, $3) => {
@@ -8027,6 +8038,21 @@ function easyDownload(res, name) {
8027
8038
  }, 1e3);
8028
8039
  }
8029
8040
  }
8041
+ function cutFilename(name, num) {
8042
+ if (!name) return "";
8043
+ const lastIndex = name.lastIndexOf(".");
8044
+ const suffix = lastIndex === -1 ? "" : name.substring(lastIndex + 1);
8045
+ return `${name.substring(0, num - suffix.length - 1)}.${suffix}`;
8046
+ }
8047
+ function cutFileSuffix(name) {
8048
+ if (!name) return "";
8049
+ const nameSplit = name.split(".");
8050
+ return nameSplit[nameSplit.length - 1];
8051
+ }
8052
+ function isTypeByName(name, suffixs) {
8053
+ if (!name) return false;
8054
+ return suffixs.some((suffix) => `.${cutFileSuffix(name)}`.toLowerCase() === suffix.toLowerCase());
8055
+ }
8030
8056
  var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
8031
8057
  function int2char(n) {
8032
8058
  return BI_RM.charAt(n);
@@ -12431,7 +12457,10 @@ function useTimer(type = "timeout") {
12431
12457
  exports.MD5 = MD5;
12432
12458
  exports.buildTree = buildTree;
12433
12459
  exports.camelize = camelize;
12460
+ exports.checkSameObject = checkSameObject;
12434
12461
  exports.createEnum = createEnum;
12462
+ exports.cutFileSuffix = cutFileSuffix;
12463
+ exports.cutFilename = cutFilename;
12435
12464
  exports.decrypt = decrypt;
12436
12465
  exports.decryptBase64 = decryptBase64;
12437
12466
  exports.deleteUrlParams = deleteUrlParams;
@@ -12442,6 +12471,7 @@ exports.encryptBase64 = encryptBase64;
12442
12471
  exports.encryptWithAes = encryptWithAes;
12443
12472
  exports.extractSlotsWithPrefix = extractSlotsWithPrefix;
12444
12473
  exports.extractSlotsWithoutPrefix = extractSlotsWithoutPrefix;
12474
+ exports.filterSlots = filterSlots;
12445
12475
  exports.generateAesKey = generateAesKey;
12446
12476
  exports.generateRandomString = generateRandomString;
12447
12477
  exports.getUrlParam = getUrlParam;
@@ -12453,6 +12483,7 @@ exports.isEmpty = isEmpty;
12453
12483
  exports.isFunction = isFunction;
12454
12484
  exports.isObject = isObject;
12455
12485
  exports.isPromise = isPromise;
12486
+ exports.isTypeByName = isTypeByName;
12456
12487
  exports.kebabCase = kebabCase;
12457
12488
  exports.noop = noop;
12458
12489
  exports.objToStr = objToStr;