@pisell/materials 6.0.2 → 6.0.4

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.
@@ -30,7 +30,8 @@ __export(utils_exports, {
30
30
  getFileType: () => getFileType,
31
31
  getMediaMetadata: () => getMediaMetadata,
32
32
  getPointSuffix: () => getPointSuffix,
33
- getSuffix: () => getSuffix
33
+ getSuffix: () => getSuffix,
34
+ isValueEqual: () => isValueEqual
34
35
  });
35
36
  module.exports = __toCommonJS(utils_exports);
36
37
  var import_utils = require("@pisell/utils");
@@ -236,6 +237,26 @@ var getFileMetadataParams = (file) => {
236
237
  });
237
238
  return metadataParams;
238
239
  };
240
+ var isValueEqual = (value, fileListValue) => {
241
+ if (!value && !fileListValue)
242
+ return true;
243
+ if (!value || !fileListValue)
244
+ return false;
245
+ if (Array.isArray(value) && Array.isArray(fileListValue)) {
246
+ if (value.length !== fileListValue.length)
247
+ return false;
248
+ return value.every((v, i) => {
249
+ if (typeof v === "object") {
250
+ return JSON.stringify(v) === JSON.stringify(fileListValue[i]);
251
+ }
252
+ return v === fileListValue[i];
253
+ });
254
+ }
255
+ if (typeof value === "object" && typeof fileListValue === "object") {
256
+ return JSON.stringify(value) === JSON.stringify(fileListValue);
257
+ }
258
+ return value === fileListValue;
259
+ };
239
260
  // Annotate the CommonJS export names for ESM import in node:
240
261
  0 && (module.exports = {
241
262
  checkFileCount,
@@ -249,5 +270,6 @@ var getFileMetadataParams = (file) => {
249
270
  getFileType,
250
271
  getMediaMetadata,
251
272
  getPointSuffix,
252
- getSuffix
273
+ getSuffix,
274
+ isValueEqual
253
275
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "6.0.2",
3
+ "version": "6.0.4",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -65,8 +65,8 @@
65
65
  "react-virtualized-auto-sizer": "^1.0.20",
66
66
  "crypto-js": "^4.2.0",
67
67
  "@zxing/library": "0.21.2",
68
- "@pisell/utils": "1.0.42",
69
68
  "@pisell/icon": "0.0.11",
69
+ "@pisell/utils": "1.0.42",
70
70
  "@pisell/date-picker": "1.0.100"
71
71
  },
72
72
  "peerDependencies": {