Skip to content

Commit 8f7aaa8

Browse files
committed
fix: Merge pull request #62 from oprogramador/dependabot/npm_and_yarn/tar-4.4.19
chore(deps): bump tar from 4.4.15 to 4.4.19
2 parents 792cab1 + 5db6a33 commit 8f7aaa8

File tree

4 files changed

+64
-24
lines changed

4 files changed

+64
-24
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@
5454
},
5555
"dependencies": {
5656
"lodash.mapvalues": "^4.6.0",
57-
"sort-any": "^1.2.3"
57+
"sort-any": "1"
5858
}
5959
}

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import sortAny from 'sort-any';
33

44
const sortDeep = (object) => {
55
if (!Array.isArray(object)) {
6-
if (!(typeof object === 'object') || object === null) {
6+
if (!(typeof object === 'object') || object === null || object instanceof Date) {
77
return object;
88
}
99

src/tests/deepEqualInAnyOrder.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ describe('equalInAnyOrder', () => {
6767
expectToNotDeepEqualInAnyOrder([], {});
6868
});
6969

70+
it('matches exact dates', () => {
71+
const a = new Date('2021-01-01');
72+
const b = new Date('2021-01-01');
73+
expectToDeepEqualInAnyOrder(a, b);
74+
});
75+
76+
it('does not match distinct dates', () => {
77+
const a = new Date('2021-01-01');
78+
const b = new Date('2021-01-02');
79+
expectToNotDeepEqualInAnyOrder(a, b);
80+
});
81+
7082
it('matches same flat objects', () => {
7183
const a = {
7284
foo: 'bar',
@@ -91,6 +103,20 @@ describe('equalInAnyOrder', () => {
91103
expectToDeepEqualInAnyOrder(a, b);
92104
});
93105

106+
it('matches same flat objects with different keys order, with a date', () => {
107+
const a = {
108+
foo: 'bar',
109+
foo2: 'bar2',
110+
foo3: new Date('2021-01-01'),
111+
};
112+
const b = {
113+
foo2: 'bar2',
114+
foo3: new Date('2021-01-01'),
115+
foo: 'bar',
116+
};
117+
expectToDeepEqualInAnyOrder(a, b);
118+
});
119+
94120
it('does not match different flat objects', () => {
95121
const a = {
96122
foo: 'bar',
@@ -103,6 +129,18 @@ describe('equalInAnyOrder', () => {
103129
expectToNotDeepEqualInAnyOrder(a, b);
104130
});
105131

132+
it('does not match flat objects with different dates', () => {
133+
const a = {
134+
foo: 'bar',
135+
foo2: new Date('2021-01-01'),
136+
};
137+
const b = {
138+
foo: 'bar',
139+
foo2: new Date('2021-01-02'),
140+
};
141+
expectToNotDeepEqualInAnyOrder(a, b);
142+
});
143+
106144
it('matches same flat arrays', () => {
107145
const a = [
108146
'foo',
@@ -198,6 +236,7 @@ describe('equalInAnyOrder', () => {
198236
'foo11',
199237
'foo10',
200238
'foo12',
239+
new Date('2021-01-01'),
201240
],
202241
},
203242
},
@@ -217,6 +256,7 @@ describe('equalInAnyOrder', () => {
217256
foo8: 'bar8',
218257
foo9: [
219258
'foo10',
259+
new Date('2021-01-01'),
220260
'foo11',
221261
'foo12',
222262
],

yarn.lock

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ chokidar@^1.6.1:
13321332
optionalDependencies:
13331333
fsevents "^1.0.0"
13341334

1335-
chownr@^1.1.1:
1335+
chownr@^1.1.4:
13361336
version "1.1.4"
13371337
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b"
13381338
integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==
@@ -2455,7 +2455,7 @@ fs-extra@^9.0.0:
24552455
jsonfile "^6.0.1"
24562456
universalify "^2.0.0"
24572457

2458-
fs-minipass@^1.2.5:
2458+
fs-minipass@^1.2.7:
24592459
version "1.2.7"
24602460
resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7"
24612461
integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==
@@ -3947,7 +3947,7 @@ minipass-sized@^1.0.3:
39473947
dependencies:
39483948
minipass "^3.0.0"
39493949

3950-
minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0:
3950+
minipass@^2.6.0, minipass@^2.9.0:
39513951
version "2.9.0"
39523952
resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6"
39533953
integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==
@@ -3962,7 +3962,7 @@ minipass@^3.0.0, minipass@^3.1.0, minipass@^3.1.1, minipass@^3.1.3:
39623962
dependencies:
39633963
yallist "^4.0.0"
39643964

3965-
minizlib@^1.2.1:
3965+
minizlib@^1.3.3:
39663966
version "1.3.3"
39673967
resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d"
39683968
integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==
@@ -3994,7 +3994,7 @@ mkdirp-infer-owner@^2.0.0:
39943994
infer-owner "^1.0.4"
39953995
mkdirp "^1.0.3"
39963996

3997-
mkdirp@^0.5.0, mkdirp@^0.5.1:
3997+
mkdirp@^0.5.1, mkdirp@^0.5.5:
39983998
version "0.5.5"
39993999
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
40004000
integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
@@ -5297,7 +5297,7 @@ run-parallel@^1.1.9:
52975297
dependencies:
52985298
queue-microtask "^1.2.2"
52995299

5300-
safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2, safe-buffer@~5.2.0:
5300+
safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2, safe-buffer@^5.2.1, safe-buffer@~5.2.0:
53015301
version "5.2.1"
53025302
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
53035303
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
@@ -5500,10 +5500,10 @@ socks@^2.3.3:
55005500
ip "^1.1.5"
55015501
smart-buffer "^4.1.0"
55025502

5503-
sort-any@^1.2.3:
5504-
version "1.2.3"
5505-
resolved "https://registry.yarnpkg.com/sort-any/-/sort-any-1.2.3.tgz#901806cb3ec769b95c6d8eade7528c4f8dda404c"
5506-
integrity sha512-yJLpmCgDOu7Z6XS6ofzcKRy/Id8yfGB8KkzC7oKAk1F7P3jPWEU8GMxBJWDo5fKp71JYY1bJ8tmaHBfoTx+y8w==
5503+
sort-any@1:
5504+
version "1.2.9"
5505+
resolved "https://registry.yarnpkg.com/sort-any/-/sort-any-1.2.9.tgz#82b2513a68ad8aae6f2763fbc6212868b1aad0ca"
5506+
integrity sha512-6LEFNVLeWrbCpFxhS+KdZypqY4XrtOA1dY1vQSacR91SJ/sXKUrR1wK7AUgLOXlLVXnaws3NcZ8lZPMdfkhlHw==
55075507
dependencies:
55085508
lodash "^4.17.21"
55095509

@@ -5799,17 +5799,17 @@ table@^6.0.4:
57995799
string-width "^4.2.0"
58005800

58015801
tar@^4:
5802-
version "4.4.15"
5803-
resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.15.tgz#3caced4f39ebd46ddda4d6203d48493a919697f8"
5804-
integrity sha512-ItbufpujXkry7bHH9NpQyTXPbJ72iTlXgkBAYsAjDXk3Ds8t/3NfO5P4xZGy7u+sYuQUbimgzswX4uQIEeNVOA==
5805-
dependencies:
5806-
chownr "^1.1.1"
5807-
fs-minipass "^1.2.5"
5808-
minipass "^2.8.6"
5809-
minizlib "^1.2.1"
5810-
mkdirp "^0.5.0"
5811-
safe-buffer "^5.1.2"
5812-
yallist "^3.0.3"
5802+
version "4.4.19"
5803+
resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3"
5804+
integrity sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==
5805+
dependencies:
5806+
chownr "^1.1.4"
5807+
fs-minipass "^1.2.7"
5808+
minipass "^2.9.0"
5809+
minizlib "^1.3.3"
5810+
mkdirp "^0.5.5"
5811+
safe-buffer "^5.2.1"
5812+
yallist "^3.1.1"
58135813

58145814
tar@^6.0.2, tar@^6.1.0:
58155815
version "6.1.0"
@@ -6205,7 +6205,7 @@ y18n@^5.0.5:
62056205
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.5.tgz#8769ec08d03b1ea2df2500acef561743bbb9ab18"
62066206
integrity sha512-hsRUr4FFrvhhRH12wOdfs38Gy7k2FFzB9qgN9v3aLykRq0dRcdcpz5C9FxdS2NuhOrI/628b/KSTJ3rwHysYSg==
62076207

6208-
yallist@^3.0.0, yallist@^3.0.3:
6208+
yallist@^3.0.0, yallist@^3.1.1:
62096209
version "3.1.1"
62106210
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
62116211
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==

0 commit comments

Comments
 (0)