1 | (function() {
|
2 | module.exports = function($) {
|
3 | var normalizePathToArray;
|
4 | ({normalizePathToArray} = $.fn);
|
5 | return $.isSame_ = async function(source) {
|
6 | var cache, cont, groupSource, i, j, len, len1, size, stat;
|
7 | groupSource = normalizePathToArray(source);
|
8 | if (!groupSource.length) {
|
9 | return false;
|
10 | }
|
11 |
|
12 |
|
13 | cache = null;
|
14 | for (i = 0, len = groupSource.length; i < len; i++) {
|
15 | source = groupSource[i];
|
16 | stat = (await $.stat_(source));
|
17 | if (!stat) {
|
18 | return false;
|
19 | }
|
20 | ({size} = stat);
|
21 | if (!cache) {
|
22 | cache = size;
|
23 | continue;
|
24 | }
|
25 | if (size !== cache) {
|
26 | return false;
|
27 | }
|
28 | }
|
29 |
|
30 |
|
31 | cache = null;
|
32 | for (j = 0, len1 = groupSource.length; j < len1; j++) {
|
33 | source = groupSource[j];
|
34 | $.info.pause('$.isSame_');
|
35 | cont = (await $.read_(source));
|
36 | $.info.resume('$.isSame_');
|
37 | if (!cont) {
|
38 | return false;
|
39 | }
|
40 | cont = $.parseString(cont);
|
41 | if (!cache) {
|
42 | cache = cont;
|
43 | continue;
|
44 | }
|
45 | if (cont !== cache) {
|
46 | return false;
|
47 | }
|
48 | }
|
49 | return true;
|
50 | };
|
51 | };
|
52 |
|
53 | }).call(this);
|