Offset 1, 3 lines modified | Offset 1, 3 lines modified | ||
1 | ·ab489f52a05cb6f576a7f31bbb51ac3b·115632·javascript·optional·libjs-underscore_1.13.4~dfsg+~1.11.4-3_all.deb | 1 | ·ab489f52a05cb6f576a7f31bbb51ac3b·115632·javascript·optional·libjs-underscore_1.13.4~dfsg+~1.11.4-3_all.deb |
2 | · | 2 | ·dfe41db4d0e6908265fd3bfb8db22724·120484·javascript·optional·node-underscore_1.13.4~dfsg+~1.11.4-3_all.deb |
Offset 1, 3 lines modified | Offset 1, 3 lines modified | ||
1 | -rw-r--r--···0········0········0········4·2023-01-02·04:09:24.000000·debian-binary | 1 | -rw-r--r--···0········0········0········4·2023-01-02·04:09:24.000000·debian-binary |
2 | -rw-r--r--···0········0········0····1158 | 2 | -rw-r--r--···0········0········0····11588·2023-01-02·04:09:24.000000·control.tar.xz |
3 | -rw-r--r--···0········0········0···108 | 3 | -rw-r--r--···0········0········0···108704·2023-01-02·04:09:24.000000·data.tar.xz |
Offset 14, 333 lines modified | Offset 14, 333 lines modified | ||
14 | -rw-r--r--···0·root·········(0)·root·········(0)·····1697·2023-01-02·04:09:24.000000·./usr/share/nodejs/@types/underscore/index.d.mts | 14 | -rw-r--r--···0·root·········(0)·root·········(0)·····1697·2023-01-02·04:09:24.000000·./usr/share/nodejs/@types/underscore/index.d.mts |
15 | -rw-r--r--···0·root·········(0)·root·········(0)···242854·2023-01-02·04:09:24.000000·./usr/share/nodejs/@types/underscore/index.d.ts | 15 | -rw-r--r--···0·root·········(0)·root·········(0)···242854·2023-01-02·04:09:24.000000·./usr/share/nodejs/@types/underscore/index.d.ts |
16 | -rw-r--r--···0·root·········(0)·root·········(0)·····2254·2023-01-02·04:09:24.000000·./usr/share/nodejs/@types/underscore/package.json | 16 | -rw-r--r--···0·root·········(0)·root·········(0)·····2254·2023-01-02·04:09:24.000000·./usr/share/nodejs/@types/underscore/package.json |
17 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/ | 17 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/ |
18 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/ | 18 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/ |
19 | -rw-r--r--···0·root·········(0)·root·········(0)······574·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index.js | 19 | -rw-r--r--···0·root·········(0)·root·········(0)······574·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index.js |
20 | -rw-r--r--···0·root·········(0)·root·········(0)·····1085·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index10.js | 20 | -rw-r--r--···0·root·········(0)·root·········(0)·····1085·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index10.js |
21 | -rw-r--r--···0·root·········(0)·root·········(0)······ | 21 | -rw-r--r--···0·root·········(0)·root·········(0)······149·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index100.js |
22 | -rw-r--r--···0·root·········(0)·root·········(0)······114·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index101.js | ||
23 | -rw-r--r--···0·root·········(0)·root·········(0)······446·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index102.js | ||
24 | -rw-r--r--···0·root·········(0)·root·········(0)······270·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index103.js | ||
22 | -rw-r--r--···0·root·········(0)·root·········(0)······405·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index10 | 25 | -rw-r--r--···0·root·········(0)·root·········(0)······405·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index104.js |
26 | -rw-r--r--···0·root·········(0)·root·········(0)·····1291·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index105.js | ||
23 | -rw-r--r--···0·root·········(0)·root·········(0)······292·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index10 | 27 | -rw-r--r--···0·root·········(0)·root·········(0)······292·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index106.js |
24 | -rw-r--r--···0·root·········(0)·root·········(0)······577·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index10 | 28 | -rw-r--r--···0·root·········(0)·root·········(0)······577·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index107.js |
25 | -rw-r--r--···0·root·········(0)·root·········(0)······571·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index10 | 29 | -rw-r--r--···0·root·········(0)·root·········(0)······571·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index108.js |
26 | -rw-r--r--···0·root·········(0)·root·········(0)······327·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index105.js | ||
27 | -rw-r--r--···0·root·········(0)·root·········(0)······985·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index10 | 30 | -rw-r--r--···0·root·········(0)·root·········(0)······985·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index109.js |
28 | -rw-r--r--···0·root·········(0)·root·········(0)······464·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index107.js | ||
29 | -rw-r--r--···0·root·········(0)·root·········(0)······981·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index108.js | ||
30 | -rw-r--r--···0·root·········(0)·root·········(0)······574·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index109.js | ||
31 | -rw-r--r--···0·root·········(0)·root·········(0)······411·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index11.js | 31 | -rw-r--r--···0·root·········(0)·root·········(0)······411·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index11.js |
32 | -rw-r--r--···0·root·········(0)·root·········(0)······327·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index110.js | ||
33 | -rw-r--r--···0·root·········(0)·root·········(0)······464·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index111.js | ||
34 | -rw-r--r--···0·root·········(0)·root·········(0)······981·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index112.js | ||
35 | -rw-r--r--···0·root·········(0)·root·········(0)······573·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index113.js | ||
32 | -rw-r--r--···0·root·········(0)·root·········(0)······220·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index11 | 36 | -rw-r--r--···0·root·········(0)·root·········(0)······220·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index114.js |
33 | -rw-r--r--···0·root·········(0)·root·········(0)······134·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index11 | 37 | -rw-r--r--···0·root·········(0)·root·········(0)······134·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index115.js |
34 | -rw-r--r--···0·root·········(0)·root·········(0)······192·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index11 | 38 | -rw-r--r--···0·root·········(0)·root·········(0)······192·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index116.js |
35 | -rw-r--r--···0·root·········(0)·root·········(0)······580·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index11 | 39 | -rw-r--r--···0·root·········(0)·root·········(0)······580·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index117.js |
36 | -rw-r--r--···0·root·········(0)·root·········(0)······681·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index11 | 40 | -rw-r--r--···0·root·········(0)·root·········(0)······681·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index118.js |
37 | -rw-r--r--···0·root·········(0)·root·········(0)······252·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index11 | 41 | -rw-r--r--···0·root·········(0)·root·········(0)······252·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index119.js |
42 | -rw-r--r--···0·root·········(0)·root·········(0)······233·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index12.js | ||
38 | -rw-r--r--···0·root·········(0)·root·········(0)······401·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index1 | 43 | -rw-r--r--···0·root·········(0)·root·········(0)······401·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index120.js |
39 | -rw-r--r--···0·root·········(0)·root·········(0)·····1001·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index1 | 44 | -rw-r--r--···0·root·········(0)·root·········(0)·····1001·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index121.js |
40 | -rw-r--r--···0·root·········(0)·root·········(0)······329·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index118.js | ||
41 | -rw-r--r--···0·root·········(0)·root·········(0)······840·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index119.js | ||
42 | -rw-r--r--···0·root·········(0)·root·········(0)······331·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index12.js | ||
43 | -rw-r--r--···0·root·········(0)·root·········(0)······237·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index120.js | ||
44 | -rw-r--r--···0·root·········(0)·root·········(0)······384·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index121.js | ||
45 | -rw-r--r--···0·root·········(0)·root·········(0)······29 | 45 | -rw-r--r--···0·root·········(0)·root·········(0)······329·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index122.js |
46 | -rw-r--r--···0·root·········(0)·root·········(0)······840·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index123.js | ||
47 | -rw-r--r--···0·root·········(0)·root·········(0)······237·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index124.js | ||
48 | -rw-r--r--···0·root·········(0)·root·········(0)······384·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index125.js | ||
49 | -rw-r--r--···0·root·········(0)·root·········(0)······296·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index126.js | ||
46 | -rw-r--r--···0·root·········(0)·root·········(0)······270·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index12 | 50 | -rw-r--r--···0·root·········(0)·root·········(0)······270·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index127.js |
47 | -rw-r--r--···0·root·········(0)·root·········(0)······640·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index12 | 51 | -rw-r--r--···0·root·········(0)·root·········(0)······640·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index128.js |
48 | -rw-r--r--···0·root·········(0)·root·········(0)······200·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index12 | 52 | -rw-r--r--···0·root·········(0)·root·········(0)······200·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index129.js |
49 | -rw-r--r--···0·root·········(0)·root·········(0)······185·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index126.js | ||
50 | -rw-r--r--···0·root·········(0)·root·········(0)······272·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index127.js | ||
51 | -rw-r--r--···0·root·········(0)·root·········(0)······311·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index128.js | ||
52 | -rw-r--r--···0·root·········(0)·root·········(0)······307·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index129.js | ||
53 | -rw-r--r--···0·root·········(0)·root·········(0)······ | 53 | -rw-r--r--···0·root·········(0)·root·········(0)······331·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index13.js |
54 | -rw-r--r--···0·root·········(0)·root·········(0)······ | 54 | -rw-r--r--···0·root·········(0)·root·········(0)······185·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index130.js |
55 | -rw-r--r--···0·root·········(0)·root·········(0)······ | 55 | -rw-r--r--···0·root·········(0)·root·········(0)······272·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index131.js |
56 | -rw-r--r--···0·root·········(0)·root·········(0)······348·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index132.js | 56 | -rw-r--r--···0·root·········(0)·root·········(0)······348·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index132.js |
57 | -rw-r--r--···0·root·········(0)·root·········(0)·····1219·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index133.js | 57 | -rw-r--r--···0·root·········(0)·root·········(0)·····1219·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index133.js |
58 | -rw-r--r--···0·root·········(0)·root·········(0)······785·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index134.js | 58 | -rw-r--r--···0·root·········(0)·root·········(0)······785·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index134.js |
59 | -rw-r--r--···0·root·········(0)·root·········(0)······982·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index135.js | 59 | -rw-r--r--···0·root·········(0)·root·········(0)······982·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index135.js |
60 | -rw-r--r--···0·root·········(0)·root·········(0)······161·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index136.js | 60 | -rw-r--r--···0·root·········(0)·root·········(0)······161·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index136.js |
61 | -rw-r--r--···0·root·········(0)·root·········(0)······264·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index137.js | 61 | -rw-r--r--···0·root·········(0)·root·········(0)······264·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index137.js |
62 | -rw-r--r--···0·root·········(0)·root·········(0)······556·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index138.js | 62 | -rw-r--r--···0·root·········(0)·root·········(0)······556·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index138.js |
63 | -rw-r--r--···0·root·········(0)·root·········(0)······ | 63 | -rw-r--r--···0·root·········(0)·root·········(0)······722·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index139.js |
64 | -rw-r--r--···0·root·········(0)·root·········(0)······608·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index14.js | 64 | -rw-r--r--···0·root·········(0)·root·········(0)······608·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index14.js |
65 | -rw-r--r--···0·root·········(0)·root·········(0)······587·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index140.js | ||
65 | -rw-r--r--···0·root·········(0)·root·········(0)······338·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index14 | 66 | -rw-r--r--···0·root·········(0)·root·········(0)······338·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index141.js |
66 | -rw-r--r--···0·root·········(0)·root·········(0)······722·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index141.js | ||
67 | -rw-r--r--···0·root·········(0)·root·········(0)·····3476·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index142.js | 67 | -rw-r--r--···0·root·········(0)·root·········(0)·····3476·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index142.js |
68 | -rw-r--r--···0·root·········(0)·root·········(0)······385·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index143.js | 68 | -rw-r--r--···0·root·········(0)·root·········(0)······385·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index143.js |
69 | -rw-r--r--···0·root·········(0)·root·········(0)·····1567·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index144.js | 69 | -rw-r--r--···0·root·········(0)·root·········(0)·····1567·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index144.js |
70 | -rw-r--r--···0·root·········(0)·root·········(0)······313·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index145.js | 70 | -rw-r--r--···0·root·········(0)·root·········(0)······313·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index145.js |
71 | -rw-r--r--···0·root·········(0)·root·········(0)······659·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index146.js | 71 | -rw-r--r--···0·root·········(0)·root·········(0)······659·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index146.js |
72 | -rw-r--r--···0·root·········(0)·root·········(0)······978·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index147.js | ||
73 | -rw-r--r--···0·root·········(0)·root·········(0)······304·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index14 | 72 | -rw-r--r--···0·root·········(0)·root·········(0)······304·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index147.js |
73 | -rw-r--r--···0·root·········(0)·root·········(0)······978·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index148.js | ||
74 | -rw-r--r--···0·root·········(0)·root·········(0)······ | 74 | -rw-r--r--···0·root·········(0)·root·········(0)······554·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index149.js |
75 | -rw-r--r--···0·root·········(0)·root·········(0)·····1006·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index15.js | 75 | -rw-r--r--···0·root·········(0)·root·········(0)·····1006·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index15.js |
76 | -rw-r--r--···0·root·········(0)·root·········(0)······ | 76 | -rw-r--r--···0·root·········(0)·root·········(0)······844·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index150.js |
77 | -rw-r--r--···0·root·········(0)·root·········(0)······326·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index151.js | ||
77 | -rw-r--r--···0·root·········(0)·root·········(0)·····1251·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index15 | 78 | -rw-r--r--···0·root·········(0)·root·········(0)·····1251·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index152.js |
78 | -rw-r--r--···0·root·········(0)·root·········(0)······285·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index152.js | ||
79 | -rw-r--r--···0·root·········(0)·root·········(0)······471·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index153.js | 79 | -rw-r--r--···0·root·········(0)·root·········(0)······471·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index153.js |
80 | -rw-r--r--···0·root·········(0)·root·········(0)······285·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index154.js | ||
80 | -rw-r--r--···0·root·········(0)·root·········(0)······335·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index15 | 81 | -rw-r--r--···0·root·········(0)·root·········(0)······335·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index155.js |
81 | -rw-r--r--···0·root·········(0)·root·········(0)······293·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index155.js | ||
82 | -rw-r--r--···0·root·········(0)·root·········(0)······293·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index156.js | 82 | -rw-r--r--···0·root·········(0)·root·········(0)······293·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index156.js |
83 | -rw-r--r--···0·root·········(0)·root·········(0)······ | 83 | -rw-r--r--···0·root·········(0)·root·········(0)······293·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index157.js |
84 | -rw-r--r--···0·root·········(0)·root·········(0)······227·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index158.js | 84 | -rw-r--r--···0·root·········(0)·root·········(0)······227·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index158.js |
85 | -rw-r--r--···0·root·········(0)·root·········(0)······ | 85 | -rw-r--r--···0·root·········(0)·root·········(0)······329·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index159.js |
86 | -rw-r--r--···0·root·········(0)·root·········(0)······207·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index16.js | 86 | -rw-r--r--···0·root·········(0)·root·········(0)······207·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index16.js |
87 | -rw-r--r--···0·root·········(0)·root·········(0)······ | 87 | -rw-r--r--···0·root·········(0)·root·········(0)······210·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index160.js |
88 | -rw-r--r--···0·root·········(0)·root·········(0)······191·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index17.js | 88 | -rw-r--r--···0·root·········(0)·root·········(0)······191·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index17.js |
89 | -rw-r--r--···0·root·········(0)·root·········(0)······491·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index18.js | 89 | -rw-r--r--···0·root·········(0)·root·········(0)······491·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index18.js |
90 | -rw-r--r--···0·root·········(0)·root·········(0)······240·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index19.js | 90 | -rw-r--r--···0·root·········(0)·root·········(0)······240·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index19.js |
91 | -rw-r--r--···0·root·········(0)·root·········(0)······715·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index2.js | 91 | -rw-r--r--···0·root·········(0)·root·········(0)······715·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index2.js |
92 | -rw-r--r--···0·root·········(0)·root·········(0)······119·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index20.js | 92 | -rw-r--r--···0·root·········(0)·root·········(0)······119·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index20.js |
93 | -rw-r--r--···0·root·········(0)·root·········(0)······436·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index21.js | 93 | -rw-r--r--···0·root·········(0)·root·········(0)······436·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index21.js |
94 | -rw-r--r--···0·root·········(0)·root·········(0)······289·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index22.js | 94 | -rw-r--r--···0·root·········(0)·root·········(0)······289·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index22.js |
95 | -rw-r--r--···0·root·········(0)·root·········(0)······227·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index23.js | 95 | -rw-r--r--···0·root·········(0)·root·········(0)······227·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index23.js |
96 | -rw-r--r--···0·root·········(0)·root·········(0)·····1708·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index24.js | 96 | -rw-r--r--···0·root·········(0)·root·········(0)·····1708·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index24.js |
97 | -rw-r--r--···0·root·········(0)·root·········(0)······888·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index25.js | 97 | -rw-r--r--···0·root·········(0)·root·········(0)······888·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index25.js |
98 | -rw-r--r--···0·root·········(0)·root·········(0)·····2593·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index26.js | 98 | -rw-r--r--···0·root·········(0)·root·········(0)·····2593·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index26.js |
99 | -rw-r--r--···0·root·········(0)·root·········(0)······255·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index27.js | 99 | -rw-r--r--···0·root·········(0)·root·········(0)······255·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index27.js |
100 | -rw-r--r--···0·root·········(0)·root·········(0)······555·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index28.js | 100 | -rw-r--r--···0·root·········(0)·root·········(0)······555·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index28.js |
101 | -rw-r--r--···0·root·········(0)·root·········(0)······293·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index29.js | 101 | -rw-r--r--···0·root·········(0)·root·········(0)······293·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index29.js |
102 | -rw-r--r--···0·root·········(0)·root·········(0)······43 | 102 | -rw-r--r--···0·root·········(0)·root·········(0)······435·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index3.js |
103 | -rw-r--r--···0·root·········(0)·root·········(0)······401·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index30.js | 103 | -rw-r--r--···0·root·········(0)·root·········(0)······401·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index30.js |
104 | -rw-r--r--···0·root·········(0)·root·········(0)······263·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index31.js | 104 | -rw-r--r--···0·root·········(0)·root·········(0)······263·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index31.js |
105 | -rw-r--r--···0·root·········(0)·root·········(0)······187·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index32.js | 105 | -rw-r--r--···0·root·········(0)·root·········(0)······187·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index32.js |
106 | -rw-r--r--···0·root·········(0)·root·········(0)······268·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index33.js | 106 | -rw-r--r--···0·root·········(0)·root·········(0)······268·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index33.js |
107 | -rw-r--r--···0·root·········(0)·root·········(0)······411·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index34.js | 107 | -rw-r--r--···0·root·········(0)·root·········(0)······411·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index34.js |
108 | -rw-r--r--···0·root·········(0)·root·········(0)······356·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index35.js | 108 | -rw-r--r--···0·root·········(0)·root·········(0)······356·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index35.js |
109 | -rw-r--r--···0·root·········(0)·root·········(0)······532·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index36.js | 109 | -rw-r--r--···0·root·········(0)·root·········(0)······532·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index36.js |
110 | -rw-r--r--···0·root·········(0)·root·········(0)······631·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index37.js | 110 | -rw-r--r--···0·root·········(0)·root·········(0)······631·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index37.js |
111 | -rw-r--r--···0·root·········(0)·root·········(0)······234·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index38.js | 111 | -rw-r--r--···0·root·········(0)·root·········(0)······234·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index38.js |
112 | -rw-r--r--···0·root·········(0)·root·········(0)······ | 112 | -rw-r--r--···0·root·········(0)·root·········(0)······413·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index39.js |
113 | -rw-r--r--···0·root·········(0)·root·········(0)······246·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index4.js | 113 | -rw-r--r--···0·root·········(0)·root·········(0)······246·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index4.js |
114 | -rw-r--r--···0·root·········(0)·root·········(0)······288·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index40.js | ||
114 | -rw-r--r--···0·root·········(0)·root·········(0)······182·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index4 | 115 | -rw-r--r--···0·root·········(0)·root·········(0)······182·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index41.js |
115 | -rw-r--r--···0·root·········(0)·root·········(0)······456·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index4 | 116 | -rw-r--r--···0·root·········(0)·root·········(0)······456·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index42.js |
116 | -rw-r--r--···0·root·········(0)·root·········(0)······205·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index4 | 117 | -rw-r--r--···0·root·········(0)·root·········(0)······205·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index43.js |
117 | -rw-r--r--···0·root·········(0)·root·········(0)······406·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index4 | 118 | -rw-r--r--···0·root·········(0)·root·········(0)······406·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index44.js |
118 | -rw-r--r--···0·root·········(0)·root·········(0)······378·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index4 | 119 | -rw-r--r--···0·root·········(0)·root·········(0)······378·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index45.js |
119 | -rw-r--r--···0·root·········(0)·root·········(0)······403·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index4 | 120 | -rw-r--r--···0·root·········(0)·root·········(0)······403·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index46.js |
120 | -rw-r--r--···0·root·········(0)·root·········(0)·····1291·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index46.js | ||
121 | -rw-r--r--···0·root·········(0)·root·········(0)······199·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index47.js | 121 | -rw-r--r--···0·root·········(0)·root·········(0)······199·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index47.js |
122 | -rw-r--r--···0·root·········(0)·root·········(0)······248·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index48.js | 122 | -rw-r--r--···0·root·········(0)·root·········(0)······248·2023-01-02·04:09:24.000000·./usr/share/nodejs/underscore/amd/index48.js |
Max diff block lines reached; 47685/69673 bytes (68.44%) of diff not shown. |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index9 | 1 | define(['./index94',·'./index26'],·(function(isObject,·_setup)·{ |
2 | ····//·Create·a·naked·function·reference·for·surrogate-prototype-swapping. | 2 | ····//·Create·a·naked·function·reference·for·surrogate-prototype-swapping. |
3 | ····function·ctor()·{ | 3 | ····function·ctor()·{ |
4 | ········return·function()·{}; | 4 | ········return·function()·{}; |
5 | ····} | 5 | ····} |
6 | ····//·An·internal·function·for·creating·a·new·object·that·inherits·from·another. | 6 | ····//·An·internal·function·for·creating·a·new·object·that·inherits·from·another. |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index21',·'./index1 | 1 | define(['./index21',·'./index149',·'./index25'],·(function(_isArrayLike,·keys,·_optimizeCb)·{ |
2 | ····//·Internal·helper·to·create·a·reducing·function,·iterating·left·or·right. | 2 | ····//·Internal·helper·to·create·a·reducing·function,·iterating·left·or·right. |
3 | ····function·createReduce(dir)·{ | 3 | ····function·createReduce(dir)·{ |
4 | ········//·Wrap·code·that·reassigns·argument·variables·in·a·separate·function·than | 4 | ········//·Wrap·code·that·reassigns·argument·variables·in·a·separate·function·than |
5 | ········//·the·one·that·accesses·`arguments.length`·to·avoid·a·perf·hit.·(#1991) | 5 | ········//·the·one·that·accesses·`arguments.length`·to·avoid·a·perf·hit.·(#1991) |
6 | ········var·reducer·=·function(obj,·iteratee,·memo,·initial)·{ | 6 | ········var·reducer·=·function(obj,·iteratee,·memo,·initial)·{ |
7 | ············var·_keys·=·!_isArrayLike(obj)·&&·keys(obj), | 7 | ············var·_keys·=·!_isArrayLike(obj)·&&·keys(obj), |
Offset 1, 18 lines modified | Offset 1, 10 lines modified | ||
1 | define( | 1 | define((function()·{ |
2 | ····//·Is·a·given·variable·undefined? | ||
2 | ····//·Retrieve·the·names·of·an·object's·own·properties. | ||
3 | ····//·Delegates·to·**ECMAScript·5**'s·native·`Object.keys`. | ||
4 | ····function· | 3 | ····function·isUndefined(obj)·{ |
4 | ········return·obj·===·void·0; | ||
5 | ········if·(!isObject(obj))·return·[]; | ||
6 | ········if·(_setup.nativeKeys)·return·_setup.nativeKeys(obj); | ||
7 | ········var·keys·=·[]; | ||
8 | ········for·(var·key·in·obj) | ||
9 | ············if·(_has(obj,·key))·keys.push(key); | ||
10 | ········//·Ahem,·IE·<·9. | ||
11 | ········if·(_setup.hasEnumBug)·_collectNonEnumProps(obj,·keys); | ||
12 | ········return·keys; | ||
13 | ····} | 5 | ····} |
14 | ····return· | 6 | ····return·isUndefined; |
15 | })); | 7 | })); |
Offset 1, 13 lines modified | Offset 1, 7 lines modified | ||
1 | define(['./index | 1 | define(['./index29'],·(function(_tagTester)·{ |
2 | ····var·isWeakSet·=·_tagTester('WeakSet'); | ||
2 | ····//·Get·the·last·element·of·an·array.·Passing·**n**·will·return·the·last·N | ||
3 | ····//·values·in·the·array. | ||
4 | ····function·last(array,·n,·guard)·{ | ||
5 | ········if·(array·==·null·||·array.length·<·1)·return·n·==·null·||·guard·?·void·0·:·[]; | ||
6 | ········if·(n·==·null·||·guard)·return·array[array.length·-·1]; | ||
7 | ········return·rest(array,·Math.max(0,·array.length·-·n)); | ||
8 | ····} | ||
9 | ····return· | 3 | ····return·isWeakSet; |
10 | })); | 4 | })); |
Offset 1, 9 lines modified | Offset 1, 13 lines modified | ||
1 | define(['./index | 1 | define(['./index150',·'./index2'],·(function(underscore,·_baseIteratee)·{ |
2 | ····//·Return·the·position·of·the·last·occurrence·of·an·item·in·an·array, | ||
3 | ····//·or·-1·if·the·item·is·not·included·in·the·array. | ||
4 | ···· | 2 | ····//·External·wrapper·for·our·callback·generator.·Users·may·customize |
3 | ····//·`_.iteratee`·if·they·want·additional·predicate/iteratee·shorthand·styles. | ||
4 | ····//·This·abstraction·hides·the·internal-only·`argCount`·argument. | ||
5 | ····function·iteratee(value,·context)·{ | ||
6 | ········return·_baseIteratee(value,·context,·Infinity); | ||
7 | ····} | ||
8 | ····underscore.iteratee·=·iteratee; | ||
5 | ····return· | 9 | ····return·iteratee; |
6 | })); | 10 | })); |
Offset 1, 18 lines modified | Offset 1, 7 lines modified | ||
1 | define(['./index | 1 | define(['./index29',·'./index28',·'./index24'],·(function(_tagTester,·_stringTagBug,·_methodFingerprint)·{ |
2 | ····var·isWeakMap·=·_stringTagBug.isIE11·?·_methodFingerprint.ie11fingerprint(_methodFingerprint.weakMapMethods)·:·_tagTester('WeakMap'); | ||
2 | ····//·Return·the·results·of·applying·the·iteratee·to·each·element. | ||
3 | ····function·map(obj,·iteratee,·context)·{ | ||
4 | ········iteratee·=·_cb(iteratee,·context); | ||
5 | ········var·_keys·=·!_isArrayLike(obj)·&&·keys(obj), | ||
6 | ············length·=·(_keys·||·obj).length, | ||
7 | ············results·=·Array(length); | ||
8 | ········for·(var·index·=·0;·index·<·length;·index++)·{ | ||
9 | ············var·currentKey·=·_keys·?·_keys[index]·:·index; | ||
10 | ············results[index]·=·iteratee(obj[currentKey],·currentKey,·obj); | ||
11 | ········} | ||
12 | ········return·results; | ||
13 | ····} | ||
14 | ····return· | 3 | ····return·isWeakMap; |
15 | })); | 4 | })); |
Offset 1, 19 lines modified | Offset 1, 13 lines modified | ||
1 | define(['./index | 1 | define(['./index132'],·(function(rest)·{ |
2 | ····//·Get·the·last·element·of·an·array.·Passing·**n**·will·return·the·last·N | ||
3 | ····//·values·in·the·array. | ||
4 | ····function·last(array,·n,·guard)·{ | ||
5 | ········if·(array·==·null·||·array.length·<·1)·return·n·==·null·||·guard·?·void·0·:·[]; | ||
6 | ········if·(n·==·null·||·guard)·return·array[array.length·-·1]; | ||
7 | ········return·rest(array,·Math.max(0,·array.length·-·n)); | ||
2 | ····//·Returns·the·results·of·applying·the·`iteratee`·to·each·element·of·`obj`. | ||
3 | ····//·In·contrast·to·`_.map`·it·returns·an·object. | ||
4 | ····function·mapObject(obj,·iteratee,·context)·{ | ||
5 | ········iteratee·=·_cb(iteratee,·context); | ||
6 | ········var·_keys·=·keys(obj), | ||
7 | ············length·=·_keys.length, | ||
8 | ············results·=·{}; | ||
9 | ········for·(var·index·=·0;·index·<·length;·index++)·{ | ||
10 | ············var·currentKey·=·_keys[index]; | ||
11 | ············results[currentKey]·=·iteratee(obj[currentKey],·currentKey,·obj); | ||
12 | ········} | ||
13 | ········return·results; | ||
14 | ····} | 8 | ····} |
15 | ····return· | 9 | ····return·last; |
16 | })); | 10 | })); |
Offset 1, 14 lines modified | Offset 1, 43 lines modified | ||
1 | define(['./index | 1 | define(['./index133',·'./index116'],·(function(restArguments,·now)·{ |
2 | ····//·Returns·a·predicate·for·checking·whether·an·object·has·a·given·set·of | ||
3 | ····//·`key:value`·pairs. | ||
4 | ····function·matcher(attrs)·{ | ||
5 | ········ | 2 | ····//·When·a·sequence·of·calls·of·the·returned·function·ends,·the·argument |
3 | ····//·function·is·triggered.·The·end·of·a·sequence·is·defined·by·the·`wait` | ||
4 | ····//·parameter.·If·`immediate`·is·passed,·the·argument·function·will·be | ||
5 | ····//·triggered·at·the·beginning·of·the·sequence·instead·of·at·the·end. | ||
6 | ····function·debounce(func,·wait,·immediate)·{ | ||
7 | ········var·timeout,·previous,·args,·result,·context; | ||
6 | ········r | 8 | ········var·later·=·function()·{ |
7 | ············ | 9 | ············var·passed·=·now()·-·previous; |
10 | ············if·(wait·>·passed)·{ | ||
11 | ················timeout·=·setTimeout(later,·wait·-·passed); | ||
12 | ············}·else·{ | ||
13 | ················timeout·=·null; | ||
14 | ················if·(!immediate)·result·=·func.apply(context,·args); | ||
15 | ················//·This·check·is·needed·because·`func`·can·recursively·invoke·`debounced`. | ||
16 | ················if·(!timeout)·args·=·context·=·null; | ||
17 | ············} | ||
8 | ········}; | 18 | ········}; |
19 | ········var·debounced·=·restArguments(function(_args)·{ | ||
20 | ············context·=·this; | ||
21 | ············args·=·_args; | ||
22 | ············previous·=·now(); | ||
23 | ············if·(!timeout)·{ | ||
24 | ················timeout·=·setTimeout(later,·wait); | ||
25 | ················if·(immediate)·result·=·func.apply(context,·args); | ||
26 | ············} | ||
27 | ············return·result; | ||
28 | ········}); | ||
29 | ········debounced.cancel·=·function()·{ | ||
30 | ············clearTimeout(timeout); | ||
31 | ············timeout·=·args·=·context·=·null; | ||
32 | ········}; | ||
33 | ········return·debounced; | ||
9 | ····} | 34 | ····} |
10 | ····return· | 35 | ····return·debounce; |
11 | })); | 36 | })); |
Offset 1, 31 lines modified | Offset 1, 9 lines modified | ||
1 | define(['./index | 1 | define(['./index60',·'./index8'],·(function(findLastIndex,·_createIndexFinder)·{ |
2 | ····//·Return·the·position·of·the·last·occurrence·of·an·item·in·an·array, | ||
3 | ····//·or·-1·if·the·item·is·not·included·in·the·array. | ||
4 | ····var·lastIndexOf·=·_createIndexFinder(-1,·findLastIndex); | ||
2 | ····//·Return·the·maximum·element·(or·element-based·computation). | ||
3 | ····function·max(obj,·iteratee,·context)·{ | ||
4 | ········var·result·=·-Infinity, | ||
5 | ············lastComputed·=·-Infinity, | ||
6 | ············value,·computed; | ||
7 | ········if·(iteratee·==·null·||·(typeof·iteratee·==·'number'·&&·typeof·obj[0]·!=·'object'·&&·obj·!=·null))·{ | ||
8 | ············obj·=·_isArrayLike(obj)·?·obj·:·values(obj); | ||
9 | ············for·(var·i·=·0,·length·=·obj.length;·i·<·length;·i++)·{ | ||
10 | ················value·=·obj[i]; | ||
11 | ················if·(value·!=·null·&&·value·>·result)·{ | ||
12 | ····················result·=·value; | ||
13 | ················} | ||
14 | ············} | ||
15 | ········}·else·{ | ||
16 | ············iteratee·=·_cb(iteratee,·context); | ||
17 | ············each(obj,·function(v,·index,·list)·{ | ||
18 | ················computed·=·iteratee(v,·index,·list); | ||
19 | ················if·(computed·>·lastComputed·||·(computed·===·-Infinity·&&·result·===·-Infinity))·{ | ||
20 | ····················result·=·v; | ||
21 | ····················lastComputed·=·computed; | ||
22 | ················} | ||
23 | ············}); | ||
24 | ········} | ||
25 | ········return·result; | ||
26 | ····} | ||
27 | ····return· | 5 | ····return·lastIndexOf; |
28 | })); | 6 | })); |
Offset 1, 17 lines modified | Offset 1, 18 lines modified | ||
1 | define(['./index19'],·(function(_ | 1 | define(['./index3',·'./index21',·'./index149'],·(function(_cb,·_isArrayLike,·keys)·{ |
2 | ····//·Memoize·an·expensive·function·by·storing·its·results. | ||
3 | ····function·memoize(func,·hasher)·{ | ||
4 | ········var·memoize·=·function(key)·{ | ||
5 | ············var·cache·=·memoize.cache; | ||
6 | ············var·address·=·''·+·(hasher·?·hasher.apply(this,·arguments)·:·key); | ||
7 | ············if·(!_has(cache,·address))·cache[address]·=·func.apply(this,·arguments); | ||
8 | ····· | 2 | ····//·Return·the·results·of·applying·the·iteratee·to·each·element. |
3 | ····function·map(obj,·iteratee,·context)·{ | ||
4 | ········iteratee·=·_cb(iteratee,·context); | ||
5 | ········var·_keys·=·!_isArrayLike(obj)·&&·keys(obj), | ||
6 | ············length·=·(_keys·||·obj).length, | ||
7 | ············results·=·Array(length); | ||
8 | ········for·(var·index·=·0;·index·<·length;·index++)·{ | ||
9 | ············var·currentKey·=·_keys·?·_keys[index]·:·index; | ||
10 | ············results[index]·=·iteratee(obj[currentKey],·currentKey,·obj); | ||
9 | ········} | 11 | ········} |
12 | ········return·results; | ||
10 | ········memoize.cache·=·{}; | ||
11 | ········return·memoize; | ||
12 | ····} | 13 | ····} |
13 | ····return·m | 14 | ····return·map; |
14 | })); | 15 | })); |
Offset 1, 31 lines modified | Offset 1, 19 lines modified | ||
1 | define(['./index | 1 | define(['./index3',·'./index149'],·(function(_cb,·keys)·{ |
2 | ····//·Return·the· | 2 | ····//·Returns·the·results·of·applying·the·`iteratee`·to·each·element·of·`obj`. |
3 | ····//·In·contrast·to·`_.map`·it·returns·an·object. | ||
3 | ····function·m | 4 | ····function·mapObject(obj,·iteratee,·context)·{ |
4 | ········var·result·=·Infinity, | ||
5 | ············lastComputed·=·Infinity, | ||
6 | ············value,·computed; | ||
7 | ········if·(iteratee·==·null·||·(typeof·iteratee·==·'number'·&&·typeof·obj[0]·!=·'object'·&&·obj·!=·null))·{ | ||
8 | ············obj·=·_isArrayLike(obj)·?·obj·:·values(obj); | ||
9 | ············for·(var·i·=·0,·length·=·obj.length;·i·<·length;·i++)·{ | ||
10 | ················value·=·obj[i]; | ||
11 | ················if·(value·!=·null·&&·value·<·result)·{ | ||
12 | ····················result·=·value; | ||
13 | ················} | ||
14 | ············} | ||
15 | ········}·else·{ | ||
16 | ········ | 5 | ········iteratee·=·_cb(iteratee,·context); |
6 | ········var·_keys·=·keys(obj), | ||
7 | ············length·=·_keys.length, | ||
17 | ············each(obj,·function(v,·index,·list)·{ | ||
18 | ················computed·=·iteratee(v,·index,·list); | ||
19 | ················if·(computed·<·lastComputed·||·(computed·===·Infinity·&&·result·===·Infinity))·{ | ||
20 | ············ | 8 | ············results·=·{}; |
21 | ····················lastComputed·=·computed; | ||
22 | ················} | ||
23 | ············ | 9 | ········for·(var·index·=·0;·index·<·length;·index++)·{ |
10 | ············var·currentKey·=·_keys[index]; | ||
11 | ············results[currentKey]·=·iteratee(obj[currentKey],·currentKey,·obj); | ||
24 | ········} | 12 | ········} |
25 | ········return·result; | 13 | ········return·results; |
26 | ····} | 14 | ····} |
27 | ····return·m | 15 | ····return·mapObject; |
28 | })); | 16 | })); |
Offset 1, 18 lines modified | Offset 1, 31 lines modified | ||
1 | define(['./index | 1 | define(['./index21',·'./index155',·'./index3',·'./index51'],·(function(_isArrayLike,·values,·_cb,·each)·{ |
2 | ····//·Add·your·own·custom·functions·to·the·Underscore·object. | ||
3 | ····function·mixin(obj)·{ | ||
4 | ········each(functions(obj),·function(name)·{ | ||
5 | ············var·func·=·underscore[name]·=·obj[name]; | ||
6 | ············underscore.prototype[name]·=·function()·{ | ||
7 | ················var·args·=·[this._wrapped]; | ||
8 | ················_setup.push.apply(args,·arguments); | ||
9 | ···· | 2 | ····//·Return·the·maximum·element·(or·element-based·computation). |
3 | ····function·max(obj,·iteratee,·context)·{ | ||
4 | ········var·result·=·-Infinity, | ||
5 | ············lastComputed·=·-Infinity, | ||
6 | ············value,·computed; | ||
7 | ········if·(iteratee·==·null·||·(typeof·iteratee·==·'number'·&&·typeof·obj[0]·!=·'object'·&&·obj·!=·null))·{ | ||
8 | ············obj·=·_isArrayLike(obj)·?·obj·:·values(obj); | ||
9 | ············for·(var·i·=·0,·length·=·obj.length;·i·<·length;·i++)·{ | ||
10 | ················value·=·obj[i]; | ||
11 | ················if·(value·!=·null·&&·value·>·result)·{ | ||
12 | ····················result·=·value; | ||
13 | ················} | ||
14 | ············} | ||
15 | ········}·else·{ | ||
16 | ············iteratee·=·_cb(iteratee,·context); | ||
17 | ············each(obj,·function(v,·index,·list)·{ | ||
18 | ················computed·=·iteratee(v,·index,·list); | ||
19 | ················if·(computed·>·lastComputed·||·(computed·===·-Infinity·&&·result·===·-Infinity))·{ | ||
20 | ····················result·=·v; | ||
21 | ····················lastComputed·=·computed; | ||
22 | ················} | ||
10 | ············}; | 23 | ············}); |
11 | ········} | 24 | ········} |
12 | ········return· | 25 | ········return·result; |
13 | ····} | 26 | ····} |
14 | ····return·m | 27 | ····return·max; |
15 | })); | 28 | })); |
Offset 1, 12 lines modified | Offset 1, 14 lines modified | ||
1 | define((function()·{ | 1 | define(['./index55',·'./index90'],·(function(extendOwn,·isMatch)·{ |
2 | ····//·Returns·a·negated·version·of·the·passed-in·predicate. | ||
3 | ···· | 2 | ····//·Returns·a·predicate·for·checking·whether·an·object·has·a·given·set·of |
3 | ····//·`key:value`·pairs. | ||
4 | ····function·matcher(attrs)·{ | ||
5 | ········attrs·=·extendOwn({},·attrs); | ||
4 | ········return·function()·{ | 6 | ········return·function(obj)·{ |
5 | ············return· | 7 | ············return·isMatch(obj,·attrs); |
6 | ········}; | 8 | ········}; |
7 | ····} | 9 | ····} |
8 | ····return· | 10 | ····return·matcher; |
9 | })); | 11 | })); |
Offset 1, 8 lines modified | Offset 1, 17 lines modified | ||
1 | define((function()·{ | 1 | define(['./index19'],·(function(_has)·{ |
2 | ····//·Predicate-generating·function.·Often·useful·outside·of·Underscore. | ||
3 | ····function·n | 2 | ····//·Memoize·an·expensive·function·by·storing·its·results. |
3 | ····function·memoize(func,·hasher)·{ | ||
4 | ········var·memoize·=·function(key)·{ | ||
5 | ············var·cache·=·memoize.cache; | ||
6 | ············var·address·=·''·+·(hasher·?·hasher.apply(this,·arguments)·:·key); | ||
7 | ············if·(!_has(cache,·address))·cache[address]·=·func.apply(this,·arguments); | ||
8 | ············return·cache[address]; | ||
9 | ········}; | ||
10 | ········memoize.cache·=·{}; | ||
11 | ········return·memoize; | ||
12 | ····} | ||
4 | ····return· | 13 | ····return·memoize; |
5 | })); | 14 | })); |
Offset 1, 10 lines modified | Offset 1, 31 lines modified | ||
1 | define((function()·{ | 1 | define(['./index21',·'./index155',·'./index3',·'./index51'],·(function(_isArrayLike,·values,·_cb,·each)·{ |
2 | ····//·A·(possibly·faster)·way·to·get·the·current·timestamp·as·an·integer. | ||
3 | ····var·now·=·Date.now·||·function()·{ | ||
4 | ···· | 2 | ····//·Return·the·minimum·element·(or·element-based·computation). |
3 | ····function·min(obj,·iteratee,·context)·{ | ||
4 | ········var·result·=·Infinity, | ||
5 | ············lastComputed·=·Infinity, | ||
6 | ············value,·computed; | ||
7 | ········if·(iteratee·==·null·||·(typeof·iteratee·==·'number'·&&·typeof·obj[0]·!=·'object'·&&·obj·!=·null))·{ | ||
8 | ············obj·=·_isArrayLike(obj)·?·obj·:·values(obj); | ||
9 | ············for·(var·i·=·0,·length·=·obj.length;·i·<·length;·i++)·{ | ||
10 | ················value·=·obj[i]; | ||
11 | ················if·(value·!=·null·&&·value·<·result)·{ | ||
12 | ····················result·=·value; | ||
13 | ················} | ||
14 | ············} | ||
15 | ········}·else·{ | ||
16 | ············iteratee·=·_cb(iteratee,·context); | ||
17 | ············each(obj,·function(v,·index,·list)·{ | ||
18 | ················computed·=·iteratee(v,·index,·list); | ||
19 | ················if·(computed·<·lastComputed·||·(computed·===·Infinity·&&·result·===·Infinity))·{ | ||
20 | ····················result·=·v; | ||
21 | ····················lastComputed·=·computed; | ||
22 | ················} | ||
23 | ············}); | ||
24 | ········} | ||
25 | ········return·result; | ||
5 | ····} | 26 | ····} |
6 | ····return· | 27 | ····return·min; |
7 | })); | 28 | })); |
Offset 1, 20 lines modified | Offset 1, 18 lines modified | ||
1 | define(['./index1 | 1 | define(['./index150',·'./index51',·'./index64',·'./index26',·'./index4'],·(function(underscore,·each,·functions,·_setup,·_chainResult)·{ |
2 | ····//·Add·your·own·custom·functions·to·the·Underscore·object. | ||
3 | ····function·mixin(obj)·{ | ||
4 | ········each(functions(obj),·function(name)·{ | ||
5 | ············var·func·=·underscore[name]·=·obj[name]; | ||
6 | ············underscore.prototype[name]·=·function()·{ | ||
7 | ················var·args·=·[this._wrapped]; | ||
8 | ················_setup.push.apply(args,·arguments); | ||
9 | ················return·_chainResult(this,·func.apply(underscore,·args)); | ||
2 | ····//·Converts·lists·into·objects.·Pass·either·a·single·array·of·`[key,·value]` | ||
3 | ····//·pairs,·or·two·parallel·arrays·of·the·same·length·--·one·of·keys,·and·one·of | ||
4 | ····//·the·corresponding·values.·Passing·by·pairs·is·the·reverse·of·`_.pairs`. | ||
5 | ····function·object(list,·values)·{ | ||
6 | ········var·result·=·{}; | ||
7 | ········for·(var·i·=·0,·length·=·_getLength(list);·i·<·length;·i++)·{ | ||
8 | ············if·(values)·{ | ||
9 | ················result[list[i]]·=·values[i]; | ||
10 | ············}·else·{ | ||
11 | ················result[list[i][0]]·=·list[i][1]; | ||
12 | ············} | 10 | ············}; |
13 | ········} | 11 | ········}); |
14 | ········return· | 12 | ········return·underscore; |
15 | ····} | 13 | ····} |
16 | ····return· | 14 | ····return·mixin; |
17 | })); | 15 | })); |
Offset 1, 21 lines modified | Offset 1, 12 lines modified | ||
1 | define( | 1 | define((function()·{ |
2 | ····//·Returns·a·negated·version·of·the·passed-in·predicate. | ||
3 | ····function·negate(predicate)·{ | ||
4 | ········return·function()·{ | ||
5 | ············return·!predicate.apply(this,·arguments); | ||
2 | ····//·Return·a·copy·of·the·object·without·the·disallowed·properties. | ||
3 | ····var·omit·=·restArguments(function(obj,·keys)·{ | ||
4 | ········var·iteratee·=·keys[0], | ||
5 | ············context; | ||
6 | ········if·(isFunction(iteratee))·{ | ||
7 | ············iteratee·=·negate(iteratee); | ||
8 | ············if·(keys.length·>·1)·context·=·keys[1]; | ||
9 | ········}·else·{ | ||
10 | ············keys·=·map(_flatten(keys,·false,·false),·String); | ||
11 | ············iteratee·=·function(value,·key)·{ | ||
12 | ················return·!contains(keys,·key); | ||
13 | ············}; | ||
14 | ········} | 6 | ········}; |
15 | ········return·pick(obj,·iteratee,·context); | ||
16 | ····} | 7 | ····} |
17 | ····return· | 8 | ····return·negate; |
18 | })); | 9 | })); |
Offset 1, 9 lines modified | Offset 1, 8 lines modified | ||
1 | define( | 1 | define((function()·{ |
2 | ····//·Predicate-generating·function.·Often·useful·outside·of·Underscore. | ||
3 | ····function·noop()·{} | ||
2 | ····//·Returns·a·function·that·will·be·executed·at·most·one·time,·no·matter·how | ||
3 | ····//·often·you·call·it.·Useful·for·lazy·initialization. | ||
4 | ····var·once·=·partial(before,·2); | ||
5 | ····return· | 4 | ····return·noop; |
6 | })); | 5 | })); |
Offset 1, 17 lines modified | Offset 1, 10 lines modified | ||
1 | define( | 1 | define((function()·{ |
2 | ····//·A·(possibly·faster)·way·to·get·the·current·timestamp·as·an·integer. | ||
3 | ····var·now·=·Date.now·||·function()·{ | ||
4 | ········return·new·Date().getTime(); | ||
2 | ····//·Convert·an·object·into·a·list·of·`[key,·value]`·pairs. | ||
3 | ····//·The·opposite·of·`_.object`·with·one·argument. | ||
4 | ····function·pairs(obj)·{ | ||
5 | ········var·_keys·=·keys(obj); | ||
6 | ········var·length·=·_keys.length; | ||
7 | ········var·pairs·=·Array(length); | ||
8 | ········for·(var·i·=·0;·i·<·length;·i++)·{ | ||
9 | ············pairs[i]·=·[_keys[i],·obj[_keys[i]]]; | ||
10 | ········} | ||
11 | ········return·pairs; | ||
12 | ····} | 5 | ····}; |
13 | ····return· | 6 | ····return·now; |
14 | })); | 7 | })); |
Offset 1, 26 lines modified | Offset 1, 20 lines modified | ||
1 | define(['./index1 | 1 | define(['./index17'],·(function(_getLength)·{ |
2 | ····//·Converts·lists·into·objects.·Pass·either·a·single·array·of·`[key,·value]` | ||
3 | ····//·pairs,·or·two·parallel·arrays·of·the·same·length·--·one·of·keys,·and·one·of | ||
4 | ····//·the·corresponding·values.·Passing·by·pairs·is·the·reverse·of·`_.pairs`. | ||
5 | ····function·object(list,·values)·{ | ||
6 | ········var·result·=·{}; | ||
7 | ········for·(var·i·=·0,·length·=·_getLength(list);·i·<·length;·i++)·{ | ||
8 | ············if·(values)·{ | ||
9 | ················result[list[i]]·=·values[i]; | ||
10 | ············}·else·{ | ||
11 | ················result[list[i][0]]·=·list[i][1]; | ||
2 | ····//·Partially·apply·a·function·by·creating·a·version·that·has·had·some·of·its | ||
3 | ····//·arguments·pre-filled,·without·changing·its·dynamic·`this`·context.·`_`·acts | ||
4 | ····//·as·a·placeholder·by·default,·allowing·any·combination·of·arguments·to·be | ||
5 | ····//·pre-filled.·Set·`_.partial.placeholder`·for·a·custom·placeholder·argument. | ||
6 | ····var·partial·=·restArguments(function(func,·boundArgs)·{ | ||
7 | ········var·placeholder·=·partial.placeholder; | ||
8 | ········var·bound·=·function()·{ | ||
9 | ············var·position·=·0, | ||
10 | ················length·=·boundArgs.length; | ||
11 | ············var·args·=·Array(length); | ||
12 | ············for·(var·i·=·0;·i·<·length;·i++)·{ | ||
13 | ················args[i]·=·boundArgs[i]·===·placeholder·?·arguments[position++]·:·boundArgs[i]; | ||
14 | ············} | 12 | ············} |
15 | ············while·(position·<·arguments.length)·args.push(arguments[position++]); | ||
16 | ············return·_executeBound(func,·bound,·this,·this,·args); | ||
17 | ········} | 13 | ········} |
18 | ········return· | 14 | ········return·result; |
19 | ····} | 15 | ····} |
16 | ····return·object; | ||
20 | ····partial.placeholder·=·underscore; | ||
21 | ····return·partial; | ||
22 | })); | 17 | })); |
Offset 1, 11 lines modified | Offset 1, 21 lines modified | ||
1 | define(['./index18'],·(function(_ | 1 | define(['./index133',·'./index88',·'./index114',·'./index107',·'./index15',·'./index44',·'./index123'],·(function(restArguments,·isFunction,·negate,·map,·_flatten,·contains,·pick)·{ |
2 | ····//·Split·a·collection·into·two·arrays:·one·whose·elements·all·pass·the·given | ||
3 | ····//·truth·test,·and·one·whose·elements·all·do·not·pass·the·truth·test. | ||
4 | ····var·partition·=·_group(function(result,·value,·pass)·{ | ||
5 | ········result[pass·?·0·:·1].push(value); | ||
6 | ···· | 2 | ····//·Return·a·copy·of·the·object·without·the·disallowed·properties. |
3 | ····var·omit·=·restArguments(function(obj,·keys)·{ | ||
4 | ········var·iteratee·=·keys[0], | ||
5 | ············context; | ||
6 | ········if·(isFunction(iteratee))·{ | ||
7 | ············iteratee·=·negate(iteratee); | ||
8 | ············if·(keys.length·>·1)·context·=·keys[1]; | ||
9 | ········}·else·{ | ||
10 | ············keys·=·map(_flatten(keys,·false,·false),·String); | ||
11 | ············iteratee·=·function(value,·key)·{ | ||
12 | ················return·!contains(keys,·key); | ||
13 | ············}; | ||
14 | ········} | ||
15 | ········return·pick(obj,·iteratee,·context); | ||
16 | ····}); | ||
7 | ····return· | 17 | ····return·omit; |
8 | })); | 18 | })); |
Offset 1, 26 lines modified | Offset 1, 9 lines modified | ||
1 | define(['./index1 | 1 | define(['./index121',·'./index35'],·(function(partial,·before)·{ |
2 | ····//·Returns·a·function·that·will·be·executed·at·most·one·time,·no·matter·how | ||
3 | ····//·often·you·call·it.·Useful·for·lazy·initialization. | ||
4 | ····var·once·=·partial(before,·2); | ||
2 | ····//·Return·a·copy·of·the·object·only·containing·the·allowed·properties. | ||
3 | ····var·pick·=·restArguments(function(obj,·keys)·{ | ||
4 | ········var·result·=·{}, | ||
5 | ············iteratee·=·keys[0]; | ||
6 | ········if·(obj·==·null)·return·result; | ||
7 | ········if·(isFunction(iteratee))·{ | ||
8 | ············if·(keys.length·>·1)·iteratee·=·_optimizeCb(iteratee,·keys[1]); | ||
9 | ············keys·=·allKeys(obj); | ||
10 | ········}·else·{ | ||
11 | ············iteratee·=·_keyInObj; | ||
12 | ············keys·=·_flatten(keys,·false,·false); | ||
13 | ············obj·=·Object(obj); | ||
14 | ········} | ||
15 | ········for·(var·i·=·0,·length·=·keys.length;·i·<·length;·i++)·{ | ||
16 | ············var·key·=·keys[i]; | ||
17 | ············var·value·=·obj[key]; | ||
18 | ············if·(iteratee(value,·key,·obj))·result[key]·=·value; | ||
19 | ········} | ||
20 | ········return·result; | ||
21 | ····}); | ||
22 | ····return· | 5 | ····return·once; |
23 | })); | 6 | })); |
Offset 1, 15 lines modified | Offset 1, 15 lines modified | ||
1 | define((function()·{ | 1 | define((function()·{ |
2 | ····//·Internal·function·to·obtain·a·nested·property·in·`obj`·along·`path`. | ||
3 | ····function·deepGet(obj,·path)·{ | ||
4 | ········var·length·=·path.length; | ||
5 | ········for·(var·i·=·0;·i·<·length;·i++)·{ | ||
6 | ············if·(obj·==·null)·return·void·0; | ||
7 | ············obj·=·obj[path[i]]; | ||
8 | ········} | ||
9 | ···· | 2 | ····//·Internal·list·of·HTML·entities·for·escaping. |
3 | ····var·escapeMap·=·{ | ||
4 | ········'&':·'&', | ||
5 | ········'<':·'<', | ||
6 | ········'>':·'>', | ||
7 | ········'"':·'"', | ||
8 | ········"'":·''', | ||
9 | ········'`':·'`' | ||
10 | ····} | 10 | ····}; |
11 | ····return· | 11 | ····return·escapeMap; |
12 | })); | 12 | })); |
Offset 1, 10 lines modified | Offset 1, 17 lines modified | ||
1 | define(['./index1 | 1 | define(['./index149'],·(function(keys)·{ |
2 | ····//·Conve | 2 | ····//·Convert·an·object·into·a·list·of·`[key,·value]`·pairs. |
3 | ····//·The·opposite·of·`_.object`·with·one·argument. | ||
3 | ····function·p | 4 | ····function·pairs(obj)·{ |
4 | ········ | 5 | ········var·_keys·=·keys(obj); |
6 | ········var·length·=·_keys.length; | ||
7 | ········var·pairs·=·Array(length); | ||
8 | ········for·(var·i·=·0;·i·<·length;·i++)·{ | ||
9 | ············pairs[i]·=·[_keys[i],·obj[_keys[i]]]; | ||
10 | ········} | ||
11 | ········return·pairs; | ||
5 | ····} | 12 | ····} |
6 | ····return·p | 13 | ····return·pairs; |
7 | })); | 14 | })); |
Offset 1, 14 lines modified | Offset 1, 26 lines modified | ||
1 | define(['./index1 | 1 | define(['./index133',·'./index14',·'./index150'],·(function(restArguments,·_executeBound,·underscore)·{ |
2 | ····//·Creates·a·function·that,·when·passed·an·object,·will·traverse·that·object’s | ||
3 | ····//·properties·down·the·given·`path`,·specified·as·an·array·of·keys·or·indices. | ||
4 | ····function·property(path)·{ | ||
5 | ········ | 2 | ····//·Partially·apply·a·function·by·creating·a·version·that·has·had·some·of·its |
3 | ····//·arguments·pre-filled,·without·changing·its·dynamic·`this`·context.·`_`·acts | ||
4 | ····//·as·a·placeholder·by·default,·allowing·any·combination·of·arguments·to·be | ||
5 | ····//·pre-filled.·Set·`_.partial.placeholder`·for·a·custom·placeholder·argument. | ||
6 | ····var·partial·=·restArguments(function(func,·boundArgs)·{ | ||
7 | ········var·placeholder·=·partial.placeholder; | ||
6 | ········r | 8 | ········var·bound·=·function()·{ |
7 | ············ | 9 | ············var·position·=·0, |
10 | ················length·=·boundArgs.length; | ||
11 | ············var·args·=·Array(length); | ||
12 | ············for·(var·i·=·0;·i·<·length;·i++)·{ | ||
13 | ················args[i]·=·boundArgs[i]·===·placeholder·?·arguments[position++]·:·boundArgs[i]; | ||
14 | ············} | ||
15 | ············while·(position·<·arguments.length)·args.push(arguments[position++]); | ||
16 | ············return·_executeBound(func,·bound,·this,·this,·args); | ||
8 | ········}; | 17 | ········}; |
18 | ········return·bound; | ||
9 | ····} | 19 | ····}); |
20 | ····partial.placeholder·=·underscore; | ||
10 | ····return·p | 21 | ····return·partial; |
11 | })); | 22 | })); |
Offset 1, 13 lines modified | Offset 1, 11 lines modified | ||
1 | define(['./index1 | 1 | define(['./index18'],·(function(_group)·{ |
2 | ····//·Split·a·collection·into·two·arrays:·one·whose·elements·all·pass·the·given | ||
3 | ····//·truth·test,·and·one·whose·elements·all·do·not·pass·the·truth·test. | ||
4 | ····var·partition·=·_group(function(result,·value,·pass)·{ | ||
5 | ········result[pass·?·0·:·1].push(value); | ||
6 | ····},·true); | ||
2 | ····//·Generates·a·function·for·a·given·object·that·returns·a·given·property. | ||
3 | ····function·propertyOf(obj)·{ | ||
4 | ········if·(obj·==·null)·return·noop; | ||
5 | ········return·function(path)·{ | ||
6 | ············return·get(obj,·path); | ||
7 | ········}; | ||
8 | ····} | ||
9 | ····return·p | 7 | ····return·partition; |
10 | })); | 8 | })); |
Offset 1, 14 lines modified | Offset 1, 26 lines modified | ||
1 | define((function()·{ | 1 | define(['./index133',·'./index88',·'./index25',·'./index34',·'./index23',·'./index15'],·(function(restArguments,·isFunction,·_optimizeCb,·allKeys,·_keyInObj,·_flatten)·{ |
2 | ····//·Return·a·random·integer·between·`min`·and·`max`·(inclusive). | ||
3 | ····function·random(min,·max)·{ | ||
4 | ········if·(max·==·null)·{ | ||
5 | ············max·=·min; | ||
6 | ············ | 2 | ····//·Return·a·copy·of·the·object·only·containing·the·allowed·properties. |
3 | ····var·pick·=·restArguments(function(obj,·keys)·{ | ||
4 | ········var·result·=·{}, | ||
5 | ············iteratee·=·keys[0]; | ||
6 | ········if·(obj·==·null)·return·result; | ||
7 | ········if·(isFunction(iteratee))·{ | ||
8 | ············if·(keys.length·>·1)·iteratee·=·_optimizeCb(iteratee,·keys[1]); | ||
9 | ············keys·=·allKeys(obj); | ||
10 | ········}·else·{ | ||
11 | ············iteratee·=·_keyInObj; | ||
12 | ············keys·=·_flatten(keys,·false,·false); | ||
13 | ············obj·=·Object(obj); | ||
7 | ········} | 14 | ········} |
8 | ········r | 15 | ········for·(var·i·=·0,·length·=·keys.length;·i·<·length;·i++)·{ |
16 | ············var·key·=·keys[i]; | ||
17 | ············var·value·=·obj[key]; | ||
18 | ············if·(iteratee(value,·key,·obj))·result[key]·=·value; | ||
19 | ········} | ||
20 | ········return·result; | ||
9 | ····} | 21 | ····}); |
10 | ····return· | 22 | ····return·pick; |
11 | })); | 23 | })); |
Offset 1, 27 lines modified | Offset 1, 10 lines modified | ||
1 | define((function()·{ | 1 | define(['./index107',·'./index125'],·(function(map,·property)·{ |
2 | ····//·Convenience·version·of·a·common·use·case·of·`_.map`:·fetching·a·property. | ||
3 | ····function·pluck(obj,·key)·{ | ||
4 | ········return·map(obj,·property(key)); | ||
2 | ····//·Generate·an·integer·Array·containing·an·arithmetic·progression.·A·port·of | ||
3 | ····//·the·native·Python·`range()`·function.·See | ||
4 | ····//·[the·Python·documentation](https://docs.python.org/library/functions.html#range). | ||
5 | ····function·range(start,·stop,·step)·{ | ||
6 | ········if·(stop·==·null)·{ | ||
7 | ············stop·=·start·||·0; | ||
8 | ············start·=·0; | ||
9 | ········} | ||
10 | ········if·(!step)·{ | ||
11 | ············step·=·stop·<·start·?·-1·:·1; | ||
12 | ········} | ||
13 | ········var·length·=·Math.max(Math.ceil((stop·-·start)·/·step),·0); | ||
14 | ········var·range·=·Array(length); | ||
15 | ········for·(var·idx·=·0;·idx·<·length;·idx++,·start·+=·step)·{ | ||
16 | ············range[idx]·=·start; | ||
17 | ········} | ||
18 | ········return·range; | ||
19 | ····} | 5 | ····} |
20 | ····return· | 6 | ····return·pluck; |
21 | })); | 7 | })); |
Offset 1, 9 lines modified | Offset 1, 14 lines modified | ||
1 | define(['./index1 | 1 | define(['./index13',·'./index31'],·(function(_deepGet,·_toPath)·{ |
2 | ····//·**Reduce**·builds·up·a·single·result·from·a·list·of·values,·aka·`inject`, | ||
3 | ····//·or·`foldl`. | ||
4 | ···· | 2 | ····//·Creates·a·function·that,·when·passed·an·object,·will·traverse·that·object’s |
3 | ····//·properties·down·the·given·`path`,·specified·as·an·array·of·keys·or·indices. | ||
4 | ····function·property(path)·{ | ||
5 | ········path·=·_toPath(path); | ||
6 | ········return·function(obj)·{ | ||
7 | ············return·_deepGet(obj,·path); | ||
8 | ········}; | ||
9 | ····} | ||
5 | ····return·r | 10 | ····return·property; |
6 | })); | 11 | })); |
Offset 1, 8 lines modified | Offset 1, 13 lines modified | ||
1 | define(['./index1 | 1 | define(['./index115',·'./index65'],·(function(noop,·get)·{ |
2 | ····//·The·right-associative·version·of·reduce,·also·known·as·`foldr`. | ||
3 | ···· | 2 | ····//·Generates·a·function·for·a·given·object·that·returns·a·given·property. |
3 | ····function·propertyOf(obj)·{ | ||
4 | ········if·(obj·==·null)·return·noop; | ||
5 | ········return·function(path)·{ | ||
6 | ············return·get(obj,·path); | ||
7 | ········}; | ||
8 | ····} | ||
4 | ····return· | 9 | ····return·propertyOf; |
5 | })); | 10 | })); |
Offset 1, 10 lines modified | Offset 1, 14 lines modified | ||
1 | define( | 1 | define((function()·{ |
2 | ····//·Return·all·the·elements·for·which·a·truth·test·fails. | ||
3 | ····function·reject(obj,·predicate,·context)·{ | ||
4 | ···· | 2 | ····//·Return·a·random·integer·between·`min`·and·`max`·(inclusive). |
3 | ····function·random(min,·max)·{ | ||
4 | ········if·(max·==·null)·{ | ||
5 | ············max·=·min; | ||
6 | ············min·=·0; | ||
7 | ········} | ||
8 | ········return·min·+·Math.floor(Math.random()·*·(max·-·min·+·1)); | ||
5 | ····} | 9 | ····} |
6 | ····return·r | 10 | ····return·random; |
7 | })); | 11 | })); |
Offset 1, 11 lines modified | Offset 1, 27 lines modified | ||
1 | define( | 1 | define((function()·{ |
2 | ····//·Flatten·out·an·array,·either·recursively·(by·default),·or·up·to·`depth`. | ||
3 | ····//·Passing·`true`·or·`false`·as·`depth`·means·`1`·or·`Infinity`,·respectively. | ||
4 | ····function·flatten(array,·depth)·{ | ||
5 | ····· | 2 | ····//·Generate·an·integer·Array·containing·an·arithmetic·progression.·A·port·of |
3 | ····//·the·native·Python·`range()`·function.·See | ||
4 | ····//·[the·Python·documentation](https://docs.python.org/library/functions.html#range). | ||
5 | ····function·range(start,·stop,·step)·{ | ||
6 | ········if·(stop·==·null)·{ | ||
7 | ············stop·=·start·||·0; | ||
8 | ············start·=·0; | ||
9 | ········} | ||
10 | ········if·(!step)·{ | ||
11 | ············step·=·stop·<·start·?·-1·:·1; | ||
12 | ········} | ||
13 | ········var·length·=·Math.max(Math.ceil((stop·-·start)·/·step),·0); | ||
14 | ········var·range·=·Array(length); | ||
15 | ········for·(var·idx·=·0;·idx·<·length;·idx++,·start·+=·step)·{ | ||
16 | ············range[idx]·=·start; | ||
17 | ········} | ||
18 | ········return·range; | ||
6 | ····} | 19 | ····} |
7 | ····return· | 20 | ····return·range; |
8 | })); | 21 | })); |
Offset 1, 14 lines modified | Offset 1, 9 lines modified | ||
1 | define(['./index | 1 | define(['./index10'],·(function(_createReduce)·{ |
2 | ····//·**Reduce**·builds·up·a·single·result·from·a·list·of·values,·aka·`inject`, | ||
3 | ····//·or·`foldl`. | ||
4 | ····var·reduce·=·_createReduce(1); | ||
2 | ····//·Return·a·sorted·list·of·the·function·names·available·on·the·object. | ||
3 | ····function·functions(obj)·{ | ||
4 | ········var·names·=·[]; | ||
5 | ········for·(var·key·in·obj)·{ | ||
6 | ············if·(isFunction(obj[key]))·names.push(key); | ||
7 | ········} | ||
8 | ········return·names.sort(); | ||
9 | ····} | ||
10 | ····return· | 5 | ····return·reduce; |
11 | })); | 6 | })); |
Offset 1, 15 lines modified | Offset 1, 15 lines modified | ||
1 | define((function()·{ | 1 | define((function()·{ |
2 | ····//·Internal·list·of·HTML·entities·for·escaping. | ||
3 | ····var·escapeMap·=·{ | ||
4 | ········'&':·'&', | ||
5 | ········'<':·'<', | ||
6 | ········'>':·'>', | ||
7 | ········'"':·'"', | ||
8 | ········"'":·''', | ||
9 | ········ | 2 | ····//·Internal·function·to·obtain·a·nested·property·in·`obj`·along·`path`. |
3 | ····function·deepGet(obj,·path)·{ | ||
4 | ········var·length·=·path.length; | ||
5 | ········for·(var·i·=·0;·i·<·length;·i++)·{ | ||
6 | ············if·(obj·==·null)·return·void·0; | ||
7 | ············obj·=·obj[path[i]]; | ||
8 | ········} | ||
9 | ········return·length·?·obj·:·void·0; | ||
10 | ····} | 10 | ····} |
11 | ····return· | 11 | ····return·deepGet; |
12 | })); | 12 | })); |
Offset 1, 14 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index | 1 | define(['./index10'],·(function(_createReduce)·{ |
2 | ····//·The·right-associative·version·of·reduce,·also·known·as·`foldr`. | ||
3 | ····var·reduceRight·=·_createReduce(-1); | ||
2 | ····//·Get·the·value·of·the·(deep)·property·on·`path`·from·`object`. | ||
3 | ····//·If·any·property·in·`path`·does·not·exist·or·if·the·value·is | ||
4 | ····//·`undefined`,·return·`defaultValue`·instead. | ||
5 | ····//·The·`path`·is·normalized·through·`_.toPath`. | ||
6 | ····function·get(object,·path,·defaultValue)·{ | ||
7 | ········var·value·=·_deepGet(object,·_toPath(path)); | ||
8 | ········return·isUndefined(value)·?·defaultValue·:·value; | ||
9 | ····} | ||
10 | ····return·g | 4 | ····return·reduceRight; |
11 | })); | 5 | })); |
Offset 1, 12 lines modified | Offset 1, 10 lines modified | ||
1 | define(['./index | 1 | define(['./index56',·'./index114',·'./index3'],·(function(filter,·negate,·_cb)·{ |
2 | ····//·Return·all·the·elements·for·which·a·truth·test·fails. | ||
3 | ····function·reject(obj,·predicate,·context)·{ | ||
4 | ········return·filter(obj,·negate(_cb(predicate)),·context); | ||
2 | ····//·Groups·the·object's·values·by·a·criterion.·Pass·either·a·string·attribute | ||
3 | ····//·to·group·by,·or·a·function·that·returns·the·criterion. | ||
4 | ····var·groupBy·=·_group(function(result,·value,·key)·{ | ||
5 | ········if·(_has(result,·key))·result[key].push(value); | ||
6 | ········else·result[key]·=·[value]; | ||
7 | ····} | 5 | ····} |
8 | ····return· | 6 | ····return·reject; |
9 | })); | 7 | })); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index8 | 1 | define(['./index88',·'./index31'],·(function(isFunction,·_toPath)·{ |
2 | ····//·Traverses·the·children·of·`obj`·along·`path`.·If·a·child·is·a·function,·it | 2 | ····//·Traverses·the·children·of·`obj`·along·`path`.·If·a·child·is·a·function,·it |
3 | ····//·is·invoked·with·its·parent·as·context.·Returns·the·value·of·the·final | 3 | ····//·is·invoked·with·its·parent·as·context.·Returns·the·value·of·the·final |
4 | ····//·child,·or·`fallback`·if·any·child·is·undefined. | 4 | ····//·child,·or·`fallback`·if·any·child·is·undefined. |
5 | ····function·result(obj,·path,·fallback)·{ | 5 | ····function·result(obj,·path,·fallback)·{ |
6 | ········path·=·_toPath(path); | 6 | ········path·=·_toPath(path); |
7 | ········var·length·=·path.length; | 7 | ········var·length·=·path.length; |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index21',·'./index15 | 1 | define(['./index21',·'./index155',·'./index17',·'./index127',·'./index146'],·(function(_isArrayLike,·values,·_getLength,·random,·toArray)·{ |
2 | ····//·Sample·**n**·random·values·from·a·collection·using·the·modern·version·of·the | 2 | ····//·Sample·**n**·random·values·from·a·collection·using·the·modern·version·of·the |
3 | ····//·[Fisher-Yates·shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). | 3 | ····//·[Fisher-Yates·shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). |
4 | ····//·If·**n**·is·not·specified,·returns·a·single·random·element. | 4 | ····//·If·**n**·is·not·specified,·returns·a·single·random·element. |
5 | ····//·The·internal·`guard`·argument·allows·it·to·work·with·`_.map`. | 5 | ····//·The·internal·`guard`·argument·allows·it·to·work·with·`_.map`. |
6 | ····function·sample(obj,·n,·guard)·{ | 6 | ····function·sample(obj,·n,·guard)·{ |
7 | ········if·(n·==·null·||·guard)·{ | 7 | ········if·(n·==·null·||·guard)·{ |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index21',·'./index1 | 1 | define(['./index21',·'./index149'],·(function(_isArrayLike,·keys)·{ |
2 | ····//·Return·the·number·of·elements·in·a·collection. | 2 | ····//·Return·the·number·of·elements·in·a·collection. |
3 | ····function·size(obj)·{ | 3 | ····function·size(obj)·{ |
4 | ········if·(obj·==·null)·return·0; | 4 | ········if·(obj·==·null)·return·0; |
5 | ········return·_isArrayLike(obj)·?·obj.length·:·keys(obj).length; | 5 | ········return·_isArrayLike(obj)·?·obj.length·:·keys(obj).length; |
6 | ····} | 6 | ····} |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index3',·'./index21',·'./index1 | 1 | define(['./index3',·'./index21',·'./index149'],·(function(_cb,·_isArrayLike,·keys)·{ |
2 | ····//·Determine·if·at·least·one·element·in·the·object·passes·a·truth·test. | 2 | ····//·Determine·if·at·least·one·element·in·the·object·passes·a·truth·test. |
3 | ····function·some(obj,·predicate,·context)·{ | 3 | ····function·some(obj,·predicate,·context)·{ |
4 | ········predicate·=·_cb(predicate,·context); | 4 | ········predicate·=·_cb(predicate,·context); |
5 | ········var·_keys·=·!_isArrayLike(obj)·&&·keys(obj), | 5 | ········var·_keys·=·!_isArrayLike(obj)·&&·keys(obj), |
6 | ············length·=·(_keys·||·obj).length; | 6 | ············length·=·(_keys·||·obj).length; |
7 | ········for·(var·index·=·0;·index·<·length;·index++)·{ | 7 | ········for·(var·index·=·0;·index·<·length;·index++)·{ |
Offset 1, 20 lines modified | Offset 1, 26 lines modified | ||
1 | define(['./index3',·'./index17'],·(function(_cb,· | 1 | define(['./index3',·'./index124',·'./index107'],·(function(_cb,·pluck,·map)·{ |
2 | ····//·Sort·the·object's·values·by·a·criterion·produced·by·an·iteratee. | ||
2 | ····//·Use·a·comparator·function·to·figure·out·the·smallest·index·at·which | ||
3 | ····//·an·object·should·be·inserted·so·as·to·maintain·order.·Uses·binary·search. | ||
4 | ····function·sort | 3 | ····function·sortBy(obj,·iteratee,·context)·{ |
4 | ········var·index·=·0; | ||
5 | ········iteratee·=·_cb(iteratee,·context | 5 | ········iteratee·=·_cb(iteratee,·context); |
6 | ········var·value·=·iteratee(obj); | ||
7 | ········var·low·=·0, | ||
8 | ············high·=·_getLength(array); | ||
9 | ········while·(low·<·high)·{ | ||
10 | ············var·mid·=·Math.floor((low·+·high)·/·2); | ||
11 | ············if·(iteratee(array[mid])·<·value)·low·=·mid·+·1; | ||
12 | ········ | 6 | ········return·pluck(map(obj,·function(value,·key,·list)·{ |
7 | ············return·{ | ||
8 | ················value:·value, | ||
9 | ················index:·index++, | ||
10 | ················criteria:·iteratee(value,·key,·list) | ||
11 | ············}; | ||
12 | ········}).sort(function(left,·right)·{ | ||
13 | ············var·a·=·left.criteria; | ||
14 | ············var·b·=·right.criteria; | ||
15 | ············if·(a·!==·b)·{ | ||
16 | ················if·(a·>·b·||·a·===·void·0)·return·1; | ||
17 | ················if·(a·<·b·||·b·===·void·0)·return·-1; | ||
13 | ········} | 18 | ············} |
14 | ········return·l | 19 | ············return·left.index·-·right.index; |
20 | ········}),·'value'); | ||
15 | ····} | 21 | ····} |
16 | ····return·sort | 22 | ····return·sortBy; |
17 | })); | 23 | })); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index',·'./index9 | 1 | define(['./index',·'./index94'],·(function(_baseCreate,·isObject)·{ |
2 | ····//·Internal·function·to·execute·`sourceFunc`·bound·to·`context`·with·optional | 2 | ····//·Internal·function·to·execute·`sourceFunc`·bound·to·`context`·with·optional |
3 | ····//·`args`.·Determines·whether·to·execute·a·function·as·a·constructor·or·as·a | 3 | ····//·`args`.·Determines·whether·to·execute·a·function·as·a·constructor·or·as·a |
4 | ····//·normal·function. | 4 | ····//·normal·function. |
5 | ····function·executeBound(sourceFunc,·boundFunc,·context,·callingContext,·args)·{ | 5 | ····function·executeBound(sourceFunc,·boundFunc,·context,·callingContext,·args)·{ |
6 | ········if·(!(callingContext·instanceof·boundFunc))·return·sourceFunc.apply(context,·args); | 6 | ········if·(!(callingContext·instanceof·boundFunc))·return·sourceFunc.apply(context,·args); |
7 | ········var·self·=·_baseCreate(sourceFunc.prototype); | 7 | ········var·self·=·_baseCreate(sourceFunc.prototype); |
Offset 1, 13 lines modified | Offset 1, 20 lines modified | ||
1 | define((function()·{ | 1 | define(['./index3',·'./index17'],·(function(_cb,·_getLength)·{ |
2 | ····//·Invokes·`interceptor`·with·the·`obj`·and·then·returns·`obj`. | ||
3 | ····//·The·primary·purpose·of·this·method·is·to·"tap·into"·a·method·chain,·in | ||
4 | ····//·order·to·perform·operations·on·intermediate·results·within·the·chain. | ||
5 | ····function·tap(obj,·interceptor)·{ | ||
6 | ········inte | 2 | ····//·Use·a·comparator·function·to·figure·out·the·smallest·index·at·which |
3 | ····//·an·object·should·be·inserted·so·as·to·maintain·order.·Uses·binary·search. | ||
4 | ····function·sortedIndex(array,·obj,·iteratee,·context)·{ | ||
5 | ········iteratee·=·_cb(iteratee,·context,·1); | ||
6 | ········var·value·=·iteratee(obj); | ||
7 | ········var·low·=·0, | ||
8 | ············high·=·_getLength(array); | ||
9 | ········while·(low·<·high)·{ | ||
10 | ············var·mid·=·Math.floor((low·+·high)·/·2); | ||
11 | ············if·(iteratee(array[mid])·<·value)·low·=·mid·+·1; | ||
12 | ············else·high·=·mid; | ||
13 | ········} | ||
7 | ········return· | 14 | ········return·low; |
8 | ····} | 15 | ····} |
9 | ····return·t | 16 | ····return·sortedIndex; |
10 | })); | 17 | })); |
Offset 1, 26 lines modified | Offset 1, 13 lines modified | ||
1 | define( | 1 | define((function()·{ |
2 | ····//·Sort·the·object's·values·by·a·criterion·produced·by·an·iteratee. | ||
3 | ····function·sortBy(obj,·iteratee,·context)·{ | ||
4 | ········var·index·=·0; | ||
5 | ········iteratee·=·_cb(iteratee,·context); | ||
6 | ···· | 2 | ····//·Invokes·`interceptor`·with·the·`obj`·and·then·returns·`obj`. |
3 | ····//·The·primary·purpose·of·this·method·is·to·"tap·into"·a·method·chain,·in | ||
4 | ····//·order·to·perform·operations·on·intermediate·results·within·the·chain. | ||
5 | ····function·tap(obj,·interceptor)·{ | ||
6 | ········interceptor(obj); | ||
7 | ········ | 7 | ········return·obj; |
8 | ················value:·value, | ||
9 | ················index:·index++, | ||
10 | ················criteria:·iteratee(value,·key,·list) | ||
11 | ············}; | ||
12 | ········}).sort(function(left,·right)·{ | ||
13 | ············var·a·=·left.criteria; | ||
14 | ············var·b·=·right.criteria; | ||
15 | ············if·(a·!==·b)·{ | ||
16 | ················if·(a·>·b·||·a·===·void·0)·return·1; | ||
17 | ················if·(a·<·b·||·b·===·void·0)·return·-1; | ||
18 | ············} | ||
19 | ············return·left.index·-·right.index; | ||
20 | ········}),·'value'); | ||
21 | ····} | 8 | ····} |
22 | ····return· | 9 | ····return·tap; |
23 | })); | 10 | })); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index47',·'./index1 | 1 | define(['./index47',·'./index150',·'./index143'],·(function(defaults,·underscore,·templateSettings)·{ |
2 | ····//·When·customizing·`_.templateSettings`,·if·you·don't·want·to·define·an | 2 | ····//·When·customizing·`_.templateSettings`,·if·you·don't·want·to·define·an |
3 | ····//·interpolation,·evaluation·or·escaping·regex,·we·need·one·that·is | 3 | ····//·interpolation,·evaluation·or·escaping·regex,·we·need·one·that·is |
4 | ····//·guaranteed·not·to·match. | 4 | ····//·guaranteed·not·to·match. |
5 | ····var·noMatch·=·/(.)^/; | 5 | ····var·noMatch·=·/(.)^/; |
6 | ····//·Certain·characters·need·to·be·escaped·so·that·they·can·be·put·into·a | 6 | ····//·Certain·characters·need·to·be·escaped·so·that·they·can·be·put·into·a |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index1 | 1 | define(['./index150'],·(function(underscore)·{ |
2 | ····//·By·default,·Underscore·uses·ERB-style·template·delimiters.·Change·the | 2 | ····//·By·default,·Underscore·uses·ERB-style·template·delimiters.·Change·the |
3 | ····//·following·template·settings·to·use·alternative·delimiters. | 3 | ····//·following·template·settings·to·use·alternative·delimiters. |
4 | ····var·templateSettings·=·underscore.templateSettings·=·{ | 4 | ····var·templateSettings·=·underscore.templateSettings·=·{ |
5 | ········evaluate:·/<%([\s\S]+?)%>/g, | 5 | ········evaluate:·/<%([\s\S]+?)%>/g, |
6 | ········interpolate:·/<%=([\s\S]+?)%>/g, | 6 | ········interpolate:·/<%=([\s\S]+?)%>/g, |
7 | ········escape:·/<%-([\s\S]+?)%>/g | 7 | ········escape:·/<%-([\s\S]+?)%>/g |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index11 | 1 | define(['./index116'],·(function(now)·{ |
2 | ····//·Returns·a·function,·that,·when·invoked,·will·only·be·triggered·at·most·once | 2 | ····//·Returns·a·function,·that,·when·invoked,·will·only·be·triggered·at·most·once |
3 | ····//·during·a·given·window·of·time.·Normally,·the·throttled·function·will·run | 3 | ····//·during·a·given·window·of·time.·Normally,·the·throttled·function·will·run |
4 | ····//·as·much·as·it·can,·without·ever·going·more·than·once·per·`wait`·duration; | 4 | ····//·as·much·as·it·can,·without·ever·going·more·than·once·per·`wait`·duration; |
5 | ····//·but·if·you'd·like·to·disable·the·execution·on·the·leading·edge,·pass | 5 | ····//·but·if·you'd·like·to·disable·the·execution·on·the·leading·edge,·pass |
6 | ····//·`{leading:·false}`.·To·disable·execution·on·the·trailing·edge,·ditto. | 6 | ····//·`{leading:·false}`.·To·disable·execution·on·the·trailing·edge,·ditto. |
7 | ····function·throttle(func,·wait,·options)·{ | 7 | ····function·throttle(func,·wait,·options)·{ |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index7 | 1 | define(['./index78',·'./index26',·'./index97',·'./index21',·'./index107',·'./index68',·'./index155'],·(function(isArray,·_setup,·isString,·_isArrayLike,·map,·identity,·values)·{ |
2 | ····//·Safely·create·a·real,·live·array·from·anything·iterable. | 2 | ····//·Safely·create·a·real,·live·array·from·anything·iterable. |
3 | ····var·reStrSymbol·=·/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; | 3 | ····var·reStrSymbol·=·/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; |
4 | ····function·toArray(obj)·{ | 4 | ····function·toArray(obj)·{ |
5 | ········if·(!obj)·return·[]; | 5 | ········if·(!obj)·return·[]; |
6 | ········if·(isArray(obj))·return·_setup.slice.call(obj); | 6 | ········if·(isArray(obj))·return·_setup.slice.call(obj); |
Offset 1, 30 lines modified | Offset 1, 12 lines modified | ||
1 | define(['./index1 | 1 | define(['./index150',·'./index78'],·(function(underscore,·isArray)·{ |
2 | ····//·Normalize·a·(deep)·property·`path`·to·array. | ||
3 | ····//·Like·`_.iteratee`,·this·function·can·be·customized. | ||
4 | ····function·toPath(path)·{ | ||
5 | ········return·isArray(path)·?·path·:·[path]; | ||
2 | ····//·Add·all·mutator·`Array`·functions·to·the·wrapper. | ||
3 | ····each(['pop',·'push',·'reverse',·'shift',·'sort',·'splice',·'unshift'],·function(name)·{ | ||
4 | ········var·method·=·_setup.ArrayProto[name]; | ||
5 | ········underscore.prototype[name]·=·function()·{ | ||
6 | ············var·obj·=·this._wrapped; | ||
7 | ············if·(obj·!=·null)·{ | ||
8 | ················method.apply(obj,·arguments); | ||
9 | ················if·((name·===·'shift'·||·name·===·'splice')·&&·obj.length·===·0)·{ | ||
10 | ····················delete·obj[0]; | ||
11 | ················} | ||
12 | ············} | ||
13 | ············return·_chainResult(this,·obj); | ||
14 | ········}; | ||
15 | ····} | 6 | ····} |
7 | ····underscore.toPath·=·toPath; | ||
8 | ····return·toPath; | ||
16 | ····//·Add·all·accessor·`Array`·functions·to·the·wrapper. | ||
17 | ····each(['concat',·'join',·'slice'],·function(name)·{ | ||
18 | ········var·method·=·_setup.ArrayProto[name]; | ||
19 | ········underscore.prototype[name]·=·function()·{ | ||
20 | ············var·obj·=·this._wrapped; | ||
21 | ············if·(obj·!=·null)·obj·=·method.apply(obj,·arguments); | ||
22 | ············return·_chainResult(this,·obj); | ||
23 | ········}; | ||
24 | ····}); | ||
25 | ····return·underscore; | ||
26 | })); | 9 | })); |
Offset 1, 12 lines modified | Offset 1, 30 lines modified | ||
1 | define(['./index1 | 1 | define(['./index150',·'./index51',·'./index26',·'./index4'],·(function(underscore,·each,·_setup,·_chainResult)·{ |
2 | ····//·Normalize·a·(deep)·property·`path`·to·array. | ||
3 | ····//·Like·`_.iteratee`,·this·function·can·be·customized. | ||
4 | ····function·toPath(path)·{ | ||
5 | ······ | 2 | ····//·Add·all·mutator·`Array`·functions·to·the·wrapper. |
3 | ····each(['pop',·'push',·'reverse',·'shift',·'sort',·'splice',·'unshift'],·function(name)·{ | ||
4 | ········var·method·=·_setup.ArrayProto[name]; | ||
5 | ········underscore.prototype[name]·=·function()·{ | ||
6 | ············var·obj·=·this._wrapped; | ||
7 | ············if·(obj·!=·null)·{ | ||
8 | ················method.apply(obj,·arguments); | ||
9 | ················if·((name·===·'shift'·||·name·===·'splice')·&&·obj.length·===·0)·{ | ||
10 | ····················delete·obj[0]; | ||
11 | ················} | ||
12 | ············} | ||
13 | ············return·_chainResult(this,·obj); | ||
14 | ········}; | ||
6 | ····} | 15 | ····}); |
7 | ····underscore.toPath·=·toPath; | ||
8 | ····r | 16 | ····//·Add·all·accessor·`Array`·functions·to·the·wrapper. |
17 | ····each(['concat',·'join',·'slice'],·function(name)·{ | ||
18 | ········var·method·=·_setup.ArrayProto[name]; | ||
19 | ········underscore.prototype[name]·=·function()·{ | ||
20 | ············var·obj·=·this._wrapped; | ||
21 | ············if·(obj·!=·null)·obj·=·method.apply(obj,·arguments); | ||
22 | ············return·_chainResult(this,·obj); | ||
23 | ········}; | ||
24 | ····}); | ||
25 | ····return·underscore; | ||
9 | })); | 26 | })); |
Offset 1, 29 lines modified | Offset 1, 18 lines modified | ||
1 | define(['./index26'],·(function(_setup)·{ | 1 | define(['./index94',·'./index26',·'./index19',·'./index5'],·(function(isObject,·_setup,·_has,·_collectNonEnumProps)·{ |
2 | ····//·Retrieve·the·names·of·an·object's·own·properties. | ||
3 | ····//·Delegates·to·**ECMAScript·5**'s·native·`Object.keys`. | ||
2 | ····//·If·Underscore·is·called·as·a·function,·it·returns·a·wrapped·object·that·can | ||
3 | ····//·be·used·OO-style.·This·wrapper·holds·altered·versions·of·all·functions·added | ||
4 | ····//·through·`_.mixin`.·Wrapped·objects·may·be·chained. | ||
5 | ····function· | 4 | ····function·keys(obj)·{ |
6 | ········if·(obj·instanceof·_)·return·obj; | ||
7 | ········if·(!(this·instanceof·_))·return·new·_(obj); | ||
8 | ········ | 5 | ········if·(!isObject(obj))·return·[]; |
6 | ········if·(_setup.nativeKeys)·return·_setup.nativeKeys(obj); | ||
7 | ········var·keys·=·[]; | ||
8 | ········for·(var·key·in·obj) | ||
9 | ············if·(_has(obj,·key))·keys.push(key); | ||
10 | ········//·Ahem,·IE·<·9. | ||
11 | ········if·(_setup.hasEnumBug)·_collectNonEnumProps(obj,·keys); | ||
12 | ········return·keys; | ||
9 | ····} | 13 | ····} |
10 | ····_.VERSION·=·_setup.VERSION; | ||
11 | ····//·Extracts·the·result·from·a·wrapped·and·chained·object. | ||
12 | ····_.prototype.value·=·function()·{ | ||
13 | ········return·this._wrapped; | ||
14 | ····}; | ||
15 | ····//·Provide·unwrapping·proxies·for·some·methods·used·in·engine·operations | ||
16 | ····//·such·as·arithmetic·and·JSON·stringification. | ||
17 | ····_.prototype.valueOf·=·_.prototype.toJSON·=·_.prototype.value; | ||
18 | ····_.prototype.toString·=·function()·{ | ||
19 | ········return·String(this._wrapped); | ||
20 | ····}; | ||
21 | ····return· | 14 | ····return·keys; |
22 | })); | 15 | })); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index17',·'./index21',·'./index7 | 1 | define(['./index17',·'./index21',·'./index78',·'./index77'],·(function(_getLength,·_isArrayLike,·isArray,·isArguments)·{ |
2 | ····//·Internal·implementation·of·a·recursive·`flatten`·function. | 2 | ····//·Internal·implementation·of·a·recursive·`flatten`·function. |
3 | ····function·flatten(input,·depth,·strict,·output)·{ | 3 | ····function·flatten(input,·depth,·strict,·output)·{ |
4 | ········output·=·output·||·[]; | 4 | ········output·=·output·||·[]; |
5 | ········if·(!depth·&&·depth·!==·0)·{ | 5 | ········if·(!depth·&&·depth·!==·0)·{ |
6 | ············depth·=·Infinity; | 6 | ············depth·=·Infinity; |
7 | ········}·else·if·(depth·<=·0)·{ | 7 | ········}·else·if·(depth·<=·0)·{ |
Offset 1, 8 lines modified | Offset 1, 29 lines modified | ||
1 | define(['./index | 1 | define(['./index26'],·(function(_setup)·{ |
2 | ····//·Function·for·unescaping·strings·from·HTML·interpolation. | ||
3 | ···· | 2 | ····//·If·Underscore·is·called·as·a·function,·it·returns·a·wrapped·object·that·can |
3 | ····//·be·used·OO-style.·This·wrapper·holds·altered·versions·of·all·functions·added | ||
4 | ····//·through·`_.mixin`.·Wrapped·objects·may·be·chained. | ||
5 | ····function·_(obj)·{ | ||
6 | ········if·(obj·instanceof·_)·return·obj; | ||
7 | ········if·(!(this·instanceof·_))·return·new·_(obj); | ||
8 | ········this._wrapped·=·obj; | ||
9 | ····} | ||
4 | ···· | 10 | ····_.VERSION·=·_setup.VERSION; |
11 | ····//·Extracts·the·result·from·a·wrapped·and·chained·object. | ||
12 | ····_.prototype.value·=·function()·{ | ||
13 | ········return·this._wrapped; | ||
14 | ····}; | ||
15 | ····//·Provide·unwrapping·proxies·for·some·methods·used·in·engine·operations | ||
16 | ····//·such·as·arithmetic·and·JSON·stringification. | ||
17 | ····_.prototype.valueOf·=·_.prototype.toJSON·=·_.prototype.value; | ||
18 | ····_.prototype.toString·=·function()·{ | ||
19 | ········return·String(this._wrapped); | ||
20 | ····}; | ||
21 | ····return·_; | ||
5 | })); | 22 | })); |
Offset 1, 37 lines modified | Offset 1, 11 lines modified | ||
1 | define(['./index | 1 | define(['./index133',·'./index152',·'./index15'],·(function(restArguments,·uniq,·_flatten)·{ |
2 | ····//·Produce·an·array·that·contains·the·union:·each·distinct·element·from·all·of | ||
3 | ····//·the·passed-in·arrays. | ||
4 | ····var·union·=·restArguments(function(arrays)·{ | ||
5 | ········return·uniq(_flatten(arrays,·true,·true)); | ||
2 | ····//·Produce·a·duplicate-free·version·of·the·array.·If·the·array·has·already | ||
3 | ····//·been·sorted,·you·have·the·option·of·using·a·faster·algorithm. | ||
4 | ····//·The·faster·algorithm·will·not·work·with·an·iteratee·if·the·iteratee | ||
5 | ····//·is·not·a·one-to-one·function,·so·providing·an·iteratee·will·disable | ||
6 | ····//·the·faster·algorithm. | ||
7 | ····function·uniq(array,·isSorted,·iteratee,·context)·{ | ||
8 | ········if·(!isBoolean(isSorted))·{ | ||
9 | ············context·=·iteratee; | ||
10 | ············iteratee·=·isSorted; | ||
11 | ············isSorted·=·false; | ||
12 | ········} | ||
13 | ········if·(iteratee·!=·null)·iteratee·=·_cb(iteratee,·context); | ||
14 | ········var·result·=·[]; | ||
15 | ········var·seen·=·[]; | ||
16 | ········for·(var·i·=·0,·length·=·_getLength(array);·i·<·length;·i++)·{ | ||
17 | ············var·value·=·array[i], | ||
18 | ················computed·=·iteratee·?·iteratee(value,·i,·array)·:·value; | ||
19 | ············if·(isSorted·&&·!iteratee)·{ | ||
20 | ················if·(!i·||·seen·!==·computed)·result.push(value); | ||
21 | ················seen·=·computed; | ||
22 | ············}·else·if·(iteratee)·{ | ||
23 | ················if·(!contains(seen,·computed))·{ | ||
24 | ····················seen.push(computed); | ||
25 | ····················result.push(value); | ||
26 | ················} | ||
27 | ············}·else·if·(!contains(result,·value))·{ | ||
28 | ················result.push(value); | ||
29 | ············} | ||
30 | ········} | ||
31 | ········return·result; | ||
32 | ····} | 6 | ····}); |
33 | ····return·uni | 7 | ····return·union; |
34 | })); | 8 | })); |
Offset 1, 14 lines modified | Offset 1, 37 lines modified | ||
1 | define((function()·{ | 1 | define(['./index80',·'./index3',·'./index17',·'./index44'],·(function(isBoolean,·_cb,·_getLength,·contains)·{ |
2 | ····//·Generate·a·unique·integer·id·(unique·within·the·entire·client·session). | ||
3 | ····//·Useful·for·temporary·DOM·ids. | ||
4 | ····var·idCounter·=·0; | ||
5 | ····function·uniqueId(prefix)·{ | ||
6 | ········var·id·=·++idCounter·+·''; | ||
7 | ···· | 2 | ····//·Produce·a·duplicate-free·version·of·the·array.·If·the·array·has·already |
3 | ····//·been·sorted,·you·have·the·option·of·using·a·faster·algorithm. | ||
4 | ····//·The·faster·algorithm·will·not·work·with·an·iteratee·if·the·iteratee | ||
5 | ····//·is·not·a·one-to-one·function,·so·providing·an·iteratee·will·disable | ||
6 | ····//·the·faster·algorithm. | ||
7 | ····function·uniq(array,·isSorted,·iteratee,·context)·{ | ||
8 | ········if·(!isBoolean(isSorted))·{ | ||
9 | ············context·=·iteratee; | ||
10 | ············iteratee·=·isSorted; | ||
11 | ············isSorted·=·false; | ||
12 | ········} | ||
13 | ········if·(iteratee·!=·null)·iteratee·=·_cb(iteratee,·context); | ||
14 | ········var·result·=·[]; | ||
15 | ········var·seen·=·[]; | ||
16 | ········for·(var·i·=·0,·length·=·_getLength(array);·i·<·length;·i++)·{ | ||
17 | ············var·value·=·array[i], | ||
18 | ················computed·=·iteratee·?·iteratee(value,·i,·array)·:·value; | ||
19 | ············if·(isSorted·&&·!iteratee)·{ | ||
20 | ················if·(!i·||·seen·!==·computed)·result.push(value); | ||
21 | ················seen·=·computed; | ||
22 | ············}·else·if·(iteratee)·{ | ||
23 | ················if·(!contains(seen,·computed))·{ | ||
24 | ····················seen.push(computed); | ||
25 | ····················result.push(value); | ||
26 | ················} | ||
27 | ············}·else·if·(!contains(result,·value))·{ | ||
28 | ················result.push(value); | ||
29 | ············} | ||
30 | ········} | ||
31 | ········return·result; | ||
8 | ····} | 32 | ····} |
9 | ····return·uniq | 33 | ····return·uniq; |
10 | })); | 34 | })); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index10 | 1 | define(['./index109',·'./index17',·'./index124'],·(function(max,·_getLength,·pluck)·{ |
2 | ····//·Complement·of·zip.·Unzip·accepts·an·array·of·arrays·and·groups | 2 | ····//·Complement·of·zip.·Unzip·accepts·an·array·of·arrays·and·groups |
3 | ····//·each·array's·elements·on·shared·indices. | 3 | ····//·each·array's·elements·on·shared·indices. |
4 | ····function·unzip(array)·{ | 4 | ····function·unzip(array)·{ |
5 | ········var·length·=·(array·&&·max(array,·_getLength).length)·||·0; | 5 | ········var·length·=·(array·&&·max(array,·_getLength).length)·||·0; |
6 | ········var·result·=·Array(length); | 6 | ········var·result·=·Array(length); |
Offset 1, 16 lines modified | Offset 1, 14 lines modified | ||
1 | define( | 1 | define((function()·{ |
2 | ····//·Generate·a·unique·integer·id·(unique·within·the·entire·client·session). | ||
3 | ····//·Useful·for·temporary·DOM·ids. | ||
4 | ····var·idCounter·=·0; | ||
5 | ····function·uniqueId(prefix)·{ | ||
6 | ········var·id·=·++idCounter·+·''; | ||
7 | ········return·prefix·?·prefix·+·id·:·id; | ||
2 | ····//·Retrieve·the·values·of·an·object's·properties. | ||
3 | ····function·values(obj)·{ | ||
4 | ········var·_keys·=·keys(obj); | ||
5 | ········var·length·=·_keys.length; | ||
6 | ········var·values·=·Array(length); | ||
7 | ········for·(var·i·=·0;·i·<·length;·i++)·{ | ||
8 | ············values[i]·=·obj[_keys[i]]; | ||
9 | ········} | ||
10 | ········return·values; | ||
11 | ····} | 8 | ····} |
12 | ····return· | 9 | ····return·uniqueId; |
13 | })); | 10 | })); |
Offset 1, 11 lines modified | Offset 1, 16 lines modified | ||
1 | define(['./index | 1 | define(['./index149'],·(function(keys)·{ |
2 | ····//·Convenience·version·of·a·common·use·case·of·`_.filter`:·selecting·only | ||
3 | ····//·objects·containing·specific·`key:value`·pairs. | ||
4 | ····function·where(obj,·attrs)·{ | ||
5 | ····· | 2 | ····//·Retrieve·the·values·of·an·object's·properties. |
3 | ····function·values(obj)·{ | ||
4 | ········var·_keys·=·keys(obj); | ||
5 | ········var·length·=·_keys.length; | ||
6 | ········var·values·=·Array(length); | ||
7 | ········for·(var·i·=·0;·i·<·length;·i++)·{ | ||
8 | ············values[i]·=·obj[_keys[i]]; | ||
9 | ········} | ||
10 | ········return·values; | ||
6 | ····} | 11 | ····} |
7 | ····return· | 12 | ····return·values; |
8 | })); | 13 | })); |
Offset 1, 10 lines modified | Offset 1, 11 lines modified | ||
1 | define(['./index | 1 | define(['./index56',·'./index110'],·(function(filter,·matcher)·{ |
2 | ····//·Return·a·version·of·the·array·that·does·not·contain·the·specified·value(s). | ||
3 | ····var·without·=·restArguments(function(array,·otherArrays)·{ | ||
4 | ····· | 2 | ····//·Convenience·version·of·a·common·use·case·of·`_.filter`:·selecting·only |
3 | ····//·objects·containing·specific·`key:value`·pairs. | ||
4 | ····function·where(obj,·attrs)·{ | ||
5 | ········return·filter(obj,·matcher(attrs)); | ||
5 | ····} | 6 | ····} |
6 | ····return·w | 7 | ····return·where; |
7 | })); | 8 | })); |
Offset 1, 12 lines modified | Offset 1, 10 lines modified | ||
1 | define(['./index1 | 1 | define(['./index133',·'./index50'],·(function(restArguments,·difference)·{ |
2 | ····//·Return·a·version·of·the·array·that·does·not·contain·the·specified·value(s). | ||
3 | ····var·without·=·restArguments(function(array,·otherArrays)·{ | ||
4 | ········return·difference(array,·otherArrays); | ||
2 | ····//·Returns·the·first·function·passed·as·an·argument·to·the·second, | ||
3 | ····//·allowing·you·to·adjust·arguments,·run·code·before·and·after,·and | ||
4 | ····//·conditionally·execute·the·original·function. | ||
5 | ····function·wrap(func,·wrapper)·{ | ||
6 | ········return·partial(wrapper,·func); | ||
7 | ····} | 5 | ····}); |
8 | ····return·w | 6 | ····return·without; |
9 | })); | 7 | })); |
Offset 1, 18 lines modified | Offset 1, 12 lines modified | ||
1 | define(['./index2 | 1 | define(['./index121'],·(function(partial)·{ |
2 | ····//·Returns·the·first·function·passed·as·an·argument·to·the·second, | ||
3 | ····//·allowing·you·to·adjust·arguments,·run·code·before·and·after,·and | ||
4 | ····//·conditionally·execute·the·original·function. | ||
5 | ····function·wrap(func,·wrapper)·{ | ||
6 | ········return·partial(wrapper,·func); | ||
2 | ····//·Chunk·a·single·array·into·multiple·arrays,·each·containing·`count`·or·fewer | ||
3 | ····//·items. | ||
4 | ····function·chunk(array,·count)·{ | ||
5 | ········if·(count·==·null·||·count·<·1)·return·[]; | ||
6 | ········var·result·=·[]; | ||
7 | ········var·i·=·0, | ||
8 | ············length·=·array.length; | ||
9 | ········while·(i·<·length)·{ | ||
10 | ············result.push(_setup.slice.call(array,·i,·i·+=·count)); | ||
11 | ········} | ||
12 | ········return·result; | ||
13 | ····} | 7 | ····} |
14 | ····return· | 8 | ····return·wrap; |
15 | })); | 9 | })); |
Offset 1, 11 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index | 1 | define(['./index7',·'./index32'],·(function(_createEscaper,·_unescapeMap)·{ |
2 | ····//·Function·for·unescaping·strings·from·HTML·interpolation. | ||
3 | ····var·unescape·=·_createEscaper(_unescapeMap); | ||
2 | ····//·Produce·an·array·that·contains·the·union:·each·distinct·element·from·all·of | ||
3 | ····//·the·passed-in·arrays. | ||
4 | ····var·union·=·restArguments(function(arrays)·{ | ||
5 | ········return·uniq(_flatten(arrays,·true,·true)); | ||
6 | ····}); | ||
7 | ····return·un | 4 | ····return·unescape; |
8 | })); | 5 | })); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index6 | 1 | define(['./index68',·'./index88',·'./index94',·'./index78',·'./index110',·'./index125',·'./index25'],·(function(identity,·isFunction,·isObject,·isArray,·matcher,·property,·_optimizeCb)·{ |
2 | ····//·An·internal·function·to·generate·callbacks·that·can·be·applied·to·each | 2 | ····//·An·internal·function·to·generate·callbacks·that·can·be·applied·to·each |
3 | ····//·element·in·a·collection,·returning·the·desired·result·—·either·`_.identity`, | 3 | ····//·element·in·a·collection,·returning·the·desired·result·—·either·`_.identity`, |
4 | ····//·an·arbitrary·callback,·a·property·matcher,·or·a·property·accessor. | 4 | ····//·an·arbitrary·callback,·a·property·matcher,·or·a·property·accessor. |
5 | ····function·baseIteratee(value,·context,·argCount)·{ | 5 | ····function·baseIteratee(value,·context,·argCount)·{ |
6 | ········if·(value·==·null)·return·identity; | 6 | ········if·(value·==·null)·return·identity; |
7 | ········if·(isFunction(value))·return·_optimizeCb(value,·context,·argCount); | 7 | ········if·(isFunction(value))·return·_optimizeCb(value,·context,·argCount); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['exports',·'./index17',·'./index8 | 1 | define(['exports',·'./index17',·'./index88',·'./index34'],·(function(exports,·_getLength,·isFunction,·allKeys)·{ |
2 | ····//·Since·the·regular·`Object.prototype.toString`·type·tests·don't·work·for | 2 | ····//·Since·the·regular·`Object.prototype.toString`·type·tests·don't·work·for |
3 | ····//·some·types·in·IE·11,·we·use·a·fingerprinting·heuristic·instead,·based | 3 | ····//·some·types·in·IE·11,·we·use·a·fingerprinting·heuristic·instead,·based |
4 | ····//·on·the·methods.·It's·not·great,·but·it's·the·best·we·got. | 4 | ····//·on·the·methods.·It's·not·great,·but·it's·the·best·we·got. |
5 | ····//·The·fingerprint·method·lists·are·defined·below. | 5 | ····//·The·fingerprint·method·lists·are·defined·below. |
6 | ····function·ie11fingerprint(methods)·{ | 6 | ····function·ie11fingerprint(methods)·{ |
7 | ········var·length·=·_getLength(methods); | 7 | ········var·length·=·_getLength(methods); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index1 | 1 | define(['./index150',·'./index2',·'./index102'],·(function(underscore,·_baseIteratee,·iteratee)·{ |
2 | ····//·The·function·we·call·internally·to·generate·a·callback.·It·invokes | 2 | ····//·The·function·we·call·internally·to·generate·a·callback.·It·invokes |
3 | ····//·`_.iteratee`·if·overridden,·otherwise·`baseIteratee`. | 3 | ····//·`_.iteratee`·if·overridden,·otherwise·`baseIteratee`. |
4 | ····function·cb(value,·context,·argCount)·{ | 4 | ····function·cb(value,·context,·argCount)·{ |
5 | ········if·(underscore.iteratee·!==·iteratee)·return·underscore.iteratee(value,·context); | 5 | ········if·(underscore.iteratee·!==·iteratee)·return·underscore.iteratee(value,·context); |
6 | ········return·_baseIteratee(value,·context,·argCount); | 6 | ········return·_baseIteratee(value,·context,·argCount); |
7 | ····} | 7 | ····} |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index1 | 1 | define(['./index150',·'./index147'],·(function(underscore,·toPath$1)·{ |
2 | ····//·Internal·wrapper·for·`_.toPath`·to·enable·minification. | 2 | ····//·Internal·wrapper·for·`_.toPath`·to·enable·minification. |
3 | ····//·Similar·to·`cb`·for·`_.iteratee`. | 3 | ····//·Similar·to·`cb`·for·`_.iteratee`. |
4 | ····function·toPath(path)·{ | 4 | ····function·toPath(path)·{ |
5 | ········return·underscore.toPath(path); | 5 | ········return·underscore.toPath(path); |
6 | ····} | 6 | ····} |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index7 | 1 | define(['./index75',·'./index12'],·(function(invert,·_escapeMap)·{ |
2 | ····//·Internal·list·of·HTML·entities·for·unescaping. | 2 | ····//·Internal·list·of·HTML·entities·for·unescaping. |
3 | ····var·unescapeMap·=·invert(_escapeMap); | 3 | ····var·unescapeMap·=·invert(_escapeMap); |
4 | ····return·unescapeMap; | 4 | ····return·unescapeMap; |
5 | })); | 5 | })); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index9 | 1 | define(['./index94',·'./index26',·'./index5'],·(function(isObject,·_setup,·_collectNonEnumProps)·{ |
2 | ····//·Retrieve·all·the·enumerable·property·names·of·an·object. | 2 | ····//·Retrieve·all·the·enumerable·property·names·of·an·object. |
3 | ····function·allKeys(obj)·{ | 3 | ····function·allKeys(obj)·{ |
4 | ········if·(!isObject(obj))·return·[]; | 4 | ········if·(!isObject(obj))·return·[]; |
5 | ········var·keys·=·[]; | 5 | ········var·keys·=·[]; |
6 | ········for·(var·key·in·obj)·keys.push(key); | 6 | ········for·(var·key·in·obj)·keys.push(key); |
7 | ········//·Ahem,·IE·<·9. | 7 | ········//·Ahem,·IE·<·9. |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index133',·'./index8 | 1 | define(['./index133',·'./index88',·'./index14'],·(function(restArguments,·isFunction,·_executeBound)·{ |
2 | ····//·Create·a·function·bound·to·a·given·object·(assigning·`this`,·and·arguments, | 2 | ····//·Create·a·function·bound·to·a·given·object·(assigning·`this`,·and·arguments, |
3 | ····//·optionally). | 3 | ····//·optionally). |
4 | ····var·bind·=·restArguments(function(func,·context,·args)·{ | 4 | ····var·bind·=·restArguments(function(func,·context,·args)·{ |
5 | ········if·(!isFunction(func))·throw·new·TypeError('Bind·must·be·called·on·a·function'); | 5 | ········if·(!isFunction(func))·throw·new·TypeError('Bind·must·be·called·on·a·function'); |
6 | ········var·bound·=·restArguments(function(callArgs)·{ | 6 | ········var·bound·=·restArguments(function(callArgs)·{ |
7 | ············return·_executeBound(func,·bound,·context,·this,·args.concat(callArgs)); | 7 | ············return·_executeBound(func,·bound,·context,·this,·args.concat(callArgs)); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index1 | 1 | define(['./index150'],·(function(underscore)·{ |
2 | ····//·Start·chaining·a·wrapped·Underscore·object. | 2 | ····//·Start·chaining·a·wrapped·Underscore·object. |
3 | ····function·chain(obj)·{ | 3 | ····function·chain(obj)·{ |
4 | ········var·instance·=·underscore(obj); | 4 | ········var·instance·=·underscore(obj); |
5 | ········instance._chain·=·true; | 5 | ········instance._chain·=·true; |
6 | ········return·instance; | 6 | ········return·instance; |
7 | ····} | 7 | ····} |
Offset 1, 11 lines modified | Offset 1, 18 lines modified | ||
1 | define(['./index | 1 | define(['./index26'],·(function(_setup)·{ |
2 | ····//·Create·a·(shallow-cloned)·duplicate·of·an·object. | ||
3 | ····function·clone(obj)·{ | ||
4 | ········if·(!isObject(obj))·return·obj; | ||
5 | ···· | 2 | ····//·Chunk·a·single·array·into·multiple·arrays,·each·containing·`count`·or·fewer |
3 | ····//·items. | ||
4 | ····function·chunk(array,·count)·{ | ||
5 | ········if·(count·==·null·||·count·<·1)·return·[]; | ||
6 | ········var·result·=·[]; | ||
7 | ········var·i·=·0, | ||
8 | ············length·=·array.length; | ||
9 | ········while·(i·<·length)·{ | ||
10 | ············result.push(_setup.slice.call(array,·i,·i·+=·count)); | ||
11 | ········} | ||
12 | ········return·result; | ||
6 | ····} | 13 | ····} |
7 | ····return·c | 14 | ····return·chunk; |
8 | })); | 15 | })); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index1 | 1 | define(['./index150'],·(function(underscore)·{ |
2 | ····//·Helper·function·to·continue·chaining·intermediate·results. | 2 | ····//·Helper·function·to·continue·chaining·intermediate·results. |
3 | ····function·chainResult(instance,·obj)·{ | 3 | ····function·chainResult(instance,·obj)·{ |
4 | ········return·instance._chain·?·underscore(obj).chain()·:·obj; | 4 | ········return·instance._chain·?·underscore(obj).chain()·:·obj; |
5 | ····} | 5 | ····} |
6 | ····return·chainResult; | 6 | ····return·chainResult; |
Offset 1, 10 lines modified | Offset 1, 11 lines modified | ||
1 | define(['./index5 | 1 | define(['./index94',·'./index78',·'./index54'],·(function(isObject,·isArray,·extend)·{ |
2 | ····//·Trim·out·all·falsy·values·from·an·array. | ||
3 | ····function·compact(array)·{ | ||
4 | ···· | 2 | ····//·Create·a·(shallow-cloned)·duplicate·of·an·object. |
3 | ····function·clone(obj)·{ | ||
4 | ········if·(!isObject(obj))·return·obj; | ||
5 | ········return·isArray(obj)·?·obj.slice()·:·extend({},·obj); | ||
5 | ····} | 6 | ····} |
6 | ····return·c | 7 | ····return·clone; |
7 | })); | 8 | })); |
Offset 1, 18 lines modified | Offset 1, 10 lines modified | ||
1 | define((function()·{ | 1 | define(['./index56'],·(function(filter)·{ |
2 | ····//·Trim·out·all·falsy·values·from·an·array. | ||
2 | ····//·Returns·a·function·that·is·the·composition·of·a·list·of·functions,·each | ||
3 | ····//·consuming·the·return·value·of·the·function·that·follows. | ||
4 | ····function·comp | 3 | ····function·compact(array)·{ |
4 | ········return·filter(array,·Boolean); | ||
5 | ········var·args·=·arguments; | ||
6 | ········var·start·=·args.length·-·1; | ||
7 | ········return·function()·{ | ||
8 | ············var·i·=·start; | ||
9 | ············var·result·=·args[start].apply(this,·arguments); | ||
10 | ············while·(i--)·result·=·args[i].call(this,·result); | ||
11 | ············return·result; | ||
12 | ········}; | ||
13 | ····} | 5 | ····} |
14 | ····return·comp | 6 | ····return·compact; |
15 | })); | 7 | })); |
Offset 1, 12 lines modified | Offset 1, 18 lines modified | ||
1 | define((function()·{ | 1 | define((function()·{ |
2 | ····//·Predicate-generating·function.·Often·useful·outside·of·Underscore. | ||
3 | ····function·co | 2 | ····//·Returns·a·function·that·is·the·composition·of·a·list·of·functions,·each |
3 | ····//·consuming·the·return·value·of·the·function·that·follows. | ||
4 | ····function·compose()·{ | ||
5 | ········var·args·=·arguments; | ||
6 | ········var·start·=·args.length·-·1; | ||
4 | ········return·function()·{ | 7 | ········return·function()·{ |
8 | ············var·i·=·start; | ||
9 | ············var·result·=·args[start].apply(this,·arguments); | ||
10 | ············while·(i--)·result·=·args[i].call(this,·result); | ||
5 | ············return· | 11 | ············return·result; |
6 | ········}; | 12 | ········}; |
7 | ····} | 13 | ····} |
8 | ····return·co | 14 | ····return·compose; |
9 | })); | 15 | })); |
Offset 1, 12 lines modified | Offset 1, 12 lines modified | ||
1 | define( | 1 | define((function()·{ |
2 | ····//·Determine·if·the·array·or·object·contains·a·given·item·(using·`===`). | ||
3 | ····function·contains(obj,·item,·fromIndex,·guard)·{ | ||
4 | ········if·(!_isArrayLike(obj))·obj·=·values(obj); | ||
5 | ········if·(typeof·fromIndex·!=·'number'·||·guard)·fromIndex·=·0; | ||
6 | ···· | 2 | ····//·Predicate-generating·function.·Often·useful·outside·of·Underscore. |
3 | ····function·constant(value)·{ | ||
4 | ········return·function()·{ | ||
5 | ············return·value; | ||
6 | ········}; | ||
7 | ····} | 7 | ····} |
8 | ····return·conta | 8 | ····return·constant; |
9 | })); | 9 | })); |
Offset 1, 13 lines modified | Offset 1, 12 lines modified | ||
1 | define(['./index1 | 1 | define(['./index21',·'./index155',·'./index73'],·(function(_isArrayLike,·values,·indexOf)·{ |
2 | ····//·Determine·if·the·array·or·object·contains·a·given·item·(using·`===`). | ||
3 | ····function·contains(obj,·item,·fromIndex,·guard)·{ | ||
4 | ········if·(!_isArrayLike(obj))·obj·=·values(obj); | ||
5 | ········if·(typeof·fromIndex·!=·'number'·||·guard)·fromIndex·=·0; | ||
6 | ········return·indexOf(obj,·item,·fromIndex)·>=·0; | ||
2 | ····//·Counts·instances·of·an·object·that·group·by·a·certain·criterion.·Pass | ||
3 | ····//·either·a·string·attribute·to·count·by,·or·a·function·that·returns·the | ||
4 | ····//·criterion. | ||
5 | ····var·countBy·=·_group(function(result,·value,·key)·{ | ||
6 | ········if·(_has(result,·key))·result[key]++; | ||
7 | ········else·result[key]·=·1; | ||
8 | ····} | 7 | ····} |
9 | ····return·co | 8 | ····return·contains; |
10 | })); | 9 | })); |
Offset 1, 14 lines modified | Offset 1, 13 lines modified | ||
1 | define(['./index',·'./index | 1 | define(['./index18',·'./index19'],·(function(_group,·_has)·{ |
2 | ····//·Counts·instances·of·an·object·that·group·by·a·certain·criterion.·Pass | ||
3 | ····//·either·a·string·attribute·to·count·by,·or·a·function·that·returns·the | ||
4 | ····//·criterion. | ||
5 | ····var·countBy·=·_group(function(result,·value,·key)·{ | ||
6 | ········if·(_has(result,·key))·result[key]++; | ||
7 | ········else·result[key]·=·1; | ||
2 | ····//·Creates·an·object·that·inherits·from·the·given·prototype·object. | ||
3 | ····//·If·additional·properties·are·provided·then·they·will·be·added·to·the | ||
4 | ····//·created·object. | ||
5 | ····function·create(prototype,·props)·{ | ||
6 | ········var·result·=·_baseCreate(prototype); | ||
7 | ········if·(props)·extendOwn(result,·props); | ||
8 | ········return·result; | ||
9 | ····} | 8 | ····}); |
10 | ····return·c | 9 | ····return·countBy; |
11 | })); | 10 | })); |
Offset 1, 43 lines modified | Offset 1, 14 lines modified | ||
1 | define(['./index | 1 | define(['./index',·'./index55'],·(function(_baseCreate,·extendOwn)·{ |
2 | ····//·Creates·an·object·that·inherits·from·the·given·prototype·object. | ||
3 | ····//·If·additional·properties·are·provided·then·they·will·be·added·to·the | ||
4 | ····//·created·object. | ||
5 | ····function·create(prototype,·props)·{ | ||
6 | ········var·result·=·_baseCreate(prototype); | ||
7 | ········if·(props)·extendOwn(result,·props); | ||
2 | ····//·When·a·sequence·of·calls·of·the·returned·function·ends,·the·argument | ||
3 | ····//·function·is·triggered.·The·end·of·a·sequence·is·defined·by·the·`wait` | ||
4 | ····//·parameter.·If·`immediate`·is·passed,·the·argument·function·will·be | ||
5 | ····//·triggered·at·the·beginning·of·the·sequence·instead·of·at·the·end. | ||
6 | ····function·debounce(func,·wait,·immediate)·{ | ||
7 | ········var·timeout,·previous,·args,·result,·context; | ||
8 | ········var·later·=·function()·{ | ||
9 | ············var·passed·=·now()·-·previous; | ||
10 | ············if·(wait·>·passed)·{ | ||
11 | ················timeout·=·setTimeout(later,·wait·-·passed); | ||
12 | ············}·else·{ | ||
13 | ················timeout·=·null; | ||
14 | ················if·(!immediate)·result·=·func.apply(context,·args); | ||
15 | ················//·This·check·is·needed·because·`func`·can·recursively·invoke·`debounced`. | ||
16 | ················if·(!timeout)·args·=·context·=·null; | ||
17 | ············} | ||
18 | ········}; | ||
19 | ········var·debounced·=·restArguments(function(_args)·{ | ||
20 | ············context·=·this; | ||
21 | ············args·=·_args; | ||
22 | ············previous·=·now(); | ||
23 | ············if·(!timeout)·{ | ||
24 | ················timeout·=·setTimeout(later,·wait); | ||
25 | ················if·(immediate)·result·=·func.apply(context,·args); | ||
26 | ············} | ||
27 | ········ | 8 | ········return·result; |
28 | ········}); | ||
29 | ········debounced.cancel·=·function()·{ | ||
30 | ············clearTimeout(timeout); | ||
31 | ············timeout·=·args·=·context·=·null; | ||
32 | ········}; | ||
33 | ········return·debounced; | ||
34 | ····} | 9 | ····} |
35 | ····return· | 10 | ····return·create; |
36 | })); | 11 | })); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index1 | 1 | define(['./index121',·'./index49',·'./index150'],·(function(partial,·delay,·underscore)·{ |
2 | ····//·Defers·a·function,·scheduling·it·to·run·after·the·current·call·stack·has | 2 | ····//·Defers·a·function,·scheduling·it·to·run·after·the·current·call·stack·has |
3 | ····//·cleared. | 3 | ····//·cleared. |
4 | ····var·defer·=·partial(delay,·underscore,·1); | 4 | ····var·defer·=·partial(delay,·underscore,·1); |
5 | ····return·defer; | 5 | ····return·defer; |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index26',·'./index8 | 1 | define(['./index26',·'./index88',·'./index19'],·(function(_setup,·isFunction,·_has)·{ |
2 | ····//·Internal·helper·to·create·a·simple·lookup·structure. | 2 | ····//·Internal·helper·to·create·a·simple·lookup·structure. |
3 | ····//·`collectNonEnumProps`·used·to·depend·on·`_.contains`,·but·this·led·to | 3 | ····//·`collectNonEnumProps`·used·to·depend·on·`_.contains`,·but·this·led·to |
4 | ····//·circular·imports.·`emulatedSet`·is·a·one-off·solution·that·only·works·for | 4 | ····//·circular·imports.·`emulatedSet`·is·a·one-off·solution·that·only·works·for |
5 | ····//·arrays·of·strings. | 5 | ····//·arrays·of·strings. |
6 | ····function·emulatedSet(keys)·{ | 6 | ····function·emulatedSet(keys)·{ |
7 | ········var·hash·=·{}; | 7 | ········var·hash·=·{}; |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index133',·'./index15',·'./index5 | 1 | define(['./index133',·'./index15',·'./index56',·'./index44'],·(function(restArguments,·_flatten,·filter,·contains)·{ |
2 | ····//·Take·the·difference·between·one·array·and·a·number·of·other·arrays. | 2 | ····//·Take·the·difference·between·one·array·and·a·number·of·other·arrays. |
3 | ····//·Only·the·elements·present·in·just·the·first·array·will·remain. | 3 | ····//·Only·the·elements·present·in·just·the·first·array·will·remain. |
4 | ····var·difference·=·restArguments(function(array,·rest)·{ | 4 | ····var·difference·=·restArguments(function(array,·rest)·{ |
5 | ········rest·=·_flatten(rest,·true,·true); | 5 | ········rest·=·_flatten(rest,·true,·true); |
6 | ········return·filter(array,·function(value)·{ | 6 | ········return·filter(array,·function(value)·{ |
7 | ············return·!contains(rest,·value); | 7 | ············return·!contains(rest,·value); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index25',·'./index21',·'./index1 | 1 | define(['./index25',·'./index21',·'./index149'],·(function(_optimizeCb,·_isArrayLike,·keys)·{ |
2 | ····//·The·cornerstone·for·collection·functions,·an·`each` | 2 | ····//·The·cornerstone·for·collection·functions,·an·`each` |
3 | ····//·implementation,·aka·`forEach`. | 3 | ····//·implementation,·aka·`forEach`. |
4 | ····//·Handles·raw·objects·in·addition·to·array-likes.·Treats·all | 4 | ····//·Handles·raw·objects·in·addition·to·array-likes.·Treats·all |
5 | ····//·sparse·array-likes·as·if·they·were·dense. | 5 | ····//·sparse·array-likes·as·if·they·were·dense. |
6 | ····function·each(obj,·iteratee,·context)·{ | 6 | ····function·each(obj,·iteratee,·context)·{ |
7 | ········iteratee·=·_optimizeCb(iteratee,·context); | 7 | ········iteratee·=·_optimizeCb(iteratee,·context); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index7',·'./index1 | 1 | define(['./index7',·'./index12'],·(function(_createEscaper,·_escapeMap)·{ |
2 | ····//·Function·for·escaping·strings·to·HTML·interpolation. | 2 | ····//·Function·for·escaping·strings·to·HTML·interpolation. |
3 | ····var·escape·=·_createEscaper(_escapeMap); | 3 | ····var·escape·=·_createEscaper(_escapeMap); |
4 | ····return·escape; | 4 | ····return·escape; |
5 | })); | 5 | })); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index3',·'./index21',·'./index1 | 1 | define(['./index3',·'./index21',·'./index149'],·(function(_cb,·_isArrayLike,·keys)·{ |
2 | ····//·Determine·whether·all·of·the·elements·pass·a·truth·test. | 2 | ····//·Determine·whether·all·of·the·elements·pass·a·truth·test. |
3 | ····function·every(obj,·predicate,·context)·{ | 3 | ····function·every(obj,·predicate,·context)·{ |
4 | ········predicate·=·_cb(predicate,·context); | 4 | ········predicate·=·_cb(predicate,·context); |
5 | ········var·_keys·=·!_isArrayLike(obj)·&&·keys(obj), | 5 | ········var·_keys·=·!_isArrayLike(obj)·&&·keys(obj), |
6 | ············length·=·(_keys·||·obj).length; | 6 | ············length·=·(_keys·||·obj).length; |
7 | ········for·(var·index·=·0;·index·<·length;·index++)·{ | 7 | ········for·(var·index·=·0;·index·<·length;·index++)·{ |
Offset 1, 15 lines modified | Offset 1, 10 lines modified | ||
1 | define(['./index | 1 | define(['./index6',·'./index149'],·(function(_createAssigner,·keys)·{ |
2 | ····//·Assigns·a·given·object·with·all·the·own·properties·in·the·passed-in | ||
3 | ····//·object(s). | ||
4 | ····//·(https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) | ||
5 | ····var·extendOwn·=·_createAssigner(keys); | ||
2 | ····//·Return·all·the·elements·that·pass·a·truth·test. | ||
3 | ····function·filter(obj,·predicate,·context)·{ | ||
4 | ········var·results·=·[]; | ||
5 | ········predicate·=·_cb(predicate,·context); | ||
6 | ········each(obj,·function(value,·index,·list)·{ | ||
7 | ············if·(predicate(value,·index,·list))·results.push(value); | ||
8 | ········}); | ||
9 | ········return·results; | ||
10 | ····} | ||
11 | ····return· | 6 | ····return·extendOwn; |
12 | })); | 7 | })); |
Offset 1, 12 lines modified | Offset 1, 15 lines modified | ||
1 | define(['./index | 1 | define(['./index3',·'./index51'],·(function(_cb,·each)·{ |
2 | ····//·Return· | 2 | ····//·Return·all·the·elements·that·pass·a·truth·test. |
3 | ····function·fi | 3 | ····function·filter(obj,·predicate,·context)·{ |
4 | ········var·keyFinder·=·_isArrayLike(obj)·?·findIndex·:·findKey; | ||
5 | ········var·key·=·keyFinder(obj,·predicate,·context); | ||
6 | ········ | 4 | ········var·results·=·[]; |
5 | ········predicate·=·_cb(predicate,·context); | ||
6 | ········each(obj,·function(value,·index,·list)·{ | ||
7 | ············if·(predicate(value,·index,·list))·results.push(value); | ||
8 | ········}); | ||
9 | ········return·results; | ||
7 | ····} | 10 | ····} |
8 | ····return·fi | 11 | ····return·filter; |
9 | })); | 12 | })); |
Offset 1, 8 lines modified | Offset 1, 12 lines modified | ||
1 | define(['./index9'],·(function(_ | 1 | define(['./index21',·'./index58',·'./index59'],·(function(_isArrayLike,·findIndex,·findKey)·{ |
2 | ····//·Return | 2 | ····//·Return·the·first·value·which·passes·a·truth·test. |
3 | ···· | 3 | ····function·find(obj,·predicate,·context)·{ |
4 | ········var·keyFinder·=·_isArrayLike(obj)·?·findIndex·:·findKey; | ||
5 | ········var·key·=·keyFinder(obj,·predicate,·context); | ||
6 | ········if·(key·!==·void·0·&&·key·!==·-1)·return·obj[key]; | ||
7 | ····} | ||
4 | ····return·find | 8 | ····return·find; |
5 | })); | 9 | })); |
Offset 1, 16 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index | 1 | define(['./index9'],·(function(_createPredicateIndexFinder)·{ |
2 | ····//·Returns·the·first· | 2 | ····//·Returns·the·first·index·on·an·array-like·that·passes·a·truth·test. |
3 | ····var·findIndex·=·_createPredicateIndexFinder(1); | ||
3 | ····function·findKey(obj,·predicate,·context)·{ | ||
4 | ········predicate·=·_cb(predicate,·context); | ||
5 | ········var·_keys·=·keys(obj), | ||
6 | ············key; | ||
7 | ········for·(var·i·=·0,·length·=·_keys.length;·i·<·length;·i++)·{ | ||
8 | ············key·=·_keys[i]; | ||
9 | ············if·(predicate(obj[key],·key,·obj))·return·key; | ||
10 | ········} | ||
11 | ····} | ||
12 | ····return·find | 4 | ····return·findIndex; |
13 | })); | 5 | })); |
Offset 1, 10 lines modified | Offset 1, 16 lines modified | ||
1 | define(['./index | 1 | define(['./index3',·'./index149'],·(function(_cb,·keys)·{ |
2 | ····//·Assigns·a·given·object·with·all·the·own·properties·in·the·passed-in | ||
3 | ····//·object(s). | ||
4 | ····//·(https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) | ||
5 | ···· | 2 | ····//·Returns·the·first·key·on·an·object·that·passes·a·truth·test. |
3 | ····function·findKey(obj,·predicate,·context)·{ | ||
4 | ········predicate·=·_cb(predicate,·context); | ||
5 | ········var·_keys·=·keys(obj), | ||
6 | ············key; | ||
7 | ········for·(var·i·=·0,·length·=·_keys.length;·i·<·length;·i++)·{ | ||
8 | ············key·=·_keys[i]; | ||
9 | ············if·(predicate(obj[key],·key,·obj))·return·key; | ||
10 | ········} | ||
11 | ····} | ||
6 | ····return· | 12 | ····return·findKey; |
7 | })); | 13 | })); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index5 | 1 | define(['./index57',·'./index110'],·(function(find,·matcher)·{ |
2 | ····//·Convenience·version·of·a·common·use·case·of·`_.find`:·getting·the·first | 2 | ····//·Convenience·version·of·a·common·use·case·of·`_.find`:·getting·the·first |
3 | ····//·object·containing·specific·`key:value`·pairs. | 3 | ····//·object·containing·specific·`key:value`·pairs. |
4 | ····function·findWhere(obj,·attrs)·{ | 4 | ····function·findWhere(obj,·attrs)·{ |
5 | ········return·find(obj,·matcher(attrs)); | 5 | ········return·find(obj,·matcher(attrs)); |
6 | ····} | 6 | ····} |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index | 1 | define(['./index72'],·(function(initial)·{ |
2 | ····//·Get·the·first·element·of·an·array.·Passing·**n**·will·return·the·first·N | 2 | ····//·Get·the·first·element·of·an·array.·Passing·**n**·will·return·the·first·N |
3 | ····//·values·in·the·array.·The·**guard**·check·allows·it·to·work·with·`_.map`. | 3 | ····//·values·in·the·array.·The·**guard**·check·allows·it·to·work·with·`_.map`. |
4 | ····function·first(array,·n,·guard)·{ | 4 | ····function·first(array,·n,·guard)·{ |
5 | ········if·(array·==·null·||·array.length·<·1)·return·n·==·null·||·guard·?·void·0·:·[]; | 5 | ········if·(array·==·null·||·array.length·<·1)·return·n·==·null·||·guard·?·void·0·:·[]; |
6 | ········if·(n·==·null·||·guard)·return·array[0]; | 6 | ········if·(n·==·null·||·guard)·return·array[0]; |
7 | ········return·initial(array,·array.length·-·n); | 7 | ········return·initial(array,·array.length·-·n); |
Offset 1, 19 lines modified | Offset 1, 11 lines modified | ||
1 | define(['./index1 | 1 | define(['./index15'],·(function(_flatten)·{ |
2 | ····//·Flatten·out·an·array,·either·recursively·(by·default),·or·up·to·`depth`. | ||
3 | ····//·Passing·`true`·or·`false`·as·`depth`·means·`1`·or·`Infinity`,·respectively. | ||
4 | ····function·flatten(array,·depth)·{ | ||
5 | ········return·_flatten(array,·depth,·false); | ||
2 | ····//·Shortcut·function·for·checking·if·an·object·has·a·given·property·directly·on | ||
3 | ····//·itself·(in·other·words,·not·on·a·prototype).·Unlike·the·internal·`has` | ||
4 | ····//·function,·this·public·version·can·also·traverse·nested·properties. | ||
5 | ····function·has(obj,·path)·{ | ||
6 | ········path·=·_toPath(path); | ||
7 | ········var·length·=·path.length; | ||
8 | ········for·(var·i·=·0;·i·<·length;·i++)·{ | ||
9 | ············var·key·=·path[i]; | ||
10 | ············if·(!_has(obj,·key))·return·false; | ||
11 | ············obj·=·obj[key]; | ||
12 | ········} | ||
13 | ········return·!!length; | ||
14 | ····} | 6 | ····} |
15 | ····return· | 7 | ····return·flatten; |
16 | })); | 8 | })); |
Offset 1, 10 lines modified | Offset 1, 14 lines modified | ||
1 | define((function()·{ | 1 | define(['./index88'],·(function(isFunction)·{ |
2 | ····//·Keep·the·identity·function·around·for·default·iteratees. | ||
3 | ····function·identity(value)·{ | ||
4 | ······· | 2 | ····//·Return·a·sorted·list·of·the·function·names·available·on·the·object. |
3 | ····function·functions(obj)·{ | ||
4 | ········var·names·=·[]; | ||
5 | ········for·(var·key·in·obj)·{ | ||
6 | ············if·(isFunction(obj[key]))·names.push(key); | ||
7 | ········} | ||
8 | ········return·names.sort(); | ||
5 | ····} | 9 | ····} |
6 | ····return· | 10 | ····return·functions; |
7 | })); | 11 | })); |
Offset 1, 29 lines modified | Offset 1, 14 lines modified | ||
1 | define(['./index | 1 | define(['./index31',·'./index13',·'./index100'],·(function(_toPath,·_deepGet,·isUndefined)·{ |
2 | ····//·Get·the·value·of·the·(deep)·property·on·`path`·from·`object`. | ||
3 | ····//·If·any·property·in·`path`·does·not·exist·or·if·the·value·is | ||
4 | ····//·`undefined`,·return·`defaultValue`·instead. | ||
5 | ····//·The·`path`·is·normalized·through·`_.toPath`. | ||
6 | ····function·get(object,·path,·defaultValue)·{ | ||
7 | ········var·value·=·_deepGet(object,·_toPath(path)); | ||
8 | ········return·isUndefined(value)·?·defaultValue·:·value; | ||
9 | ····} | ||
2 | ····//·Default·Export | ||
3 | ····//·============== | ||
4 | ····//·In·this·module,·we·mix·our·bundled·exports·into·the·`_`·object·and·export | ||
5 | ····//·the·result.·This·is·analogous·to·setting·`module.exports·=·_`·in·CommonJS. | ||
6 | ····//·Hence,·this·module·is·also·the·entry·point·of·our·UMD·bundle·and·the·package | ||
7 | ····//·entry·point·for·CommonJS·and·AMD·users.·In·other·words,·this·is·(the·source | ||
8 | ····//·of)·the·module·you·are·interfacing·with·when·you·do·any·of·the·following: | ||
9 | ····// | ||
10 | ····//·```js | ||
11 | ····//·//·CommonJS | ||
12 | ····//·var·_·=·require('underscore'); | ||
13 | ····// | ||
14 | ····//·//·AMD | ||
15 | ····//·define(['underscore'],·function(_)·{...}); | ||
16 | ····// | ||
17 | ····//·//·UMD·in·the·browser | ||
18 | ····//·//·_·is·available·as·a·global·variable | ||
19 | ····//·``` | ||
20 | ····//·Add·all·of·the·Underscore·functions·to·the·wrapper·object. | ||
21 | ····var·_·=·mixin(index); | ||
22 | ····//·Legacy·Node.js·API. | ||
23 | ····_._·=·_; | ||
24 | ····return· | 10 | ····return·get; |
25 | })); | 11 | })); |
Offset 1, 157 lines modified | Offset 1, 12 lines modified | ||
1 | define([' | 1 | define(['./index18',·'./index19'],·(function(_group,·_has)·{ |
2 | ····//·Groups·the·object's·values·by·a·criterion.·Pass·either·a·string·attribute | ||
3 | ····//·to·group·by,·or·a·function·that·returns·the·criterion. | ||
4 | ····var·groupBy·=·_group(function(result,·value,·key)·{ | ||
5 | ········if·(_has(result,·key))·result[key].push(value); | ||
6 | ········else·result[key]·=·[value]; | ||
2 | ····//·Named·Exports | ||
3 | ····//·============= | ||
4 | ····exports.VERSION·=·_setup.VERSION; | ||
5 | ····exports.restArguments·=·restArguments; | ||
6 | ····exports.isObject·=·isObject; | ||
7 | ····exports.isNull·=·isNull; | ||
8 | ····exports.isUndefined·=·isUndefined; | ||
9 | ····exports.isBoolean·=·isBoolean; | ||
10 | ····exports.isElement·=·isElement; | ||
11 | ····exports.isString·=·isString; | ||
12 | ····exports.isNumber·=·isNumber; | ||
13 | ····exports.isDate·=·isDate; | ||
14 | ····exports.isRegExp·=·isRegExp; | ||
15 | ····exports.isError·=·isError; | ||
16 | ····exports.isSymbol·=·isSymbol; | ||
17 | ····exports.isArrayBuffer·=·isArrayBuffer; | ||
18 | ····exports.isDataView·=·isDataView; | ||
19 | ····exports.isArray·=·isArray; | ||
20 | ····exports.isFunction·=·isFunction; | ||
21 | ····exports.isArguments·=·isArguments; | ||
22 | ····exports.isFinite·=·isFinite; | ||
23 | ····exports.isNaN·=·isNaN; | ||
24 | ····exports.isTypedArray·=·isTypedArray; | ||
25 | ····exports.isEmpty·=·isEmpty; | ||
26 | ····exports.isMatch·=·isMatch; | ||
27 | ····exports.isEqual·=·isEqual; | ||
28 | ····exports.isMap·=·isMap; | ||
29 | ····exports.isWeakMap·=·isWeakMap; | ||
30 | ····exports.isSet·=·isSet; | ||
31 | ····exports.isWeakSet·=·isWeakSet; | ||
32 | ····exports.keys·=·keys; | ||
33 | ····exports.allKeys·=·allKeys; | ||
34 | ····exports.values·=·values; | ||
35 | ····exports.pairs·=·pairs; | ||
36 | ····exports.invert·=·invert; | ||
37 | ····exports.functions·=·functions; | ||
38 | ····exports.methods·=·functions; | ||
39 | ····exports.extend·=·extend; | ||
40 | ····exports.assign·=·extendOwn; | ||
41 | ····exports.extendOwn·=·extendOwn; | ||
42 | ····exports.defaults·=·defaults; | ||
43 | ····exports.create·=·create; | ||
44 | ····exports.clone·=·clone; | ||
45 | ····exports.tap·=·tap; | ||
46 | ····exports.get·=·get; | ||
47 | ····exports.has·=·has; | ||
48 | ····exports.mapObject·=·mapObject; | ||
49 | ····exports.identity·=·identity; | ||
50 | ····exports.constant·=·constant; | ||
51 | ····exports.noop·=·noop; | ||
52 | ····exports.toPath·=·toPath; | ||
53 | ····exports.property·=·property; | ||
54 | ····exports.propertyOf·=·propertyOf; | ||
55 | ····exports.matcher·=·matcher; | ||
56 | ····exports.matches·=·matcher; | ||
57 | ····exports.times·=·times; | ||
58 | ····exports.random·=·random; | ||
59 | ····exports.now·=·now; | ||
60 | ····exports.escape·=·escape; | ||
61 | ····exports.unescape·=·unescape; | ||
62 | ····exports.templateSettings·=·templateSettings; | ||
63 | ····exports.template·=·template; | ||
64 | ····exports.result·=·result; | ||
65 | ····exports.uniqueId·=·uniqueId; | ||
66 | ····exports.chain·=·chain; | ||
67 | ····exports.iteratee·=·iteratee; | ||
68 | ····exports.partial·=·partial; | ||
69 | ····exports.bind·=·bind; | ||
70 | ····exports.bindAll·=·bindAll; | ||
71 | ····exports.memoize·=·memoize; | ||
72 | ····exports.delay·=·delay; | ||
73 | ····exports.defer·=·defer; | ||
74 | ····exports.throttle·=·throttle; | ||
75 | ····exports.debounce·=·debounce; | ||
76 | ····exports.wrap·=·wrap; | ||
77 | ····exports.negate·=·negate; | ||
78 | ····exports.compose·=·compose; | ||
79 | ····exports.after·=·after; | ||
80 | ····exports.before·=·before; | ||
81 | ····exports.once·=·once; | ||
82 | ····exports.findKey·=·findKey; | ||
83 | ····exports.findIndex·=·findIndex; | ||
84 | ····exports.findLastIndex·=·findLastIndex; | ||
85 | ····exports.sortedIndex·=·sortedIndex; | ||
86 | ····exports.indexOf·=·indexOf; | ||
87 | ····exports.lastIndexOf·=·lastIndexOf; | ||
88 | ····exports.detect·=·find; | ||
89 | ····exports.find·=·find; | ||
90 | ····exports.findWhere·=·findWhere; | ||
91 | ····exports.each·=·each; | ||
92 | ····exports.forEach·=·each; | ||
93 | ····exports.collect·=·map; | ||
94 | ····exports.map·=·map; | ||
95 | ····exports.foldl·=·reduce; | ||
96 | ····exports.inject·=·reduce; | ||
97 | ····exports.reduce·=·reduce; | ||
98 | ····exports.foldr·=·reduceRight; | ||
99 | ····exports.reduceRight·=·reduceRight; | ||
100 | ····exports.filter·=·filter; | ||
101 | ····exports.select·=·filter; | ||
102 | ····exports.reject·=·reject; | ||
103 | ····exports.all·=·every; | ||
104 | ····exports.every·=·every; | ||
105 | ····exports.any·=·some; | ||
106 | ····exports.some·=·some; | ||
107 | ····exports.contains·=·contains; | ||
108 | ····exports.include·=·contains; | ||
109 | ····exports.includes·=·contains; | ||
110 | ····exports.invoke·=·invoke; | ||
111 | ····exports.pluck·=·pluck; | ||
112 | ····exports.where·=·where; | ||
113 | ····exports.max·=·max; | ||
114 | ····exports.min·=·min; | ||
115 | ····exports.shuffle·=·shuffle; | ||
116 | ····exports.sample·=·sample; | ||
117 | ····exports.sortBy·=·sortBy; | ||
118 | ····exports.groupBy·=·groupBy; | ||
119 | ····exports.indexBy·=·indexBy; | ||
120 | ····exports.countBy·=·countBy; | ||
Max diff block lines reached; 31/8012 bytes (0.39%) of diff not shown. |
Offset 1, 11 lines modified | Offset 1, 19 lines modified | ||
1 | define(['./index1 | 1 | define(['./index19',·'./index31'],·(function(_has,·_toPath)·{ |
2 | ····//·Indexes·the·object's·values·by·a·criterion,·similar·to·`_.groupBy`,·but·for | ||
3 | ····//·when·you·know·that·your·index·values·will·be·unique. | ||
4 | ····var·indexBy·=·_group(function(result,·value,·key)·{ | ||
5 | ········ | 2 | ····//·Shortcut·function·for·checking·if·an·object·has·a·given·property·directly·on |
3 | ····//·itself·(in·other·words,·not·on·a·prototype).·Unlike·the·internal·`has` | ||
4 | ····//·function,·this·public·version·can·also·traverse·nested·properties. | ||
5 | ····function·has(obj,·path)·{ | ||
6 | ········path·=·_toPath(path); | ||
7 | ········var·length·=·path.length; | ||
8 | ········for·(var·i·=·0;·i·<·length;·i++)·{ | ||
9 | ············var·key·=·path[i]; | ||
10 | ············if·(!_has(obj,·key))·return·false; | ||
11 | ············obj·=·obj[key]; | ||
12 | ········} | ||
13 | ········return·!!length; | ||
6 | ····} | 14 | ····} |
7 | ····return· | 15 | ····return·has; |
8 | })); | 16 | })); |
Offset 1, 11 lines modified | Offset 1, 10 lines modified | ||
1 | define( | 1 | define((function()·{ |
2 | ····//·Keep·the·identity·function·around·for·default·iteratees. | ||
3 | ····function·identity(value)·{ | ||
4 | ········return·value; | ||
5 | ····} | ||
2 | ····//·Return·the·position·of·the·first·occurrence·of·an·item·in·an·array, | ||
3 | ····//·or·-1·if·the·item·is·not·included·in·the·array. | ||
4 | ····//·If·the·array·is·large·and·already·in·sort·order,·pass·`true` | ||
5 | ····//·for·**isSorted**·to·use·binary·search. | ||
6 | ····var·indexOf·=·_createIndexFinder(1,·findIndex,·sortedIndex); | ||
7 | ····return·i | 6 | ····return·identity; |
8 | })); | 7 | })); |
Offset 1, 12 lines modified | Offset 1, 29 lines modified | ||
1 | define(['./index | 1 | define(['./index70',·'./index113'],·(function(index,·mixin)·{ |
2 | ····//·Returns·everything·but·the·last·entry·of·the·array.·Especially·useful·on | ||
3 | ····//·the·arguments·object.·Passing·**n**·will·return·all·the·values·in | ||
4 | ····//·the·array,·excluding·the·last·N. | ||
5 | ····function·initial(array,·n,·guard)·{ | ||
6 | ········return·_setup.slice.call(array,·0,·Math.max(0,·array.length·-·(n·==·null·||·guard·?·1·:·n))); | ||
7 | ···· | 2 | ····//·Default·Export |
3 | ····//·============== | ||
4 | ····//·In·this·module,·we·mix·our·bundled·exports·into·the·`_`·object·and·export | ||
5 | ····//·the·result.·This·is·analogous·to·setting·`module.exports·=·_`·in·CommonJS. | ||
6 | ····//·Hence,·this·module·is·also·the·entry·point·of·our·UMD·bundle·and·the·package | ||
7 | ····//·entry·point·for·CommonJS·and·AMD·users.·In·other·words,·this·is·(the·source | ||
8 | ····//·of)·the·module·you·are·interfacing·with·when·you·do·any·of·the·following: | ||
9 | ····// | ||
10 | ····//·```js | ||
11 | ····//·//·CommonJS | ||
12 | ····//·var·_·=·require('underscore'); | ||
13 | ····// | ||
14 | ····//·//·AMD | ||
15 | ····//·define(['underscore'],·function(_)·{...}); | ||
16 | ····// | ||
17 | ····//·//·UMD·in·the·browser | ||
18 | ····//·//·_·is·available·as·a·global·variable | ||
19 | ····//·``` | ||
20 | ····//·Add·all·of·the·Underscore·functions·to·the·wrapper·object. | ||
21 | ····var·_·=·mixin(index); | ||
22 | ····//·Legacy·Node.js·API. | ||
23 | ····_._·=·_; | ||
8 | ····return· | 24 | ····return·_; |
9 | })); | 25 | })); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index1 | 1 | define(['./index149'],·(function(keys)·{ |
2 | ····//·Internal·helper·to·generate·functions·for·escaping·and·unescaping·strings | 2 | ····//·Internal·helper·to·generate·functions·for·escaping·and·unescaping·strings |
3 | ····//·to/from·HTML·interpolation. | 3 | ····//·to/from·HTML·interpolation. |
4 | ····function·createEscaper(map)·{ | 4 | ····function·createEscaper(map)·{ |
5 | ········var·escaper·=·function(match)·{ | 5 | ········var·escaper·=·function(match)·{ |
6 | ············return·map[match]; | 6 | ············return·map[match]; |
7 | ········}; | 7 | ········}; |
Offset 1, 22 lines modified | Offset 1, 157 lines modified | ||
1 | define(['./index17',·'./index | 1 | define(['exports',·'./index26',·'./index133',·'./index94',·'./index92',·'./index100',·'./index80',·'./index83',·'./index97',·'./index93',·'./index82',·'./index95',·'./index86',·'./index98',·'./index79',·'./index81',·'./index78',·'./index88',·'./index77',·'./index87[·...·truncated·by·diffoscope;·len:·2619,·SHA:·0e602ea6fd59c887a8cb1ccb7353011439e0c385f294bd6070f6cf350a240c45·...·])·{ |
2 | ····//·Named·Exports | ||
3 | ····//·============= | ||
2 | ····//·Produce·an·array·that·contains·every·item·shared·between·all·the | ||
3 | ····//·passed-in·arrays. | ||
4 | ····function·intersection(array)·{ | ||
5 | ········var·result·=·[]; | ||
6 | ········var·argsLength·=·arguments.length; | ||
7 | ········for·(var·i·=·0,·length·=·_getLength(array);·i·<·length;·i++)·{ | ||
8 | ············var·item·=·array[i]; | ||
9 | ············if·(contains(result,·item))·continue; | ||
10 | ············var·j; | ||
11 | ············for·(j·=·1;·j·<·argsLength;·j++)·{ | ||
12 | ················if·(!contains(arguments[j],·item))·break; | ||
13 | ············} | ||
14 | ············if·(j·===·argsLength)·result.push(item); | ||
15 | ········} | ||
16 | ········return·result; | ||
17 | ····} | ||
18 | ····r | 4 | ····exports.VERSION·=·_setup.VERSION; |
5 | ····exports.restArguments·=·restArguments; | ||
6 | ····exports.isObject·=·isObject; | ||
7 | ····exports.isNull·=·isNull; | ||
8 | ····exports.isUndefined·=·isUndefined; | ||
9 | ····exports.isBoolean·=·isBoolean; | ||
10 | ····exports.isElement·=·isElement; | ||
11 | ····exports.isString·=·isString; | ||
12 | ····exports.isNumber·=·isNumber; | ||
13 | ····exports.isDate·=·isDate; | ||
14 | ····exports.isRegExp·=·isRegExp; | ||
15 | ····exports.isError·=·isError; | ||
16 | ····exports.isSymbol·=·isSymbol; | ||
17 | ····exports.isArrayBuffer·=·isArrayBuffer; | ||
18 | ····exports.isDataView·=·isDataView; | ||
19 | ····exports.isArray·=·isArray; | ||
20 | ····exports.isFunction·=·isFunction; | ||
21 | ····exports.isArguments·=·isArguments; | ||
22 | ····exports.isFinite·=·isFinite; | ||
23 | ····exports.isNaN·=·isNaN; | ||
24 | ····exports.isTypedArray·=·isTypedArray; | ||
25 | ····exports.isEmpty·=·isEmpty; | ||
26 | ····exports.isMatch·=·isMatch; | ||
27 | ····exports.isEqual·=·isEqual; | ||
28 | ····exports.isMap·=·isMap; | ||
29 | ····exports.isWeakMap·=·isWeakMap; | ||
30 | ····exports.isSet·=·isSet; | ||
31 | ····exports.isWeakSet·=·isWeakSet; | ||
32 | ····exports.keys·=·keys; | ||
33 | ····exports.allKeys·=·allKeys; | ||
34 | ····exports.values·=·values; | ||
35 | ····exports.pairs·=·pairs; | ||
36 | ····exports.invert·=·invert; | ||
37 | ····exports.functions·=·functions; | ||
38 | ····exports.methods·=·functions; | ||
39 | ····exports.extend·=·extend; | ||
40 | ····exports.assign·=·extendOwn; | ||
41 | ····exports.extendOwn·=·extendOwn; | ||
42 | ····exports.defaults·=·defaults; | ||
43 | ····exports.create·=·create; | ||
44 | ····exports.clone·=·clone; | ||
45 | ····exports.tap·=·tap; | ||
46 | ····exports.get·=·get; | ||
47 | ····exports.has·=·has; | ||
48 | ····exports.mapObject·=·mapObject; | ||
49 | ····exports.identity·=·identity; | ||
50 | ····exports.constant·=·constant; | ||
51 | ····exports.noop·=·noop; | ||
52 | ····exports.toPath·=·toPath; | ||
53 | ····exports.property·=·property; | ||
54 | ····exports.propertyOf·=·propertyOf; | ||
55 | ····exports.matcher·=·matcher; | ||
56 | ····exports.matches·=·matcher; | ||
57 | ····exports.times·=·times; | ||
58 | ····exports.random·=·random; | ||
59 | ····exports.now·=·now; | ||
60 | ····exports.escape·=·escape; | ||
61 | ····exports.unescape·=·unescape; | ||
62 | ····exports.templateSettings·=·templateSettings; | ||
63 | ····exports.template·=·template; | ||
64 | ····exports.result·=·result; | ||
65 | ····exports.uniqueId·=·uniqueId; | ||
66 | ····exports.chain·=·chain; | ||
67 | ····exports.iteratee·=·iteratee; | ||
68 | ····exports.partial·=·partial; | ||
69 | ····exports.bind·=·bind; | ||
70 | ····exports.bindAll·=·bindAll; | ||
71 | ····exports.memoize·=·memoize; | ||
72 | ····exports.delay·=·delay; | ||
73 | ····exports.defer·=·defer; | ||
74 | ····exports.throttle·=·throttle; | ||
75 | ····exports.debounce·=·debounce; | ||
76 | ····exports.wrap·=·wrap; | ||
77 | ····exports.negate·=·negate; | ||
78 | ····exports.compose·=·compose; | ||
79 | ····exports.after·=·after; | ||
80 | ····exports.before·=·before; | ||
81 | ····exports.once·=·once; | ||
82 | ····exports.findKey·=·findKey; | ||
83 | ····exports.findIndex·=·findIndex; | ||
84 | ····exports.findLastIndex·=·findLastIndex; | ||
85 | ····exports.sortedIndex·=·sortedIndex; | ||
86 | ····exports.indexOf·=·indexOf; | ||
87 | ····exports.lastIndexOf·=·lastIndexOf; | ||
88 | ····exports.detect·=·find; | ||
89 | ····exports.find·=·find; | ||
90 | ····exports.findWhere·=·findWhere; | ||
91 | ····exports.each·=·each; | ||
92 | ····exports.forEach·=·each; | ||
93 | ····exports.collect·=·map; | ||
94 | ····exports.map·=·map; | ||
95 | ····exports.foldl·=·reduce; | ||
96 | ····exports.inject·=·reduce; | ||
97 | ····exports.reduce·=·reduce; | ||
98 | ····exports.foldr·=·reduceRight; | ||
99 | ····exports.reduceRight·=·reduceRight; | ||
100 | ····exports.filter·=·filter; | ||
101 | ····exports.select·=·filter; | ||
102 | ····exports.reject·=·reject; | ||
103 | ····exports.all·=·every; | ||
104 | ····exports.every·=·every; | ||
105 | ····exports.any·=·some; | ||
106 | ····exports.some·=·some; | ||
107 | ····exports.contains·=·contains; | ||
108 | ····exports.include·=·contains; | ||
109 | ····exports.includes·=·contains; | ||
Max diff block lines reached; 6/8327 bytes (0.07%) of diff not shown. |
Offset 1, 15 lines modified | Offset 1, 11 lines modified | ||
1 | define(['./index1 | 1 | define(['./index18'],·(function(_group)·{ |
2 | ····//·Indexes·the·object's·values·by·a·criterion,·similar·to·`_.groupBy`,·but·for | ||
3 | ····//·when·you·know·that·your·index·values·will·be·unique. | ||
4 | ····var·indexBy·=·_group(function(result,·value,·key)·{ | ||
5 | ········result[key]·=·value; | ||
2 | ····//·Invert·the·keys·and·values·of·an·object.·The·values·must·be·serializable. | ||
3 | ····function·invert(obj)·{ | ||
4 | ········var·result·=·{}; | ||
5 | ········var·_keys·=·keys(obj); | ||
6 | ········for·(var·i·=·0,·length·=·_keys.length;·i·<·length;·i++)·{ | ||
7 | ············result[obj[_keys[i]]]·=·_keys[i]; | ||
8 | ········} | ||
9 | ········return·result; | ||
10 | ····} | 6 | ····}); |
11 | ····return·in | 7 | ····return·indexBy; |
12 | })); | 8 | })); |
Offset 1, 28 lines modified | Offset 1, 12 lines modified | ||
1 | define(['./index | 1 | define(['./index26'],·(function(_setup)·{ |
2 | ····//·Returns·everything·but·the·last·entry·of·the·array.·Especially·useful·on | ||
3 | ····//·the·arguments·object.·Passing·**n**·will·return·all·the·values·in | ||
4 | ····//·the·array,·excluding·the·last·N. | ||
5 | ····function·initial(array,·n,·guard)·{ | ||
6 | ········return·_setup.slice.call(array,·0,·Math.max(0,·array.length·-·(n·==·null·||·guard·?·1·:·n))); | ||
2 | ····//·Invoke·a·method·(with·arguments)·on·every·item·in·a·collection. | ||
3 | ····var·invoke·=·restArguments(function(obj,·path,·args)·{ | ||
4 | ········var·contextPath,·func; | ||
5 | ········if·(isFunction(path))·{ | ||
6 | ············func·=·path; | ||
7 | ········}·else·{ | ||
8 | ············path·=·_toPath(path); | ||
9 | ············contextPath·=·path.slice(0,·-1); | ||
10 | ············path·=·path[path.length·-·1]; | ||
11 | ········} | ||
12 | ········return·map(obj,·function(context)·{ | ||
13 | ············var·method·=·func; | ||
14 | ············if·(!method)·{ | ||
15 | ················if·(contextPath·&&·contextPath.length)·{ | ||
16 | ····················context·=·_deepGet(context,·contextPath); | ||
17 | ················} | ||
18 | ················if·(context·==·null)·return·void·0; | ||
19 | ················method·=·context[path]; | ||
20 | ············} | ||
21 | ············return·method·==·null·?·method·:·method.apply(context,·args); | ||
22 | ········}); | ||
23 | ····} | 7 | ····} |
24 | ····return·in | 8 | ····return·initial; |
25 | })); | 9 | })); |
Offset 1, 19 lines modified | Offset 1, 11 lines modified | ||
1 | define(['./index | 1 | define(['./index140',·'./index58',·'./index8'],·(function(sortedIndex,·findIndex,·_createIndexFinder)·{ |
2 | ···· | 2 | ····//·Return·the·position·of·the·first·occurrence·of·an·item·in·an·array, |
3 | ····//·or·-1·if·the·item·is·not·included·in·the·array. | ||
4 | ····//·If·the·array·is·large·and·already·in·sort·order,·pass·`true` | ||
5 | ····//·for·**isSorted**·to·use·binary·search. | ||
6 | ····var·indexOf·=·_createIndexFinder(1,·findIndex,·sortedIndex); | ||
7 | ····return·indexOf; | ||
3 | ····//·Define·a·fallback·version·of·the·method·in·browsers·(ahem,·IE·<·9),·where | ||
4 | ····//·there·isn't·any·inspectable·"Arguments"·type. | ||
5 | ····(function()·{ | ||
6 | ········if·(!isArguments(arguments))·{ | ||
7 | ············isArguments·=·function(obj)·{ | ||
8 | ················return·_has(obj,·'callee'); | ||
9 | ············}; | ||
10 | ········} | ||
11 | ····}()); | ||
12 | ····var·isArguments$1·=·isArguments; | ||
13 | ····return·isArguments$1; | ||
14 | })); | 8 | })); |
Offset 1, 9 lines modified | Offset 1, 22 lines modified | ||
1 | define(['./index | 1 | define(['./index17',·'./index44'],·(function(_getLength,·contains)·{ |
2 | ····//·Is·a·given·value·an·array? | ||
3 | ····//·Delegates·to·ECMA5's·native·`Array.isArray`. | ||
4 | ···· | 2 | ····//·Produce·an·array·that·contains·every·item·shared·between·all·the |
3 | ····//·passed-in·arrays. | ||
4 | ····function·intersection(array)·{ | ||
5 | ········var·result·=·[]; | ||
6 | ········var·argsLength·=·arguments.length; | ||
7 | ········for·(var·i·=·0,·length·=·_getLength(array);·i·<·length;·i++)·{ | ||
8 | ············var·item·=·array[i]; | ||
9 | ············if·(contains(result,·item))·continue; | ||
10 | ············var·j; | ||
11 | ············for·(j·=·1;·j·<·argsLength;·j++)·{ | ||
12 | ················if·(!contains(arguments[j],·item))·break; | ||
13 | ············} | ||
14 | ············if·(j·===·argsLength)·result.push(item); | ||
15 | ········} | ||
16 | ········return·result; | ||
17 | ····} | ||
5 | ····return·is | 18 | ····return·intersection; |
6 | })); | 19 | })); |
Offset 1, 7 lines modified | Offset 1, 15 lines modified | ||
1 | define(['./index | 1 | define(['./index149'],·(function(keys)·{ |
2 | ····v | 2 | ····//·Invert·the·keys·and·values·of·an·object.·The·values·must·be·serializable. |
3 | ····function·invert(obj)·{ | ||
4 | ········var·result·=·{}; | ||
5 | ········var·_keys·=·keys(obj); | ||
6 | ········for·(var·i·=·0,·length·=·_keys.length;·i·<·length;·i++)·{ | ||
7 | ············result[obj[_keys[i]]]·=·_keys[i]; | ||
8 | ········} | ||
9 | ········return·result; | ||
10 | ····} | ||
3 | ····return·i | 11 | ····return·invert; |
4 | })); | 12 | })); |
Offset 1, 10 lines modified | Offset 1, 28 lines modified | ||
1 | define(['./index | 1 | define(['./index133',·'./index88',·'./index107',·'./index13',·'./index31'],·(function(restArguments,·isFunction,·map,·_deepGet,·_toPath)·{ |
2 | ····//·Is·a·given·value·a·boolean? | ||
3 | ····function·isBoolean(obj)·{ | ||
4 | ···· | 2 | ····//·Invoke·a·method·(with·arguments)·on·every·item·in·a·collection. |
3 | ····var·invoke·=·restArguments(function(obj,·path,·args)·{ | ||
4 | ········var·contextPath,·func; | ||
5 | ········if·(isFunction(path))·{ | ||
6 | ············func·=·path; | ||
7 | ········}·else·{ | ||
8 | ············path·=·_toPath(path); | ||
9 | ············contextPath·=·path.slice(0,·-1); | ||
10 | ············path·=·path[path.length·-·1]; | ||
11 | ········} | ||
12 | ········return·map(obj,·function(context)·{ | ||
13 | ············var·method·=·func; | ||
14 | ············if·(!method)·{ | ||
15 | ················if·(contextPath·&&·contextPath.length)·{ | ||
16 | ····················context·=·_deepGet(context,·contextPath); | ||
17 | ················} | ||
18 | ················if·(context·==·null)·return·void·0; | ||
19 | ················method·=·context[path]; | ||
20 | ············} | ||
21 | ············return·method·==·null·?·method·:·method.apply(context,·args); | ||
22 | ········}); | ||
5 | ····} | 23 | ····}); |
6 | ····return·i | 24 | ····return·invoke; |
7 | })); | 25 | })); |
Offset 1, 15 lines modified | Offset 1, 19 lines modified | ||
1 | define(['./index29',·'./index | 1 | define(['./index29',·'./index19'],·(function(_tagTester,·_has)·{ |
2 | ····var·is | 2 | ····var·isArguments·=·_tagTester('Arguments'); |
3 | ····//·In·IE·10·-·Edge·13,·we·need·a·different·heuristic | ||
4 | ····//·to·determine·whether·an·object·is·a·`DataView`. | ||
5 | ····function·ie10IsDataView(obj)·{ | ||
6 | ········return·obj·!=·null·&&·isFunction(obj.getInt8)·&&·isArrayBuffer(obj.buffer); | ||
7 | ···· | 3 | ····//·Define·a·fallback·version·of·the·method·in·browsers·(ahem,·IE·<·9),·where |
4 | ····//·there·isn't·any·inspectable·"Arguments"·type. | ||
5 | ····(function()·{ | ||
6 | ········if·(!isArguments(arguments))·{ | ||
7 | ············isArguments·=·function(obj)·{ | ||
8 | ················return·_has(obj,·'callee'); | ||
9 | ············}; | ||
10 | ········} | ||
11 | ····}()); | ||
8 | ····var·is | 12 | ····var·isArguments$1·=·isArguments; |
9 | ····return·is | 13 | ····return·isArguments$1; |
10 | })); | 14 | })); |
Offset 1, 7 lines modified | Offset 1, 9 lines modified | ||
1 | define(['./index29'],·(function(_tagTester)·{ | 1 | define(['./index26',·'./index29'],·(function(_setup,·_tagTester)·{ |
2 | ···· | 2 | ····//·Is·a·given·value·an·array? |
3 | ····//·Delegates·to·ECMA5's·native·`Array.isArray`. | ||
4 | ····var·isArray·=·_setup.nativeIsArray·||·_tagTester('Array'); | ||
3 | ····return·is | 5 | ····return·isArray; |
4 | })); | 6 | })); |
Offset 1, 10 lines modified | Offset 1, 7 lines modified | ||
1 | define((function()·{ | 1 | define(['./index29'],·(function(_tagTester)·{ |
2 | ····var·isArrayBuffer·=·_tagTester('ArrayBuffer'); | ||
2 | ····//·Is·a·given·value·a·DOM·element? | ||
3 | ····function·isElement(obj)·{ | ||
4 | ········return·!!(obj·&&·obj.nodeType·===·1); | ||
5 | ····} | ||
6 | ····return·is | 3 | ····return·isArrayBuffer; |
7 | })); | 4 | })); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | define(['./index17',·'./index26',·'./index | 1 | define(['./index17',·'./index26',·'./index91'],·(function(_getLength,·_setup,·isNaN)·{ |
2 | ····//·Internal·function·to·generate·the·`_.indexOf`·and·`_.lastIndexOf`·functions. | 2 | ····//·Internal·function·to·generate·the·`_.indexOf`·and·`_.lastIndexOf`·functions. |
3 | ····function·createIndexFinder(dir,·predicateFind,·sortedIndex)·{ | 3 | ····function·createIndexFinder(dir,·predicateFind,·sortedIndex)·{ |
4 | ········return·function(array,·item,·idx)·{ | 4 | ········return·function(array,·item,·idx)·{ |
5 | ············var·i·=·0, | 5 | ············var·i·=·0, |
6 | ················length·=·_getLength(array); | 6 | ················length·=·_getLength(array); |
7 | ············if·(typeof·idx·==·'number')·{ | 7 | ············if·(typeof·idx·==·'number')·{ |
Offset 1, 18 lines modified | Offset 1, 10 lines modified | ||
1 | define(['./index | 1 | define(['./index26'],·(function(_setup)·{ |
2 | ····//·Is·a·given·value·a·boolean? | ||
2 | ····//·Is·a·given·array,·string,·or·object·empty? | ||
3 | ····//·An·"empty"·object·has·no·enumerable·own-properties. | ||
4 | ····function·is | 3 | ····function·isBoolean(obj)·{ |
4 | ········return·obj·===·true·||·obj·===·false·||·_setup.toString.call(obj)·===·'[object·Boolean]'; | ||
5 | ········if·(obj·==·null)·return·true; | ||
6 | ········//·Skip·the·more·expensive·`toString`-based·type·checks·if·`obj`·has·no | ||
7 | ········//·`.length`. | ||
8 | ········var·length·=·_getLength(obj); | ||
9 | ········if·(typeof·length·==·'number'·&&·( | ||
10 | ················isArray(obj)·||·isString(obj)·||·isArguments(obj) | ||
11 | ············))·return·length·===·0; | ||
12 | ········return·_getLength(keys(obj))·===·0; | ||
13 | ····} | 5 | ····} |
14 | ····return·is | 6 | ····return·isBoolean; |
15 | })); | 7 | })); |
Offset 1, 135 lines modified | Offset 1, 15 lines modified | ||
1 | define(['./index | 1 | define(['./index29',·'./index88',·'./index79',·'./index28'],·(function(_tagTester,·isFunction,·isArrayBuffer,·_stringTagBug)·{ |
2 | ····var·isDataView·=·_tagTester('DataView'); | ||
2 | ····//·We·use·this·string·twice,·so·give·it·a·name·for·minification. | ||
3 | ····var·tagDataView·=·'[object·DataView]'; | ||
3 | ····//·In·IE·10·-·Edge·13,·we·need·a·different·heuristic | ||
4 | ····//·to·determine·whether·an·object·is·a·`DataView`. | ||
5 | ····function·ie10IsDataView(obj)·{ | ||
6 | ········return·obj·!=·null·&&·isFunction(obj.getInt8)·&&·isArrayBuffer(obj.buffer); | ||
4 | ····//·Internal·recursive·comparison·function·for·`_.isEqual`. | ||
5 | ····function·eq(a,·b,·aStack,·bStack)·{ | ||
6 | ········//·Identical·objects·are·equal.·`0·===·-0`,·but·they·aren't·identical. | ||
7 | ········//·See·the·[Harmony·`egal`·proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). | ||
8 | ········if·(a·===·b)·return·a·!==·0·||·1·/·a·===·1·/·b; | ||
9 | ········//·`null`·or·`undefined`·only·equal·to·itself·(strict·comparison). | ||
10 | ········if·(a·==·null·||·b·==·null)·return·false; | ||
11 | ········//·`NaN`s·are·equivalent,·but·non-reflexive. | ||
12 | ········if·(a·!==·a)·return·b·!==·b; | ||
13 | ········//·Exhaust·primitive·checks | ||
14 | ········var·type·=·typeof·a; | ||
15 | ········if·(type·!==·'function'·&&·type·!==·'object'·&&·typeof·b·!=·'object')·return·false; | ||
16 | ········return·deepEq(a,·b,·aStack,·bStack); | ||
17 | ····} | 7 | ····} |
8 | ····var·isDataView$1·=·(_stringTagBug.hasStringTagBug·?·ie10IsDataView·:·isDataView); | ||
18 | ····//·Internal·recursive·comparison·function·for·`_.isEqual`. | ||
19 | ····function·deepEq(a,·b,·aStack,·bStack)·{ | ||
20 | ········//·Unwrap·any·wrapped·objects. | ||
21 | ········if·(a·instanceof·underscore)·a·=·a._wrapped; | ||
22 | ········if·(b·instanceof·underscore)·b·=·b._wrapped; | ||
23 | ········//·Compare·`[[Class]]`·names. | ||
24 | ········var·className·=·_setup.toString.call(a); | ||
25 | ········if·(className·!==·_setup.toString.call(b))·return·false; | ||
26 | ········//·Work·around·a·bug·in·IE·10·-·Edge·13. | ||
27 | ········if·(_stringTagBug.hasStringTagBug·&&·className·==·'[object·Object]'·&&·isDataView(a))·{ | ||
28 | ············if·(!isDataView(b))·return·false; | ||
29 | ············className·=·tagDataView; | ||
30 | ········} | ||
31 | ········switch·(className)·{ | ||
32 | ············//·These·types·are·compared·by·value. | ||
33 | ············case·'[object·RegExp]': | ||
34 | ················//·RegExps·are·coerced·to·strings·for·comparison·(Note:·''·+·/a/i·===·'/a/i') | ||
35 | ············case·'[object·String]': | ||
36 | ················//·Primitives·and·their·corresponding·object·wrappers·are·equivalent;·thus,·`"5"`·is | ||
37 | ················//·equivalent·to·`new·String("5")`. | ||
38 | ················return·''·+·a·===·''·+·b; | ||
39 | ············case·'[object·Number]': | ||
40 | ················//·`NaN`s·are·equivalent,·but·non-reflexive. | ||
41 | ················//·Object(NaN)·is·equivalent·to·NaN. | ||
42 | ················if·(+a·!==·+a)·return·+b·!==·+b; | ||
43 | ················//·An·`egal`·comparison·is·performed·for·other·numeric·values. | ||
44 | ················return·+a·===·0·?·1·/·+a·===·1·/·b·:·+a·===·+b; | ||
45 | ············case·'[object·Date]': | ||
46 | ············case·'[object·Boolean]': | ||
47 | ················//·Coerce·dates·and·booleans·to·numeric·primitive·values.·Dates·are·compared·by·their | ||
48 | ················//·millisecond·representations.·Note·that·invalid·dates·with·millisecond·representations | ||
49 | ················//·of·`NaN`·are·not·equivalent. | ||
50 | ················return·+a·===·+b; | ||
51 | ············case·'[object·Symbol]': | ||
52 | ················return·_setup.SymbolProto.valueOf.call(a)·===·_setup.SymbolProto.valueOf.call(b); | ||
53 | ············case·'[object·ArrayBuffer]': | ||
54 | ············case·tagDataView: | ||
55 | ················//·Coerce·to·typed·array·so·we·can·fall·through. | ||
56 | ················return·deepEq(_toBufferView(a),·_toBufferView(b),·aStack,·bStack); | ||
57 | ········} | ||
9 | ····return·isDataView$1; | ||
58 | ········var·areArrays·=·className·===·'[object·Array]'; | ||
59 | ········if·(!areArrays·&&·isTypedArray(a))·{ | ||
60 | ············var·byteLength·=·_getByteLength(a); | ||
61 | ············if·(byteLength·!==·_getByteLength(b))·return·false; | ||
62 | ············if·(a.buffer·===·b.buffer·&&·a.byteOffset·===·b.byteOffset)·return·true; | ||
63 | ············areArrays·=·true; | ||
64 | ········} | ||
65 | ········if·(!areArrays)·{ | ||
66 | ············if·(typeof·a·!=·'object'·||·typeof·b·!=·'object')·return·false; | ||
67 | ············//·Objects·with·different·constructors·are·not·equivalent,·but·`Object`s·or·`Array`s | ||
68 | ············//·from·different·frames·are. | ||
69 | ············var·aCtor·=·a.constructor, | ||
70 | ················bCtor·=·b.constructor; | ||
71 | ············if·(aCtor·!==·bCtor·&&·!(isFunction(aCtor)·&&·aCtor·instanceof·aCtor·&& | ||
72 | ····················isFunction(bCtor)·&&·bCtor·instanceof·bCtor)·&& | ||
73 | ················('constructor'·in·a·&&·'constructor'·in·b))·{ | ||
74 | ················return·false; | ||
75 | ············} | ||
76 | ········} | ||
77 | ········//·Assume·equality·for·cyclic·structures.·The·algorithm·for·detecting·cyclic | ||
78 | ········//·structures·is·adapted·from·ES·5.1·section·15.12.3,·abstract·operation·`JO`. | ||
79 | ········//·Initializing·stack·of·traversed·objects. | ||
80 | ········//·It's·done·here·since·we·only·need·them·for·objects·and·arrays·comparison. | ||
81 | ········aStack·=·aStack·||·[]; | ||
82 | ········bStack·=·bStack·||·[]; | ||
83 | ········var·length·=·aStack.length; | ||
84 | ········while·(length--)·{ | ||
85 | ············//·Linear·search.·Performance·is·inversely·proportional·to·the·number·of | ||
86 | ············//·unique·nested·structures. | ||
87 | ············if·(aStack[length]·===·a)·return·bStack[length]·===·b; | ||
88 | ········} | ||
89 | ········//·Add·the·first·object·to·the·stack·of·traversed·objects. | ||
90 | ········aStack.push(a); | ||
91 | ········bStack.push(b); | ||
92 | ········//·Recursively·compare·objects·and·arrays. | ||
93 | ········if·(areArrays)·{ | ||
94 | ············//·Compare·array·lengths·to·determine·if·a·deep·comparison·is·necessary. | ||
95 | ············length·=·a.length; | ||
96 | ············if·(length·!==·b.length)·return·false; | ||
97 | ············//·Deep·compare·the·contents,·ignoring·non-numeric·properties. | ||
98 | ············while·(length--)·{ | ||
99 | ················if·(!eq(a[length],·b[length],·aStack,·bStack))·return·false; | ||
100 | ············} | ||
101 | ········}·else·{ | ||
102 | ············//·Deep·compare·objects. | ||
103 | ············var·_keys·=·keys(a), | ||
104 | ················key; | ||
105 | ············length·=·_keys.length; | ||
106 | ············//·Ensure·that·both·objects·contain·the·same·number·of·properties·before·comparing·deep·equality. | ||
107 | ············if·(keys(b).length·!==·length)·return·false; | ||
108 | ············while·(length--)·{ | ||
109 | ················//·Deep·compare·each·member | ||
110 | ················key·=·_keys[length]; | ||
111 | ················if·(!(_has(b,·key)·&&·eq(a[key],·b[key],·aStack,·bStack)))·return·false; | ||
112 | ············} | ||
Max diff block lines reached; 6/6924 bytes (0.09%) of diff not shown. |
Offset 1, 7 lines modified | Offset 1, 7 lines modified | ||
1 | define(['./index29'],·(function(_tagTester)·{ | 1 | define(['./index29'],·(function(_tagTester)·{ |
2 | ····var·is | 2 | ····var·isDate·=·_tagTester('Date'); |
3 | ····return·is | 3 | ····return·isDate; |
4 | })); | 4 | })); |
Offset 1, 10 lines modified | Offset 1, 10 lines modified | ||
1 | define( | 1 | define((function()·{ |
2 | ····//·Is·a·given· | 2 | ····//·Is·a·given·value·a·DOM·element? |
3 | ····function·is | 3 | ····function·isElement(obj)·{ |
4 | ········return·! | 4 | ········return·!!(obj·&&·obj.nodeType·===·1); |
5 | ····} | 5 | ····} |
6 | ····return·is | 6 | ····return·isElement; |
7 | })); | 7 | })); |
Offset 1, 18 lines modified | Offset 1, 18 lines modified | ||
1 | define(['./index | 1 | define(['./index17',·'./index78',·'./index97',·'./index77',·'./index149'],·(function(_getLength,·isArray,·isString,·isArguments,·keys)·{ |
2 | ····var·isFunction·=·_tagTester('Function'); | ||
3 | ····//·Optimize·`isFunction`·if·appropriate.·Work·around·some·`typeof`·bugs·in·old | ||
4 | ····//·v8,·IE·11·(#1621),·Safari·8·(#1929),·and·PhantomJS·(#2236). | ||
5 | ····var·nodelist·=·_setup.root.document·&&·_setup.root.document.childNodes; | ||
6 | ····if·(typeof·/./·!=·'function'·&&·typeof·Int8Array·!=·'object'·&&·typeof·nodelist·!=·'function')·{ | ||
7 | ········isFunction·=·function(obj)·{ | ||
8 | ············return·typeof·obj·==·'function'·||·false; | ||
9 | ········ | 2 | ····//·Is·a·given·array,·string,·or·object·empty? |
3 | ····//·An·"empty"·object·has·no·enumerable·own-properties. | ||
4 | ····function·isEmpty(obj)·{ | ||
5 | ········if·(obj·==·null)·return·true; | ||
6 | ········//·Skip·the·more·expensive·`toString`-based·type·checks·if·`obj`·has·no | ||
7 | ········//·`.length`. | ||
8 | ········var·length·=·_getLength(obj); | ||
9 | ········if·(typeof·length·==·'number'·&&·( | ||
10 | ················isArray(obj)·||·isString(obj)·||·isArguments(obj) | ||
11 | ············))·return·length·===·0; | ||
12 | ········return·_getLength(keys(obj))·===·0; | ||
10 | ····} | 13 | ····} |
14 | ····return·isEmpty; | ||
11 | ····var·isFunction$1·=·isFunction; | ||
12 | ····return·isFunction$1; | ||
13 | })); | 15 | })); |
Offset 1, 7 lines modified | Offset 1, 135 lines modified | ||
1 | define(['./index29',·'./index28',·'./index | 1 | define(['./index150',·'./index26',·'./index16',·'./index99',·'./index88',·'./index28',·'./index81',·'./index149',·'./index19',·'./index30'],·(function(underscore,·_setup,·_getByteLength,·isTypedArray,·isFunction,·_stringTagBug,·isDataView,·keys,·_has,·_toBufferView)·{ |
2 | ···· | 2 | ····//·We·use·this·string·twice,·so·give·it·a·name·for·minification. |
3 | ····var·tagDataView·=·'[object·DataView]'; | ||
4 | ····//·Internal·recursive·comparison·function·for·`_.isEqual`. | ||
5 | ····function·eq(a,·b,·aStack,·bStack)·{ | ||
6 | ········//·Identical·objects·are·equal.·`0·===·-0`,·but·they·aren't·identical. | ||
7 | ········//·See·the·[Harmony·`egal`·proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). | ||
8 | ········if·(a·===·b)·return·a·!==·0·||·1·/·a·===·1·/·b; | ||
9 | ········//·`null`·or·`undefined`·only·equal·to·itself·(strict·comparison). | ||
10 | ········if·(a·==·null·||·b·==·null)·return·false; | ||
11 | ········//·`NaN`s·are·equivalent,·but·non-reflexive. | ||
12 | ········if·(a·!==·a)·return·b·!==·b; | ||
13 | ········//·Exhaust·primitive·checks | ||
14 | ········var·type·=·typeof·a; | ||
15 | ········if·(type·!==·'function'·&&·type·!==·'object'·&&·typeof·b·!=·'object')·return·false; | ||
16 | ········return·deepEq(a,·b,·aStack,·bStack); | ||
17 | ····} | ||
18 | ····//·Internal·recursive·comparison·function·for·`_.isEqual`. | ||
19 | ····function·deepEq(a,·b,·aStack,·bStack)·{ | ||
20 | ········//·Unwrap·any·wrapped·objects. | ||
21 | ········if·(a·instanceof·underscore)·a·=·a._wrapped; | ||
22 | ········if·(b·instanceof·underscore)·b·=·b._wrapped; | ||
23 | ········//·Compare·`[[Class]]`·names. | ||
24 | ········var·className·=·_setup.toString.call(a); | ||
25 | ········if·(className·!==·_setup.toString.call(b))·return·false; | ||
26 | ········//·Work·around·a·bug·in·IE·10·-·Edge·13. | ||
27 | ········if·(_stringTagBug.hasStringTagBug·&&·className·==·'[object·Object]'·&&·isDataView(a))·{ | ||
28 | ············if·(!isDataView(b))·return·false; | ||
29 | ············className·=·tagDataView; | ||
30 | ········} | ||
31 | ········switch·(className)·{ | ||
32 | ············//·These·types·are·compared·by·value. | ||
33 | ············case·'[object·RegExp]': | ||
34 | ················//·RegExps·are·coerced·to·strings·for·comparison·(Note:·''·+·/a/i·===·'/a/i') | ||
35 | ············case·'[object·String]': | ||
36 | ················//·Primitives·and·their·corresponding·object·wrappers·are·equivalent;·thus,·`"5"`·is | ||
37 | ················//·equivalent·to·`new·String("5")`. | ||
38 | ················return·''·+·a·===·''·+·b; | ||
39 | ············case·'[object·Number]': | ||
40 | ················//·`NaN`s·are·equivalent,·but·non-reflexive. | ||
41 | ················//·Object(NaN)·is·equivalent·to·NaN. | ||
42 | ················if·(+a·!==·+a)·return·+b·!==·+b; | ||
43 | ················//·An·`egal`·comparison·is·performed·for·other·numeric·values. | ||
44 | ················return·+a·===·0·?·1·/·+a·===·1·/·b·:·+a·===·+b; | ||
45 | ············case·'[object·Date]': | ||
46 | ············case·'[object·Boolean]': | ||
47 | ················//·Coerce·dates·and·booleans·to·numeric·primitive·values.·Dates·are·compared·by·their | ||
48 | ················//·millisecond·representations.·Note·that·invalid·dates·with·millisecond·representations | ||
49 | ················//·of·`NaN`·are·not·equivalent. | ||
50 | ················return·+a·===·+b; | ||
51 | ············case·'[object·Symbol]': | ||
52 | ················return·_setup.SymbolProto.valueOf.call(a)·===·_setup.SymbolProto.valueOf.call(b); | ||
53 | ············case·'[object·ArrayBuffer]': | ||
54 | ············case·tagDataView: | ||
55 | ················//·Coerce·to·typed·array·so·we·can·fall·through. | ||
56 | ················return·deepEq(_toBufferView(a),·_toBufferView(b),·aStack,·bStack); | ||
57 | ········} | ||
58 | ········var·areArrays·=·className·===·'[object·Array]'; | ||
59 | ········if·(!areArrays·&&·isTypedArray(a))·{ | ||
60 | ············var·byteLength·=·_getByteLength(a); | ||
61 | ············if·(byteLength·!==·_getByteLength(b))·return·false; | ||
62 | ············if·(a.buffer·===·b.buffer·&&·a.byteOffset·===·b.byteOffset)·return·true; | ||
63 | ············areArrays·=·true; | ||
64 | ········} | ||
65 | ········if·(!areArrays)·{ | ||
66 | ············if·(typeof·a·!=·'object'·||·typeof·b·!=·'object')·return·false; | ||
67 | ············//·Objects·with·different·constructors·are·not·equivalent,·but·`Object`s·or·`Array`s | ||
68 | ············//·from·different·frames·are. | ||
69 | ············var·aCtor·=·a.constructor, | ||
70 | ················bCtor·=·b.constructor; | ||
71 | ············if·(aCtor·!==·bCtor·&&·!(isFunction(aCtor)·&&·aCtor·instanceof·aCtor·&& | ||
72 | ····················isFunction(bCtor)·&&·bCtor·instanceof·bCtor)·&& | ||
73 | ················('constructor'·in·a·&&·'constructor'·in·b))·{ | ||
74 | ················return·false; | ||
75 | ············} | ||
76 | ········} | ||
77 | ········//·Assume·equality·for·cyclic·structures.·The·algorithm·for·detecting·cyclic | ||
78 | ········//·structures·is·adapted·from·ES·5.1·section·15.12.3,·abstract·operation·`JO`. | ||
79 | ········//·Initializing·stack·of·traversed·objects. | ||
80 | ········//·It's·done·here·since·we·only·need·them·for·objects·and·arrays·comparison. | ||
81 | ········aStack·=·aStack·||·[]; | ||
82 | ········bStack·=·bStack·||·[]; | ||
83 | ········var·length·=·aStack.length; | ||
84 | ········while·(length--)·{ | ||
85 | ············//·Linear·search.·Performance·is·inversely·proportional·to·the·number·of | ||
86 | ············//·unique·nested·structures. | ||
87 | ············if·(aStack[length]·===·a)·return·bStack[length]·===·b; | ||
88 | ········} | ||
89 | ········//·Add·the·first·object·to·the·stack·of·traversed·objects. | ||
90 | ········aStack.push(a); | ||
91 | ········bStack.push(b); | ||
92 | ········//·Recursively·compare·objects·and·arrays. | ||
93 | ········if·(areArrays)·{ | ||
94 | ············//·Compare·array·lengths·to·determine·if·a·deep·comparison·is·necessary. | ||
95 | ············length·=·a.length; | ||
96 | ············if·(length·!==·b.length)·return·false; | ||
97 | ············//·Deep·compare·the·contents,·ignoring·non-numeric·properties. | ||
98 | ············while·(length--)·{ | ||
99 | ················if·(!eq(a[length],·b[length],·aStack,·bStack))·return·false; | ||
100 | ············} | ||
101 | ········}·else·{ | ||
102 | ············//·Deep·compare·objects. | ||
103 | ············var·_keys·=·keys(a), | ||
104 | ················key; | ||
105 | ············length·=·_keys.length; | ||
106 | ············//·Ensure·that·both·objects·contain·the·same·number·of·properties·before·comparing·deep·equality. | ||
107 | ············if·(keys(b).length·!==·length)·return·false; | ||
108 | ············while·(length--)·{ | ||
109 | ················//·Deep·compare·each·member | ||
110 | ················key·=·_keys[length]; | ||
111 | ················if·(!(_has(b,·key)·&&·eq(a[key],·b[key],·aStack,·bStack)))·return·false; | ||
112 | ············} | ||
113 | ········} | ||
114 | ········//·Remove·the·first·object·from·the·stack·of·traversed·objects. | ||
115 | ········aStack.pop(); | ||
116 | ········bStack.pop(); | ||
117 | ········return·true; | ||
118 | ····} | ||
Max diff block lines reached; 6/6655 bytes (0.09%) of diff not shown. |
Offset 1, 18 lines modified | Offset 1, 7 lines modified | ||
1 | define(['./index | 1 | define(['./index29'],·(function(_tagTester)·{ |
2 | ····var·isError·=·_tagTester('Error'); | ||
2 | ····//·Returns·whether·an·object·has·a·given·set·of·`key:value`·pairs. | ||
3 | ····function·isMatch(object,·attrs)·{ | ||
4 | ········var·_keys·=·keys(attrs), | ||
5 | ············length·=·_keys.length; | ||
6 | ········if·(object·==·null)·return·!length; | ||
7 | ········var·obj·=·Object(object); | ||
8 | ········for·(var·i·=·0;·i·<·length;·i++)·{ | ||
9 | ············var·key·=·_keys[i]; | ||
10 | ············if·(attrs[key]·!==·obj[key]·||·!(key·in·obj))·return·false; | ||
11 | ········} | ||
12 | ········return·true; | ||
13 | ····} | ||
14 | ····return·is | 3 | ····return·isError; |
15 | })); | 4 | })); |
Offset 1, 10 lines modified | Offset 1, 10 lines modified | ||
1 | define(['./index26',·'./index | 1 | define(['./index26',·'./index98'],·(function(_setup,·isSymbol)·{ |
2 | ····//·Is· | 2 | ····//·Is·a·given·object·a·finite·number? |
3 | ····function·is | 3 | ····function·isFinite(obj)·{ |
4 | ········return·is | 4 | ········return·!isSymbol(obj)·&&·_setup._isFinite(obj)·&&·!isNaN(parseFloat(obj)); |
5 | ····} | 5 | ····} |
6 | ····return·is | 6 | ····return·isFinite; |
7 | })); | 7 | })); |
Offset 1, 10 lines modified | Offset 1, 18 lines modified | ||
1 | define((function()·{ | 1 | define(['./index29',·'./index26'],·(function(_tagTester,·_setup)·{ |
2 | ····//·Is·a·given·value·equal·to·null? | ||
3 | ····function·isNull(obj)·{ | ||
4 | ····· | 2 | ····var·isFunction·=·_tagTester('Function'); |
3 | ····//·Optimize·`isFunction`·if·appropriate.·Work·around·some·`typeof`·bugs·in·old | ||
4 | ····//·v8,·IE·11·(#1621),·Safari·8·(#1929),·and·PhantomJS·(#2236). | ||
5 | ····var·nodelist·=·_setup.root.document·&&·_setup.root.document.childNodes; | ||
6 | ····if·(typeof·/./·!=·'function'·&&·typeof·Int8Array·!=·'object'·&&·typeof·nodelist·!=·'function')·{ | ||
7 | ········isFunction·=·function(obj)·{ | ||
8 | ············return·typeof·obj·==·'function'·||·false; | ||
9 | ········}; | ||
5 | ····} | 10 | ····} |
6 | ····r | 11 | ····var·isFunction$1·=·isFunction; |
12 | ····return·isFunction$1; | ||
7 | })); | 13 | })); |
Offset 1, 7 lines modified | Offset 1, 7 lines modified | ||
1 | define(['./index29'],·(function(_tagTester)·{ | 1 | define(['./index29',·'./index28',·'./index24'],·(function(_tagTester,·_stringTagBug,·_methodFingerprint)·{ |
2 | ····var·is | 2 | ····var·isMap·=·_stringTagBug.isIE11·?·_methodFingerprint.ie11fingerprint(_methodFingerprint.mapMethods)·:·_tagTester('Map'); |
3 | ····return·is | 3 | ····return·isMap; |
4 | })); | 4 | })); |
Offset 1, 11 lines modified | Offset 1, 18 lines modified | ||
1 | define((function()·{ | 1 | define(['./index149'],·(function(keys)·{ |
2 | ····//·Is·a·given·variable·an·object? | ||
3 | ····function·isObject(obj)·{ | ||
4 | ········var·type·=·typeof·obj; | ||
5 | ···· | 2 | ····//·Returns·whether·an·object·has·a·given·set·of·`key:value`·pairs. |
3 | ····function·isMatch(object,·attrs)·{ | ||
4 | ········var·_keys·=·keys(attrs), | ||
5 | ············length·=·_keys.length; | ||
6 | ········if·(object·==·null)·return·!length; | ||
7 | ········var·obj·=·Object(object); | ||
8 | ········for·(var·i·=·0;·i·<·length;·i++)·{ | ||
9 | ············var·key·=·_keys[i]; | ||
10 | ············if·(attrs[key]·!==·obj[key]·||·!(key·in·obj))·return·false; | ||
11 | ········} | ||
12 | ········return·true; | ||
6 | ····} | 13 | ····} |
7 | ····return·is | 14 | ····return·isMatch; |
8 | })); | 15 | })); |
Offset 1, 7 lines modified | Offset 1, 10 lines modified | ||
1 | define(['./index29'],·(function(_t | 1 | define(['./index26',·'./index93'],·(function(_setup,·isNumber)·{ |
2 | ···· | 2 | ····//·Is·the·given·value·`NaN`? |
3 | ····function·isNaN(obj)·{ | ||
4 | ········return·isNumber(obj)·&&·_setup._isNaN(obj); | ||
5 | ····} | ||
3 | ····return·is | 6 | ····return·isNaN; |
4 | })); | 7 | })); |
Offset 1, 7 lines modified | Offset 1, 10 lines modified | ||
1 | define( | 1 | define((function()·{ |
2 | ···· | 2 | ····//·Is·a·given·value·equal·to·null? |
3 | ····function·isNull(obj)·{ | ||
4 | ········return·obj·===·null; | ||
5 | ····} | ||
3 | ····return·is | 6 | ····return·isNull; |
4 | })); | 7 | })); |
Offset 1, 7 lines modified | Offset 1, 7 lines modified | ||
1 | define(['./index29'],·(function(_tagTester)·{ | 1 | define(['./index29'],·(function(_tagTester)·{ |
2 | ····var·is | 2 | ····var·isNumber·=·_tagTester('Number'); |
3 | ····return·is | 3 | ····return·isNumber; |
4 | })); | 4 | })); |
Offset 1, 7 lines modified | Offset 1, 11 lines modified | ||
1 | define( | 1 | define((function()·{ |
2 | ···· | 2 | ····//·Is·a·given·variable·an·object? |
3 | ····function·isObject(obj)·{ | ||
4 | ········var·type·=·typeof·obj; | ||
5 | ········return·type·===·'function'·||·(type·===·'object'·&&·!!obj); | ||
6 | ····} | ||
3 | ····return·is | 7 | ····return·isObject; |
4 | })); | 8 | })); |
Offset 1, 17 lines modified | Offset 1, 7 lines modified | ||
1 | define(['./index2 | 1 | define(['./index29'],·(function(_tagTester)·{ |
2 | ····var·isRegExp·=·_tagTester('RegExp'); | ||
2 | ····//·Is·a·given·value·a·typed·array? | ||
3 | ····var·typedArrayPattern·=·/\[object·((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; | ||
3 | ····return·isRegExp; | ||
4 | ····function·isTypedArray(obj)·{ | ||
5 | ········//·`ArrayBuffer.isView`·is·the·most·future-proof,·so·use·it·when·available. | ||
6 | ········//·Otherwise,·fall·back·on·the·above·regular·expression. | ||
7 | ········return·_setup.nativeIsView·?·(_setup.nativeIsView(obj)·&&·!isDataView(obj))·: | ||
8 | ············_isBufferLike(obj)·&&·typedArrayPattern.test(_setup.toString.call(obj)); | ||
9 | ····} | ||
10 | ····var·isTypedArray$1·=·_setup.supportsArrayBuffer·?·isTypedArray·:·constant(false); | ||
11 | ····return·isTypedArray$1; | ||
12 | })); | 4 | })); |
Offset 1, 10 lines modified | Offset 1, 7 lines modified | ||
1 | define((function()·{ | 1 | define(['./index29',·'./index28',·'./index24'],·(function(_tagTester,·_stringTagBug,·_methodFingerprint)·{ |
2 | ····var·isSet·=·_stringTagBug.isIE11·?·_methodFingerprint.ie11fingerprint(_methodFingerprint.setMethods)·:·_tagTester('Set'); | ||
2 | ····//·Is·a·given·variable·undefined? | ||
3 | ····function·isUndefined(obj)·{ | ||
4 | ········return·obj·===·void·0; | ||
5 | ····} | ||
6 | ····return·is | 3 | ····return·isSet; |
7 | })); | 4 | })); |
Offset 1, 7 lines modified | Offset 1, 7 lines modified | ||
1 | define(['./index29' | 1 | define(['./index29'],·(function(_tagTester)·{ |
2 | ····var·is | 2 | ····var·isString·=·_tagTester('String'); |
3 | ····return·is | 3 | ····return·isString; |
4 | })); | 4 | })); |
Offset 1, 7 lines modified | Offset 1, 7 lines modified | ||
1 | define(['./index29'],·(function(_tagTester)·{ | 1 | define(['./index29'],·(function(_tagTester)·{ |
2 | ····var·is | 2 | ····var·isSymbol·=·_tagTester('Symbol'); |
3 | ····return·is | 3 | ····return·isSymbol; |
4 | })); | 4 | })); |
Offset 1, 13 lines modified | Offset 1, 17 lines modified | ||
1 | define(['./index14 | 1 | define(['./index26',·'./index81',·'./index43',·'./index22'],·(function(_setup,·isDataView,·constant,·_isBufferLike)·{ |
2 | ····//·External·wrapper·for·our·callback·generator.·Users·may·customize | ||
3 | ····//·`_.iteratee`·if·they·want·additional·predicate/iteratee·shorthand·styles. | ||
4 | ····//·This·abstraction·hides·the·internal-only·`argCount`·argument. | ||
5 | ····function·iteratee(value,·context)·{ | ||
6 | ···· | 2 | ····//·Is·a·given·value·a·typed·array? |
3 | ····var·typedArrayPattern·=·/\[object·((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; | ||
4 | ····function·isTypedArray(obj)·{ | ||
5 | ········//·`ArrayBuffer.isView`·is·the·most·future-proof,·so·use·it·when·available. | ||
6 | ········//·Otherwise,·fall·back·on·the·above·regular·expression. | ||
7 | ········return·_setup.nativeIsView·?·(_setup.nativeIsView(obj)·&&·!isDataView(obj))·: | ||
8 | ············_isBufferLike(obj)·&&·typedArrayPattern.test(_setup.toString.call(obj)); | ||
7 | ····} | 9 | ····} |
8 | ····underscore.iteratee·=·iteratee; | ||
9 | ····retur | 10 | ····var·isTypedArray$1·=·_setup.supportsArrayBuffer·?·isTypedArray·:·constant(false); |
11 | ····return·isTypedArray$1; | ||
10 | })); | 12 | })); |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | var·isObject·=·require('./index9 | 1 | var·isObject·=·require('./index94.js'); |
2 | var·_setup·=·require('./index26.js'); | 2 | var·_setup·=·require('./index26.js'); |
3 | //·Create·a·naked·function·reference·for·surrogate-prototype-swapping. | 3 | //·Create·a·naked·function·reference·for·surrogate-prototype-swapping. |
4 | function·ctor()·{ | 4 | function·ctor()·{ |
5 | ····return·function()·{}; | 5 | ····return·function()·{}; |
6 | } | 6 | } |
Offset 1, 9 lines modified | Offset 1, 9 lines modified | ||
1 | var·_isArrayLike·=·require('./index21.js'); | 1 | var·_isArrayLike·=·require('./index21.js'); |
2 | var·keys·=·require('./index1 | 2 | var·keys·=·require('./index149.js'); |
3 | var·_optimizeCb·=·require('./index25.js'); | 3 | var·_optimizeCb·=·require('./index25.js'); |
4 | //·Internal·helper·to·create·a·reducing·function,·iterating·left·or·right. | 4 | //·Internal·helper·to·create·a·reducing·function,·iterating·left·or·right. |
5 | function·createReduce(dir)·{ | 5 | function·createReduce(dir)·{ |
6 | ····//·Wrap·code·that·reassigns·argument·variables·in·a·separate·function·than | 6 | ····//·Wrap·code·that·reassigns·argument·variables·in·a·separate·function·than |
7 | ····//·the·one·that·accesses·`arguments.length`·to·avoid·a·perf·hit.·(#1991) | 7 | ····//·the·one·that·accesses·`arguments.length`·to·avoid·a·perf·hit.·(#1991) |
8 | ····var·reducer·=·function(obj,·iteratee,·memo,·initial)·{ | 8 | ····var·reducer·=·function(obj,·iteratee,·memo,·initial)·{ |
Offset 1, 19 lines modified | Offset 1, 6 lines modified | ||
1 | //·Is·a·given·variable·undefined? | ||
2 | function·isUndefined(obj)·{ | ||
3 | ····return·obj·===·void·0; | ||
1 | var·isObject·=·require('./index90.js'); | ||
2 | var·_setup·=·require('./index26.js'); | ||
3 | var·_has·=·require('./index19.js'); | ||
4 | var·_collectNonEnumProps·=·require('./index5.js'); | ||
5 | //·Retrieve·the·names·of·an·object's·own·properties. | ||
6 | //·Delegates·to·**ECMAScript·5**'s·native·`Object.keys`. | ||
7 | function·keys(obj)·{ | ||
8 | ····if·(!isObject(obj))·return·[]; | ||
9 | ····if·(_setup.nativeKeys)·return·_setup.nativeKeys(obj); | ||
10 | ····var·keys·=·[]; | ||
11 | ····for·(var·key·in·obj) | ||
12 | ········if·(_has(obj,·key))·keys.push(key); | ||
13 | ····//·Ahem,·IE·<·9. | ||
14 | ····if·(_setup.hasEnumBug)·_collectNonEnumProps(obj,·keys); | ||
15 | ····return·keys; | ||
16 | } | 4 | } |
17 | module.exports·=· | 5 | module.exports·=·isUndefined; |
Offset 1, 11 lines modified | Offset 1, 5 lines modified | ||
1 | var· | 1 | var·_tagTester·=·require('./index29.js'); |
2 | var·isWeakSet·=·_tagTester('WeakSet'); | ||
2 | //·Get·the·last·element·of·an·array.·Passing·**n**·will·return·the·last·N | ||
3 | //·values·in·the·array. | ||
4 | function·last(array,·n,·guard)·{ | ||
5 | ····if·(array·==·null·||·array.length·<·1)·return·n·==·null·||·guard·?·void·0·:·[]; | ||
6 | ····if·(n·==·null·||·guard)·return·array[array.length·-·1]; | ||
7 | ····return·rest(array,·Math.max(0,·array.length·-·n)); | ||
8 | } | ||
9 | module.exports·=· | 3 | module.exports·=·isWeakSet; |
Offset 1, 8 lines modified | Offset 1, 12 lines modified | ||
1 | var· | 1 | var·underscore·=·require('./index150.js'); |
2 | var·_ | 2 | var·_baseIteratee·=·require('./index2.js'); |
3 | //·Return·the·position·of·the·last·occurrence·of·an·item·in·an·array, | ||
4 | //·or·-1·if·the·item·is·not·included·in·the·array. | ||
5 | 3 | //·External·wrapper·for·our·callback·generator.·Users·may·customize | |
4 | //·`_.iteratee`·if·they·want·additional·predicate/iteratee·shorthand·styles. | ||
5 | //·This·abstraction·hides·the·internal-only·`argCount`·argument. | ||
6 | function·iteratee(value,·context)·{ | ||
7 | ····return·_baseIteratee(value,·context,·Infinity); | ||
8 | } | ||
9 | underscore.iteratee·=·iteratee; | ||
6 | module.exports·=· | 10 | module.exports·=·iteratee; |
Offset 1, 18 lines modified | Offset 1, 7 lines modified | ||
1 | var·_ | 1 | var·_tagTester·=·require('./index29.js'); |
2 | var·_stringTagBug·=·require('./index28.js'); | ||
2 | var·_i | 3 | var·_methodFingerprint·=·require('./index24.js'); |
3 | var·keys·=·require('./index100.js'); | ||
4 | var·isWeakMap·=·_stringTagBug.isIE11·?·_methodFingerprint.ie11fingerprint(_methodFingerprint.weakMapMethods)·:·_tagTester('WeakMap'); | ||
4 | //·Return·the·results·of·applying·the·iteratee·to·each·element. | ||
5 | function·map(obj,·iteratee,·context)·{ | ||
6 | ····iteratee·=·_cb(iteratee,·context); | ||
7 | ····var·_keys·=·!_isArrayLike(obj)·&&·keys(obj), | ||
8 | ········length·=·(_keys·||·obj).length, | ||
9 | ········results·=·Array(length); | ||
10 | ····for·(var·index·=·0;·index·<·length;·index++)·{ | ||
11 | ········var·currentKey·=·_keys·?·_keys[index]·:·index; | ||
12 | ········results[index]·=·iteratee(obj[currentKey],·currentKey,·obj); | ||
13 | ····} | ||
14 | ····return·results; | ||
15 | } | ||
16 | module.exports·=· | 5 | module.exports·=·isWeakMap; |
Offset 1, 18 lines modified | Offset 1, 11 lines modified | ||
1 | var·_cb·=·require('./index3.js'); | ||
2 | var· | 1 | var·rest·=·require('./index132.js'); |
2 | //·Get·the·last·element·of·an·array.·Passing·**n**·will·return·the·last·N | ||
3 | //·values·in·the·array. | ||
4 | function·last(array,·n,·guard)·{ | ||
5 | ····if·(array·==·null·||·array.length·<·1)·return·n·==·null·||·guard·?·void·0·:·[]; | ||
6 | ····if·(n·==·null·||·guard)·return·array[array.length·-·1]; | ||
7 | ····return·rest(array,·Math.max(0,·array.length·-·n)); | ||
3 | //·Returns·the·results·of·applying·the·`iteratee`·to·each·element·of·`obj`. | ||
4 | //·In·contrast·to·`_.map`·it·returns·an·object. | ||
5 | function·mapObject(obj,·iteratee,·context)·{ | ||
6 | ····iteratee·=·_cb(iteratee,·context); | ||
7 | ····var·_keys·=·keys(obj), | ||
8 | ········length·=·_keys.length, | ||
9 | ········results·=·{}; | ||
10 | ····for·(var·index·=·0;·index·<·length;·index++)·{ | ||
11 | ········var·currentKey·=·_keys[index]; | ||
12 | ········results[currentKey]·=·iteratee(obj[currentKey],·currentKey,·obj); | ||
13 | ····} | ||
14 | ····return·results; | ||
15 | } | 8 | } |
16 | module.exports·=· | 9 | module.exports·=·last; |
Offset 1, 13 lines modified | Offset 1, 42 lines modified | ||
1 | var·restArguments·=·require('./index133.js'); | ||
1 | var· | 2 | var·now·=·require('./index116.js'); |
2 | var·isMatch·=·require('./index86.js'); | ||
3 | //·Returns·a·predicate·for·checking·whether·an·object·has·a·given·set·of | ||
4 | //·`key:value`·pairs. | ||
5 | function·matcher(attrs)·{ | ||
6 | ····attrs·=·extendOwn({},·attrs); | ||
7 | ····return·function(obj)·{ | ||
8 | ········return· | 3 | //·When·a·sequence·of·calls·of·the·returned·function·ends,·the·argument |
4 | //·function·is·triggered.·The·end·of·a·sequence·is·defined·by·the·`wait` | ||
5 | //·parameter.·If·`immediate`·is·passed,·the·argument·function·will·be | ||
6 | //·triggered·at·the·beginning·of·the·sequence·instead·of·at·the·end. | ||
7 | function·debounce(func,·wait,·immediate)·{ | ||
8 | ····var·timeout,·previous,·args,·result,·context; | ||
9 | ····var·later·=·function()·{ | ||
10 | ········var·passed·=·now()·-·previous; | ||
11 | ········if·(wait·>·passed)·{ | ||
12 | ············timeout·=·setTimeout(later,·wait·-·passed); | ||
13 | ········}·else·{ | ||
14 | ············timeout·=·null; | ||
15 | ············if·(!immediate)·result·=·func.apply(context,·args); | ||
16 | ············//·This·check·is·needed·because·`func`·can·recursively·invoke·`debounced`. | ||
17 | ············if·(!timeout)·args·=·context·=·null; | ||
18 | ········} | ||
9 | ····}; | 19 | ····}; |
20 | ····var·debounced·=·restArguments(function(_args)·{ | ||
21 | ········context·=·this; | ||
22 | ········args·=·_args; | ||
23 | ········previous·=·now(); | ||
24 | ········if·(!timeout)·{ | ||
25 | ············timeout·=·setTimeout(later,·wait); | ||
26 | ············if·(immediate)·result·=·func.apply(context,·args); | ||
27 | ········} | ||
28 | ········return·result; | ||
29 | ····}); | ||
30 | ····debounced.cancel·=·function()·{ | ||
31 | ········clearTimeout(timeout); | ||
32 | ········timeout·=·args·=·context·=·null; | ||
33 | ····}; | ||
34 | ····return·debounced; | ||
10 | } | 35 | } |
11 | module.exports·=· | 36 | module.exports·=·debounce; |
Offset 1, 32 lines modified | Offset 1, 8 lines modified | ||
1 | var·_isArrayLike·=·require('./index21.js'); | ||
2 | var· | 1 | var·findLastIndex·=·require('./index60.js'); |
3 | var·_c | 2 | var·_createIndexFinder·=·require('./index8.js'); |
4 | var·each·=·require('./index51.js'); | ||
3 | //·Return·the·position·of·the·last·occurrence·of·an·item·in·an·array, | ||
4 | //·or·-1·if·the·item·is·not·included·in·the·array. | ||
5 | var·lastIndexOf·=·_createIndexFinder(-1,·findLastIndex); | ||
5 | //·Return·the·maximum·element·(or·element-based·computation). | ||
6 | function·max(obj,·iteratee,·context)·{ | ||
7 | ····var·result·=·-Infinity, | ||
8 | ········lastComputed·=·-Infinity, | ||
9 | ········value,·computed; | ||
10 | ····if·(iteratee·==·null·||·(typeof·iteratee·==·'number'·&&·typeof·obj[0]·!=·'object'·&&·obj·!=·null))·{ | ||
11 | ········obj·=·_isArrayLike(obj)·?·obj·:·values(obj); | ||
12 | ········for·(var·i·=·0,·length·=·obj.length;·i·<·length;·i++)·{ | ||
13 | ············value·=·obj[i]; | ||
14 | ············if·(value·!=·null·&&·value·>·result)·{ | ||
15 | ················result·=·value; | ||
16 | ············} | ||
17 | ········} | ||
18 | ····}·else·{ | ||
19 | ········iteratee·=·_cb(iteratee,·context); | ||
20 | ········each(obj,·function(v,·index,·list)·{ | ||
21 | ············computed·=·iteratee(v,·index,·list); | ||
22 | ············if·(computed·>·lastComputed·||·(computed·===·-Infinity·&&·result·===·-Infinity))·{ | ||
23 | ················result·=·v; | ||
24 | ················lastComputed·=·computed; | ||
25 | ············} | ||
26 | ········}); | ||
27 | ····} | ||
28 | ····return·result; | ||
29 | } | ||
30 | module.exports·=· | 6 | module.exports·=·lastIndexOf; |
Offset 1, 15 lines modified | Offset 1, 18 lines modified | ||
1 | var·_cb·=·require('./index3.js'); | ||
2 | var·_isArrayLike·=·require('./index21.js'); | ||
1 | var· | 3 | var·keys·=·require('./index149.js'); |
2 | //·Memoize·an·expensive·function·by·storing·its·results. | ||
3 | function·memoize(func,·hasher)·{ | ||
4 | ····var·memoize·=·function(key)·{ | ||
5 | ········var·cache·=·memoize.cache; | ||
6 | ········var·address·=·''·+·(hasher·?·hasher.apply(this,·arguments)·:·key); | ||
7 | ········if·(!_has(cache,·address))·cache[address]·=·func.apply(this,·arguments); | ||
8 | · | 4 | //·Return·the·results·of·applying·the·iteratee·to·each·element. |
5 | function·map(obj,·iteratee,·context)·{ | ||
6 | ····iteratee·=·_cb(iteratee,·context); | ||
7 | ····var·_keys·=·!_isArrayLike(obj)·&&·keys(obj), | ||
8 | ········length·=·(_keys·||·obj).length, | ||
9 | ········results·=·Array(length); | ||
10 | ····for·(var·index·=·0;·index·<·length;·index++)·{ | ||
11 | ········var·currentKey·=·_keys·?·_keys[index]·:·index; | ||
12 | ········results[index]·=·iteratee(obj[currentKey],·currentKey,·obj); | ||
9 | ····} | 13 | ····} |
14 | ····return·results; | ||
10 | ····memoize.cache·=·{}; | ||
11 | ····return·memoize; | ||
12 | } | 15 | } |
13 | module.exports·=·m | 16 | module.exports·=·map; |
Offset 1, 32 lines modified | Offset 1, 18 lines modified | ||
1 | var·_isArrayLike·=·require('./index21.js'); | ||
2 | var·values·=·require('./index154.js'); | ||
3 | var·_cb·=·require('./index3.js'); | 1 | var·_cb·=·require('./index3.js'); |
4 | var· | 2 | var·keys·=·require('./index149.js'); |
5 | //·Return·the· | 3 | //·Returns·the·results·of·applying·the·`iteratee`·to·each·element·of·`obj`. |
4 | //·In·contrast·to·`_.map`·it·returns·an·object. | ||
6 | function·m | 5 | function·mapObject(obj,·iteratee,·context)·{ |
7 | ····var·result·=·Infinity, | ||
8 | ········lastComputed·=·Infinity, | ||
9 | ········value,·computed; | ||
10 | ····if·(iteratee·==·null·||·(typeof·iteratee·==·'number'·&&·typeof·obj[0]·!=·'object'·&&·obj·!=·null))·{ | ||
11 | ········obj·=·_isArrayLike(obj)·?·obj·:·values(obj); | ||
12 | ········for·(var·i·=·0,·length·=·obj.length;·i·<·length;·i++)·{ | ||
13 | ············value·=·obj[i]; | ||
14 | ············if·(value·!=·null·&&·value·<·result)·{ | ||
15 | ················result·=·value; | ||
16 | ············} | ||
17 | ········} | ||
18 | ····}·else·{ | ||
19 | ···· | 6 | ····iteratee·=·_cb(iteratee,·context); |
7 | ····var·_keys·=·keys(obj), | ||
8 | ········length·=·_keys.length, | ||
20 | ········each(obj,·function(v,·index,·list)·{ | ||
21 | ············computed·=·iteratee(v,·index,·list); | ||
22 | ············if·(computed·<·lastComputed·||·(computed·===·Infinity·&&·result·===·Infinity))·{ | ||
23 | ········ | 9 | ········results·=·{}; |
24 | ················lastComputed·=·computed; | ||
25 | ············} | ||
26 | ········ | 10 | ····for·(var·index·=·0;·index·<·length;·index++)·{ |
11 | ········var·currentKey·=·_keys[index]; | ||
12 | ········results[currentKey]·=·iteratee(obj[currentKey],·currentKey,·obj); | ||
27 | ····} | 13 | ····} |
28 | ····return·result; | 14 | ····return·results; |
29 | } | 15 | } |
30 | module.exports·=·m | 16 | module.exports·=·mapObject; |
Offset 1, 20 lines modified | Offset 1, 32 lines modified | ||
1 | var·_isArrayLike·=·require('./index21.js'); | ||
1 | var· | 2 | var·values·=·require('./index155.js'); |
3 | var·_cb·=·require('./index3.js'); | ||
2 | var·each·=·require('./index51.js'); | 4 | var·each·=·require('./index51.js'); |
3 | var·functions·=·require('./index129.js'); | ||
4 | var·_setup·=·require('./index26.js'); | ||
5 | var·_chainResult·=·require('./index4.js'); | ||
6 | //·Add·your·own·custom·functions·to·the·Underscore·object. | ||
7 | function·mixin(obj)·{ | ||
8 | ····each(functions(obj),·function(name)·{ | ||
9 | ········var·func·=·underscore[name]·=·obj[name]; | ||
10 | ········underscore.prototype[name]·=·function()·{ | ||
11 | ············var·args·=·[this._wrapped]; | ||
12 | ············_setup.push.apply(args,·arguments); | ||
13 | 5 | //·Return·the·maximum·element·(or·element-based·computation). | |
6 | function·max(obj,·iteratee,·context)·{ | ||
7 | ····var·result·=·-Infinity, | ||
8 | ········lastComputed·=·-Infinity, | ||
9 | ········value,·computed; | ||
10 | ····if·(iteratee·==·null·||·(typeof·iteratee·==·'number'·&&·typeof·obj[0]·!=·'object'·&&·obj·!=·null))·{ | ||
11 | ········obj·=·_isArrayLike(obj)·?·obj·:·values(obj); | ||
12 | ········for·(var·i·=·0,·length·=·obj.length;·i·<·length;·i++)·{ | ||
13 | ············value·=·obj[i]; | ||
14 | ············if·(value·!=·null·&&·value·>·result)·{ | ||
15 | ················result·=·value; | ||
16 | ············} | ||
17 | ········} | ||
18 | ····}·else·{ | ||
19 | ········iteratee·=·_cb(iteratee,·context); | ||
20 | ········each(obj,·function(v,·index,·list)·{ | ||
21 | ············computed·=·iteratee(v,·index,·list); | ||
22 | ············if·(computed·>·lastComputed·||·(computed·===·-Infinity·&&·result·===·-Infinity))·{ | ||
23 | ················result·=·v; | ||
24 | ················lastComputed·=·computed; | ||
25 | ············} | ||
14 | ········}; | 26 | ········}); |
15 | ····} | 27 | ····} |
16 | ····return· | 28 | ····return·result; |
17 | } | 29 | } |
18 | module.exports·=·m | 30 | module.exports·=·max; |
Offset 1, 8 lines modified | Offset 1, 13 lines modified | ||
1 | //·Returns·a·negated·version·of·the·passed-in·predicate. | ||
2 | 1 | var·extendOwn·=·require('./index55.js'); | |
2 | var·isMatch·=·require('./index90.js'); | ||
3 | //·Returns·a·predicate·for·checking·whether·an·object·has·a·given·set·of | ||
4 | //·`key:value`·pairs. | ||
5 | function·matcher(attrs)·{ | ||
6 | ····attrs·=·extendOwn({},·attrs); | ||
3 | ····return·function()·{ | 7 | ····return·function(obj)·{ |
4 | ········return· | 8 | ········return·isMatch(obj,·attrs); |
5 | ····}; | 9 | ····}; |
6 | } | 10 | } |
7 | module.exports·=· | 11 | module.exports·=·matcher; |
Offset 1, 4 lines modified | Offset 1, 15 lines modified | ||
1 | var·_has·=·require('./index19.js'); | ||
1 | //·Predicate-generating·function.·Often·useful·outside·of·Underscore. | ||
2 | function·noop()·{} | ||
2 | //·Memoize·an·expensive·function·by·storing·its·results. | ||
3 | function·memoize(func,·hasher)·{ | ||
4 | ····var·memoize·=·function(key)·{ | ||
5 | ········var·cache·=·memoize.cache; | ||
6 | ········var·address·=·''·+·(hasher·?·hasher.apply(this,·arguments)·:·key); | ||
7 | ········if·(!_has(cache,·address))·cache[address]·=·func.apply(this,·arguments); | ||
8 | ········return·cache[address]; | ||
9 | ····}; | ||
10 | ····memoize.cache·=·{}; | ||
11 | ····return·memoize; | ||
12 | } | ||
3 | module.exports·=· | 13 | module.exports·=·memoize; |
Offset 1, 6 lines modified | Offset 1, 32 lines modified | ||
1 | //·A·(possibly·faster)·way·to·get·the·current·timestamp·as·an·integer. | ||
2 | var·now·=·Date.now·||·function()·{ | ||
3 | ····return·new·Date().getTime(); | ||
4 | 1 | var·_isArrayLike·=·require('./index21.js'); | |
2 | var·values·=·require('./index155.js'); | ||
3 | var·_cb·=·require('./index3.js'); | ||
4 | var·each·=·require('./index51.js'); | ||
5 | //·Return·the·minimum·element·(or·element-based·computation). | ||
6 | function·min(obj,·iteratee,·context)·{ | ||
7 | ····var·result·=·Infinity, | ||
8 | ········lastComputed·=·Infinity, | ||
9 | ········value,·computed; | ||
10 | ····if·(iteratee·==·null·||·(typeof·iteratee·==·'number'·&&·typeof·obj[0]·!=·'object'·&&·obj·!=·null))·{ | ||
11 | ········obj·=·_isArrayLike(obj)·?·obj·:·values(obj); | ||
12 | ········for·(var·i·=·0,·length·=·obj.length;·i·<·length;·i++)·{ | ||
13 | ············value·=·obj[i]; | ||
14 | ············if·(value·!=·null·&&·value·<·result)·{ | ||
15 | ················result·=·value; | ||
16 | ············} | ||
17 | ········} | ||
18 | ····}·else·{ | ||
19 | ········iteratee·=·_cb(iteratee,·context); | ||
20 | ········each(obj,·function(v,·index,·list)·{ | ||
21 | ············computed·=·iteratee(v,·index,·list); | ||
22 | ············if·(computed·<·lastComputed·||·(computed·===·Infinity·&&·result·===·Infinity))·{ | ||
23 | ················result·=·v; | ||
24 | ················lastComputed·=·computed; | ||
25 | ············} | ||
26 | ········}); | ||
27 | ····} | ||
28 | ····return·result; | ||
29 | } | ||
5 | module.exports·=· | 30 | module.exports·=·min; |
Offset 1, 18 lines modified | Offset 1, 20 lines modified | ||
1 | var·underscore·=·require('./index150.js'); | ||
1 | var· | 2 | var·each·=·require('./index51.js'); |
3 | var·functions·=·require('./index64.js'); | ||
4 | var·_setup·=·require('./index26.js'); | ||
5 | var·_chainResult·=·require('./index4.js'); | ||
6 | //·Add·your·own·custom·functions·to·the·Underscore·object. | ||
7 | function·mixin(obj)·{ | ||
8 | ····each(functions(obj),·function(name)·{ | ||
9 | ········var·func·=·underscore[name]·=·obj[name]; | ||
10 | ········underscore.prototype[name]·=·function()·{ | ||
11 | ············var·args·=·[this._wrapped]; | ||
12 | ············_setup.push.apply(args,·arguments); | ||
13 | ············return·_chainResult(this,·func.apply(underscore,·args)); | ||
2 | //·Converts·lists·into·objects.·Pass·either·a·single·array·of·`[key,·value]` | ||
3 | //·pairs,·or·two·parallel·arrays·of·the·same·length·--·one·of·keys,·and·one·of | ||
4 | //·the·corresponding·values.·Passing·by·pairs·is·the·reverse·of·`_.pairs`. | ||
5 | function·object(list,·values)·{ | ||
6 | ····var·result·=·{}; | ||
7 | ····for·(var·i·=·0,·length·=·_getLength(list);·i·<·length;·i++)·{ | ||
8 | ········if·(values)·{ | ||
9 | ············result[list[i]]·=·values[i]; | ||
10 | ········}·else·{ | ||
11 | ············result[list[i][0]]·=·list[i][1]; | ||
12 | ········} | 14 | ········}; |
13 | ····} | 15 | ····}); |
14 | ····return· | 16 | ····return·underscore; |
15 | } | 17 | } |
16 | module.exports·=· | 18 | module.exports·=·mixin; |
Offset 1, 25 lines modified | Offset 1, 8 lines modified | ||
1 | //·Returns·a·negated·version·of·the·passed-in·predicate. | ||
2 | function·negate(predicate)·{ | ||
3 | ····return·function()·{ | ||
4 | ········return·!predicate.apply(this,·arguments); | ||
5 | ····}; | ||
6 | } | ||
1 | var·restArguments·=·require('./index133.js'); | ||
2 | var·isFunction·=·require('./index84.js'); | ||
3 | var·negate·=·require('./index110.js'); | ||
4 | var·map·=·require('./index103.js'); | ||
5 | var·_flatten·=·require('./index15.js'); | ||
6 | var·contains·=·require('./index43.js'); | ||
7 | var·pick·=·require('./index119.js'); | ||
8 | //·Return·a·copy·of·the·object·without·the·disallowed·properties. | ||
9 | var·omit·=·restArguments(function(obj,·keys)·{ | ||
10 | ····var·iteratee·=·keys[0], | ||
11 | ········context; | ||
12 | ····if·(isFunction(iteratee))·{ | ||
13 | ········iteratee·=·negate(iteratee); | ||
14 | ········if·(keys.length·>·1)·context·=·keys[1]; | ||
15 | ····}·else·{ | ||
16 | ········keys·=·map(_flatten(keys,·false,·false),·String); | ||
17 | ········iteratee·=·function(value,·key)·{ | ||
18 | ············return·!contains(keys,·key); | ||
19 | ········}; | ||
20 | ····} | ||
21 | ····return·pick(obj,·iteratee,·context); | ||
22 | }); | ||
23 | module.exports·=· | 7 | module.exports·=·negate; |
Offset 1, 8 lines modified | Offset 1, 4 lines modified | ||
1 | var·partial·=·require('./index117.js'); | ||
2 | 1 | //·Predicate-generating·function.·Often·useful·outside·of·Underscore. | |
2 | function·noop()·{} | ||
3 | //·Returns·a·function·that·will·be·executed·at·most·one·time,·no·matter·how | ||
4 | //·often·you·call·it.·Useful·for·lazy·initialization. | ||
5 | var·once·=·partial(before,·2); | ||
6 | module.exports·=· | 3 | module.exports·=·noop; |
Offset 1, 15 lines modified | Offset 1, 6 lines modified | ||
1 | 1 | //·A·(possibly·faster)·way·to·get·the·current·timestamp·as·an·integer. | |
2 | var·now·=·Date.now·||·function()·{ | ||
3 | ····return·new·Date().getTime(); | ||
4 | }; | ||
2 | //·Convert·an·object·into·a·list·of·`[key,·value]`·pairs. | ||
3 | //·The·opposite·of·`_.object`·with·one·argument. | ||
4 | function·pairs(obj)·{ | ||
5 | ····var·_keys·=·keys(obj); | ||
6 | ····var·length·=·_keys.length; | ||
7 | ····var·pairs·=·Array(length); | ||
8 | ····for·(var·i·=·0;·i·<·length;·i++)·{ | ||
9 | ········pairs[i]·=·[_keys[i],·obj[_keys[i]]]; | ||
10 | ····} | ||
11 | ····return·pairs; | ||
12 | } | ||
13 | module.exports·=· | 5 | module.exports·=·now; |
Offset 1, 26 lines modified | Offset 1, 18 lines modified | ||
1 | var· | 1 | var·_getLength·=·require('./index17.js'); |
2 | var·_executeBound·=·require('./index14.js'); | ||
3 | var·underscore·=·require('./index149.js'); | ||
2 | //·Converts·lists·into·objects.·Pass·either·a·single·array·of·`[key,·value]` | ||
3 | //·pairs,·or·two·parallel·arrays·of·the·same·length·--·one·of·keys,·and·one·of | ||
4 | //·the·corresponding·values.·Passing·by·pairs·is·the·reverse·of·`_.pairs`. | ||
5 | function·object(list,·values)·{ | ||
6 | ····var·result·=·{}; | ||
7 | ····for·(var·i·=·0,·length·=·_getLength(list);·i·<·length;·i++)·{ | ||
8 | ········if·(values)·{ | ||
9 | ············result[list[i]]·=·values[i]; | ||
10 | ········}·else·{ | ||
11 | ············result[list[i][0]]·=·list[i][1]; | ||
4 | //·Partially·apply·a·function·by·creating·a·version·that·has·had·some·of·its | ||
5 | //·arguments·pre-filled,·without·changing·its·dynamic·`this`·context.·`_`·acts | ||
6 | //·as·a·placeholder·by·default,·allowing·any·combination·of·arguments·to·be | ||
7 | //·pre-filled.·Set·`_.partial.placeholder`·for·a·custom·placeholder·argument. | ||
8 | var·partial·=·restArguments(function(func,·boundArgs)·{ | ||
9 | ····var·placeholder·=·partial.placeholder; | ||
10 | ····var·bound·=·function()·{ | ||
11 | ········var·position·=·0, | ||
12 | ············length·=·boundArgs.length; | ||
13 | ········var·args·=·Array(length); | ||
14 | ········for·(var·i·=·0;·i·<·length;·i++)·{ | ||
15 | ············args[i]·=·boundArgs[i]·===·placeholder·?·arguments[position++]·:·boundArgs[i]; | ||
16 | ········} | 12 | ········} |
17 | ········while·(position·<·arguments.length)·args.push(arguments[position++]); | ||
18 | ········return·_executeBound(func,·bound,·this,·this,·args); | ||
19 | ····} | 13 | ····} |
20 | ····return·bound; | ||
21 | 14 | ····return·result; | |
15 | } | ||
22 | partial.placeholder·=·underscore; | ||
23 | module.exports·=· | 16 | module.exports·=·object; |
Offset 1, 9 lines modified | Offset 1, 25 lines modified | ||
1 | var·restArguments·=·require('./index133.js'); | ||
2 | var·isFunction·=·require('./index88.js'); | ||
3 | var·negate·=·require('./index114.js'); | ||
1 | var· | 4 | var·map·=·require('./index107.js'); |
5 | var·_flatten·=·require('./index15.js'); | ||
6 | var·contains·=·require('./index44.js'); | ||
7 | var·pick·=·require('./index123.js'); | ||
2 | //·Split·a·collection·into·two·arrays:·one·whose·elements·all·pass·the·given | ||
3 | //·truth·test,·and·one·whose·elements·all·do·not·pass·the·truth·test. | ||
4 | var·partition·=·_group(function(result,·value,·pass)·{ | ||
5 | ····result[pass·?·0·:·1].push(value); | ||
6 | 8 | //·Return·a·copy·of·the·object·without·the·disallowed·properties. | |
9 | var·omit·=·restArguments(function(obj,·keys)·{ | ||
10 | ····var·iteratee·=·keys[0], | ||
11 | ········context; | ||
12 | ····if·(isFunction(iteratee))·{ | ||
13 | ········iteratee·=·negate(iteratee); | ||
14 | ········if·(keys.length·>·1)·context·=·keys[1]; | ||
15 | ····}·else·{ | ||
16 | ········keys·=·map(_flatten(keys,·false,·false),·String); | ||
17 | ········iteratee·=·function(value,·key)·{ | ||
18 | ············return·!contains(keys,·key); | ||
19 | ········}; | ||
20 | ····} | ||
21 | ····return·pick(obj,·iteratee,·context); | ||
22 | }); | ||
7 | module.exports·=· | 23 | module.exports·=·omit; |
Offset 1, 29 lines modified | Offset 1, 8 lines modified | ||
1 | var·restArguments·=·require('./index133.js'); | ||
2 | var·isFunction·=·require('./index84.js'); | ||
3 | var· | 1 | var·partial·=·require('./index121.js'); |
4 | var·allKeys·=·require('./index34.js'); | ||
5 | var·_keyInObj·=·require('./index23.js'); | ||
6 | var· | 2 | var·before·=·require('./index35.js'); |
3 | //·Returns·a·function·that·will·be·executed·at·most·one·time,·no·matter·how | ||
4 | //·often·you·call·it.·Useful·for·lazy·initialization. | ||
5 | var·once·=·partial(before,·2); | ||
7 | //·Return·a·copy·of·the·object·only·containing·the·allowed·properties. | ||
8 | var·pick·=·restArguments(function(obj,·keys)·{ | ||
9 | ····var·result·=·{}, | ||
10 | ········iteratee·=·keys[0]; | ||
11 | ····if·(obj·==·null)·return·result; | ||
12 | ····if·(isFunction(iteratee))·{ | ||
13 | ········if·(keys.length·>·1)·iteratee·=·_optimizeCb(iteratee,·keys[1]); | ||
14 | ········keys·=·allKeys(obj); | ||
15 | ····}·else·{ | ||
16 | ········iteratee·=·_keyInObj; | ||
17 | ········keys·=·_flatten(keys,·false,·false); | ||
18 | ········obj·=·Object(obj); | ||
19 | ····} | ||
20 | ····for·(var·i·=·0,·length·=·keys.length;·i·<·length;·i++)·{ | ||
21 | ········var·key·=·keys[i]; | ||
22 | ········var·value·=·obj[key]; | ||
23 | ········if·(iteratee(value,·key,·obj))·result[key]·=·value; | ||
24 | ····} | ||
25 | ····return·result; | ||
26 | }); | ||
27 | module.exports·=· | 6 | module.exports·=·once; |
Offset 1, 11 lines modified | Offset 1, 11 lines modified | ||
1 | //·Internal·function·to·obtain·a·nested·property·in·`obj`·along·`path`. | ||
2 | function·deepGet(obj,·path)·{ | ||
3 | ····var·length·=·path.length; | ||
4 | ····for·(var·i·=·0;·i·<·length;·i++)·{ | ||
5 | ········if·(obj·==·null)·return·void·0; | ||
6 | ········obj·=·obj[path[i]]; | ||
7 | ····} | ||
8 | ····return·length·?·obj·:·void·0; | ||
9 | 1 | //·Internal·list·of·HTML·entities·for·escaping. | |
2 | var·escapeMap·=·{ | ||
3 | ····'&':·'&', | ||
4 | ····'<':·'<', | ||
5 | ····'>':·'>', | ||
6 | ····'"':·'"', | ||
7 | ····"'":·''', | ||
8 | ····'`':·'`' | ||
9 | }; | ||
10 | module.exports·=· | 10 | module.exports·=·escapeMap; |
Offset 1, 9 lines modified | Offset 1, 15 lines modified | ||
1 | var· | 1 | var·keys·=·require('./index149.js'); |
2 | var·property·=·require('./index121.js'); | ||
3 | //·Convenience·version·of·a·common·use·case·of·`_.map`:·fetching·a·property. | ||
4 | function·pluck(obj,·key)·{ | ||
5 | 2 | //·Convert·an·object·into·a·list·of·`[key,·value]`·pairs. | |
3 | //·The·opposite·of·`_.object`·with·one·argument. | ||
4 | function·pairs(obj)·{ | ||
5 | ····var·_keys·=·keys(obj); | ||
6 | ····var·length·=·_keys.length; | ||
7 | ····var·pairs·=·Array(length); | ||
8 | ····for·(var·i·=·0;·i·<·length;·i++)·{ | ||
9 | ········pairs[i]·=·[_keys[i],·obj[_keys[i]]]; | ||
10 | ····} | ||
11 | ····return·pairs; | ||
6 | } | 12 | } |
7 | module.exports·=·p | 13 | module.exports·=·pairs; |
Offset 1, 13 lines modified | Offset 1, 26 lines modified | ||
1 | var·restArguments·=·require('./index133.js'); | ||
2 | var·_executeBound·=·require('./index14.js'); | ||
1 | var· | 3 | var·underscore·=·require('./index150.js'); |
2 | var·_toPath·=·require('./index31.js'); | ||
3 | //·Creates·a·function·that,·when·passed·an·object,·will·traverse·that·object’s | ||
4 | //·properties·down·the·given·`path`,·specified·as·an·array·of·keys·or·indices. | ||
5 | function·property(path)·{ | ||
6 | ····path·=·_toPath(path); | ||
7 | ····return·function(obj)·{ | ||
8 | ····· | 4 | //·Partially·apply·a·function·by·creating·a·version·that·has·had·some·of·its |
5 | //·arguments·pre-filled,·without·changing·its·dynamic·`this`·context.·`_`·acts | ||
6 | //·as·a·placeholder·by·default,·allowing·any·combination·of·arguments·to·be | ||
7 | //·pre-filled.·Set·`_.partial.placeholder`·for·a·custom·placeholder·argument. | ||
8 | var·partial·=·restArguments(function(func,·boundArgs)·{ | ||
9 | ····var·placeholder·=·partial.placeholder; | ||
10 | ····var·bound·=·function()·{ | ||
11 | ········var·position·=·0, | ||
12 | ············length·=·boundArgs.length; | ||
13 | ········var·args·=·Array(length); | ||
14 | ········for·(var·i·=·0;·i·<·length;·i++)·{ | ||
15 | ············args[i]·=·boundArgs[i]·===·placeholder·?·arguments[position++]·:·boundArgs[i]; | ||
16 | ········} | ||
17 | ········while·(position·<·arguments.length)·args.push(arguments[position++]); | ||
18 | ········return·_executeBound(func,·bound,·this,·this,·args); | ||
9 | ····}; | 19 | ····}; |
10 | 20 | ····return·bound; | |
21 | }); | ||
22 | partial.placeholder·=·underscore; | ||
11 | module.exports·=·p | 23 | module.exports·=·partial; |
Offset 1, 12 lines modified | Offset 1, 9 lines modified | ||
1 | var· | 1 | var·_group·=·require('./index18.js'); |
2 | var·get·=·require('./index130.js'); | ||
2 | //·Split·a·collection·into·two·arrays:·one·whose·elements·all·pass·the·given | ||
3 | //·truth·test,·and·one·whose·elements·all·do·not·pass·the·truth·test. | ||
4 | var·partition·=·_group(function(result,·value,·pass)·{ | ||
5 | ····result[pass·?·0·:·1].push(value); | ||
6 | },·true); | ||
3 | //·Generates·a·function·for·a·given·object·that·returns·a·given·property. | ||
4 | function·propertyOf(obj)·{ | ||
5 | ····if·(obj·==·null)·return·noop; | ||
6 | ····return·function(path)·{ | ||
7 | ········return·get(obj,·path); | ||
8 | ····}; | ||
9 | } | ||
10 | module.exports·=·p | 7 | module.exports·=·partition; |
Offset 1, 10 lines modified | Offset 1, 29 lines modified | ||
1 | //·Return·a·random·integer·between·`min`·and·`max`·(inclusive). | ||
2 | function·random(min,·max)·{ | ||
3 | ····if·(max·==·null)·{ | ||
4 | ········max·=·min; | ||
5 | · | 1 | var·restArguments·=·require('./index133.js'); |
2 | var·isFunction·=·require('./index88.js'); | ||
3 | var·_optimizeCb·=·require('./index25.js'); | ||
4 | var·allKeys·=·require('./index34.js'); | ||
5 | var·_keyInObj·=·require('./index23.js'); | ||
6 | var·_flatten·=·require('./index15.js'); | ||
7 | //·Return·a·copy·of·the·object·only·containing·the·allowed·properties. | ||
8 | var·pick·=·restArguments(function(obj,·keys)·{ | ||
9 | ····var·result·=·{}, | ||
10 | ········iteratee·=·keys[0]; | ||
11 | ····if·(obj·==·null)·return·result; | ||
12 | ····if·(isFunction(iteratee))·{ | ||
13 | ········if·(keys.length·>·1)·iteratee·=·_optimizeCb(iteratee,·keys[1]); | ||
14 | ········keys·=·allKeys(obj); | ||
15 | ····}·else·{ | ||
16 | ········iteratee·=·_keyInObj; | ||
17 | ········keys·=·_flatten(keys,·false,·false); | ||
18 | ········obj·=·Object(obj); | ||
19 | ····} | ||
20 | ····for·(var·i·=·0,·length·=·keys.length;·i·<·length;·i++)·{ | ||
21 | ········var·key·=·keys[i]; | ||
22 | ········var·value·=·obj[key]; | ||
23 | ········if·(iteratee(value,·key,·obj))·result[key]·=·value; | ||
6 | ····} | 24 | ····} |
7 | ····return·min·+·Math.floor(Math.random()·*·(max·-·min·+·1)); | ||
8 | 25 | ····return·result; | |
26 | }); | ||
9 | module.exports·=· | 27 | module.exports·=·pick; |
Offset 1, 23 lines modified | Offset 1, 9 lines modified | ||
1 | var·map·=·require('./index107.js'); | ||
2 | var·property·=·require('./index125.js'); | ||
1 | //·Generate·an·integer·Array·containing·an·arithmetic·progression.·A·port·of | ||
2 | //·the·native·Python·`range()`·function.·See | ||
3 | //·[the·Python·documentation](https://docs.python.org/library/functions.html#range). | ||
4 | function·range(start,·stop,·step)·{ | ||
5 | ····if·(stop·==·null)·{ | ||
6 | ········stop·=·start·||·0; | ||
7 | ········start·=·0; | ||
8 | ····} | ||
9 | ····if·(!step)·{ | ||
10 | ········step·=·stop·<·start·?·-1·:·1; | ||
11 | ····} | ||
3 | //·Convenience·version·of·a·common·use·case·of·`_.map`:·fetching·a·property. | ||
4 | function·pluck(obj,·key)·{ | ||
5 | ····return·map(obj,·property(key)); | ||
12 | ····var·length·=·Math.max(Math.ceil((stop·-·start)·/·step),·0); | ||
13 | ····var·range·=·Array(length); | ||
14 | ····for·(var·idx·=·0;·idx·<·length;·idx++,·start·+=·step)·{ | ||
15 | ········range[idx]·=·start; | ||
16 | ····} | ||
17 | ····return·range; | ||
18 | } | 6 | } |
19 | module.exports·=· | 7 | module.exports·=·pluck; |
Offset 1, 7 lines modified | Offset 1, 13 lines modified | ||
1 | var·_deepGet·=·require('./index13.js'); | ||
1 | var·_ | 2 | var·_toPath·=·require('./index31.js'); |
2 | //·**Reduce**·builds·up·a·single·result·from·a·list·of·values,·aka·`inject`, | ||
3 | //·or·`foldl`. | ||
4 | 3 | //·Creates·a·function·that,·when·passed·an·object,·will·traverse·that·object’s | |
4 | //·properties·down·the·given·`path`,·specified·as·an·array·of·keys·or·indices. | ||
5 | function·property(path)·{ | ||
6 | ····path·=·_toPath(path); | ||
7 | ····return·function(obj)·{ | ||
8 | ········return·_deepGet(obj,·path); | ||
9 | ····}; | ||
10 | } | ||
5 | module.exports·=·r | 11 | module.exports·=·property; |
Offset 1, 6 lines modified | Offset 1, 12 lines modified | ||
1 | var·noop·=·require('./index115.js'); | ||
1 | var· | 2 | var·get·=·require('./index65.js'); |
2 | //·The·right-associative·version·of·reduce,·also·known·as·`foldr`. | ||
3 | 3 | //·Generates·a·function·for·a·given·object·that·returns·a·given·property. | |
4 | function·propertyOf(obj)·{ | ||
5 | ····if·(obj·==·null)·return·noop; | ||
6 | ····return·function(path)·{ | ||
7 | ········return·get(obj,·path); | ||
8 | ····}; | ||
9 | } | ||
4 | module.exports·=· | 10 | module.exports·=·propertyOf; |
Offset 1, 10 lines modified | Offset 1, 10 lines modified | ||
1 | var·filter·=·require('./index55.js'); | ||
2 | var·negate·=·require('./index110.js'); | ||
3 | var·_cb·=·require('./index3.js'); | ||
4 | //·Return·all·the·elements·for·which·a·truth·test·fails. | ||
5 | function·reject(obj,·predicate,·context)·{ | ||
6 | 1 | //·Return·a·random·integer·between·`min`·and·`max`·(inclusive). | |
2 | function·random(min,·max)·{ | ||
3 | ····if·(max·==·null)·{ | ||
4 | ········max·=·min; | ||
5 | ········min·=·0; | ||
6 | ····} | ||
7 | ····return·min·+·Math.floor(Math.random()·*·(max·-·min·+·1)); | ||
7 | } | 8 | } |
8 | module.exports·=·r | 9 | module.exports·=·random; |
Offset 1, 9 lines modified | Offset 1, 23 lines modified | ||
1 | 1 | //·Generate·an·integer·Array·containing·an·arithmetic·progression.·A·port·of | |
2 | //·the·native·Python·`range()`·function.·See | ||
3 | //·[the·Python·documentation](https://docs.python.org/library/functions.html#range). | ||
4 | function·range(start,·stop,·step)·{ | ||
5 | ····if·(stop·==·null)·{ | ||
6 | ········stop·=·start·||·0; | ||
7 | ········start·=·0; | ||
8 | ····} | ||
9 | ····if·(!step)·{ | ||
10 | ········step·=·stop·<·start·?·-1·:·1; | ||
11 | ····} | ||
2 | //·Flatten·out·an·array,·either·recursively·(by·default),·or·up·to·`depth`. | ||
3 | //·Passing·`true`·or·`false`·as·`depth`·means·`1`·or·`Infinity`,·respectively. | ||
4 | function·flatten(array,·depth)·{ | ||
5 | ····re | 12 | ····var·length·=·Math.max(Math.ceil((stop·-·start)·/·step),·0); |
13 | ····var·range·=·Array(length); | ||
14 | ····for·(var·idx·=·0;·idx·<·length;·idx++,·start·+=·step)·{ | ||
15 | ········range[idx]·=·start; | ||
16 | ····} | ||
17 | ····return·range; | ||
6 | } | 18 | } |
7 | module.exports·=· | 19 | module.exports·=·range; |
Offset 1, 12 lines modified | Offset 1, 7 lines modified | ||
1 | var· | 1 | var·_createReduce·=·require('./index10.js'); |
2 | //·**Reduce**·builds·up·a·single·result·from·a·list·of·values,·aka·`inject`, | ||
3 | //·or·`foldl`. | ||
4 | var·reduce·=·_createReduce(1); | ||
2 | //·Return·a·sorted·list·of·the·function·names·available·on·the·object. | ||
3 | function·functions(obj)·{ | ||
4 | ····var·names·=·[]; | ||
5 | ····for·(var·key·in·obj)·{ | ||
6 | ········if·(isFunction(obj[key]))·names.push(key); | ||
7 | ····} | ||
8 | ····return·names.sort(); | ||
9 | } | ||
10 | module.exports·=· | 5 | module.exports·=·reduce; |
Offset 1, 11 lines modified | Offset 1, 11 lines modified | ||
1 | //·Internal·list·of·HTML·entities·for·escaping. | ||
2 | var·escapeMap·=·{ | ||
3 | ····'&':·'&', | ||
4 | ····'<':·'<', | ||
5 | ····'>':·'>', | ||
6 | ····'"':·'"', | ||
7 | ····"'":·''', | ||
8 | ····'`':·'`' | ||
9 | 1 | //·Internal·function·to·obtain·a·nested·property·in·`obj`·along·`path`. | |
2 | function·deepGet(obj,·path)·{ | ||
3 | ····var·length·=·path.length; | ||
4 | ····for·(var·i·=·0;·i·<·length;·i++)·{ | ||
5 | ········if·(obj·==·null)·return·void·0; | ||
6 | ········obj·=·obj[path[i]]; | ||
7 | ····} | ||
8 | ····return·length·?·obj·:·void·0; | ||
9 | } | ||
10 | module.exports·=· | 10 | module.exports·=·deepGet; |
Offset 1, 14 lines modified | Offset 1, 6 lines modified | ||
1 | var·_ | 1 | var·_createReduce·=·require('./index10.js'); |
2 | var·_deepGet·=·require('./index12.js'); | ||
3 | var·isUndefined·=·require('./index96.js'); | ||
2 | //·The·right-associative·version·of·reduce,·also·known·as·`foldr`. | ||
3 | var·reduceRight·=·_createReduce(-1); | ||
4 | //·Get·the·value·of·the·(deep)·property·on·`path`·from·`object`. | ||
5 | //·If·any·property·in·`path`·does·not·exist·or·if·the·value·is | ||
6 | //·`undefined`,·return·`defaultValue`·instead. | ||
7 | //·The·`path`·is·normalized·through·`_.toPath`. | ||
8 | function·get(object,·path,·defaultValue)·{ | ||
9 | ····var·value·=·_deepGet(object,·_toPath(path)); | ||
10 | ····return·isUndefined(value)·?·defaultValue·:·value; | ||
11 | } | ||
12 | module.exports·=·g | 4 | module.exports·=·reduceRight; |
Offset 1, 11 lines modified | Offset 1, 10 lines modified | ||
1 | var·filter·=·require('./index56.js'); | ||
1 | var· | 2 | var·negate·=·require('./index114.js'); |
2 | var·_ | 3 | var·_cb·=·require('./index3.js'); |
4 | //·Return·all·the·elements·for·which·a·truth·test·fails. | ||
5 | function·reject(obj,·predicate,·context)·{ | ||
6 | ····return·filter(obj,·negate(_cb(predicate)),·context); | ||
7 | } | ||
3 | //·Groups·the·object's·values·by·a·criterion.·Pass·either·a·string·attribute | ||
4 | //·to·group·by,·or·a·function·that·returns·the·criterion. | ||
5 | var·groupBy·=·_group(function(result,·value,·key)·{ | ||
6 | ····if·(_has(result,·key))·result[key].push(value); | ||
7 | ····else·result[key]·=·[value]; | ||
8 | }); | ||
9 | module.exports·=· | 8 | module.exports·=·reject; |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | var·isFunction·=·require('./index8 | 1 | var·isFunction·=·require('./index88.js'); |
2 | var·_toPath·=·require('./index31.js'); | 2 | var·_toPath·=·require('./index31.js'); |
3 | //·Traverses·the·children·of·`obj`·along·`path`.·If·a·child·is·a·function,·it | 3 | //·Traverses·the·children·of·`obj`·along·`path`.·If·a·child·is·a·function,·it |
4 | //·is·invoked·with·its·parent·as·context.·Returns·the·value·of·the·final | 4 | //·is·invoked·with·its·parent·as·context.·Returns·the·value·of·the·final |
5 | //·child,·or·`fallback`·if·any·child·is·undefined. | 5 | //·child,·or·`fallback`·if·any·child·is·undefined. |
6 | function·result(obj,·path,·fallback)·{ | 6 | function·result(obj,·path,·fallback)·{ |
7 | ····path·=·_toPath(path); | 7 | ····path·=·_toPath(path); |
Offset 1, 11 lines modified | Offset 1, 11 lines modified | ||
1 | var·_isArrayLike·=·require('./index21.js'); | 1 | var·_isArrayLike·=·require('./index21.js'); |
2 | var·values·=·require('./index15 | 2 | var·values·=·require('./index155.js'); |
3 | var·_getLength·=·require('./index17.js'); | 3 | var·_getLength·=·require('./index17.js'); |
4 | var·random·=·require('./index12 | 4 | var·random·=·require('./index127.js'); |
5 | var·toArray·=·require('./index146.js'); | 5 | var·toArray·=·require('./index146.js'); |
6 | //·Sample·**n**·random·values·from·a·collection·using·the·modern·version·of·the | 6 | //·Sample·**n**·random·values·from·a·collection·using·the·modern·version·of·the |
7 | //·[Fisher-Yates·shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). | 7 | //·[Fisher-Yates·shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). |
8 | //·If·**n**·is·not·specified,·returns·a·single·random·element. | 8 | //·If·**n**·is·not·specified,·returns·a·single·random·element. |
9 | //·The·internal·`guard`·argument·allows·it·to·work·with·`_.map`. | 9 | //·The·internal·`guard`·argument·allows·it·to·work·with·`_.map`. |
10 | function·sample(obj,·n,·guard)·{ | 10 | function·sample(obj,·n,·guard)·{ |
Offset 1, 9 lines modified | Offset 1, 9 lines modified | ||
1 | var·_isArrayLike·=·require('./index21.js'); | 1 | var·_isArrayLike·=·require('./index21.js'); |
2 | var·keys·=·require('./index1 | 2 | var·keys·=·require('./index149.js'); |
3 | //·Return·the·number·of·elements·in·a·collection. | 3 | //·Return·the·number·of·elements·in·a·collection. |
4 | function·size(obj)·{ | 4 | function·size(obj)·{ |
5 | ····if·(obj·==·null)·return·0; | 5 | ····if·(obj·==·null)·return·0; |
6 | ····return·_isArrayLike(obj)·?·obj.length·:·keys(obj).length; | 6 | ····return·_isArrayLike(obj)·?·obj.length·:·keys(obj).length; |
7 | } | 7 | } |
Offset 1, 10 lines modified | Offset 1, 10 lines modified | ||
1 | var·_cb·=·require('./index3.js'); | 1 | var·_cb·=·require('./index3.js'); |
2 | var·_isArrayLike·=·require('./index21.js'); | 2 | var·_isArrayLike·=·require('./index21.js'); |
3 | var·keys·=·require('./index1 | 3 | var·keys·=·require('./index149.js'); |
4 | //·Determine·if·at·least·one·element·in·the·object·passes·a·truth·test. | 4 | //·Determine·if·at·least·one·element·in·the·object·passes·a·truth·test. |
5 | function·some(obj,·predicate,·context)·{ | 5 | function·some(obj,·predicate,·context)·{ |
6 | ····predicate·=·_cb(predicate,·context); | 6 | ····predicate·=·_cb(predicate,·context); |
7 | ····var·_keys·=·!_isArrayLike(obj)·&&·keys(obj), | 7 | ····var·_keys·=·!_isArrayLike(obj)·&&·keys(obj), |
8 | ········length·=·(_keys·||·obj).length; | 8 | ········length·=·(_keys·||·obj).length; |
9 | ····for·(var·index·=·0;·index·<·length;·index++)·{ | 9 | ····for·(var·index·=·0;·index·<·length;·index++)·{ |
Offset 1, 19 lines modified | Offset 1, 26 lines modified | ||
1 | var·_cb·=·require('./index3.js'); | 1 | var·_cb·=·require('./index3.js'); |
2 | var·pluck·=·require('./index124.js'); | ||
2 | var· | 3 | var·map·=·require('./index107.js'); |
4 | //·Sort·the·object's·values·by·a·criterion·produced·by·an·iteratee. | ||
3 | //·Use·a·comparator·function·to·figure·out·the·smallest·index·at·which | ||
4 | //·an·object·should·be·inserted·so·as·to·maintain·order.·Uses·binary·search. | ||
5 | function·sort | 5 | function·sortBy(obj,·iteratee,·context)·{ |
6 | ····var·index·=·0; | ||
6 | ····iteratee·=·_cb(iteratee,·context | 7 | ····iteratee·=·_cb(iteratee,·context); |
7 | ····var·value·=·iteratee(obj); | ||
8 | ····var·low·=·0, | ||
9 | ········high·=·_getLength(array); | ||
10 | ····while·(low·<·high)·{ | ||
11 | ········var·mid·=·Math.floor((low·+·high)·/·2); | ||
12 | ········if·(iteratee(array[mid])·<·value)·low·=·mid·+·1; | ||
13 | ········else·high·=·mid; | ||
14 | ····} | ||
15 | ····return·lo | 8 | ····return·pluck(map(obj,·function(value,·key,·list)·{ |
9 | ········return·{ | ||
10 | ············value:·value, | ||
11 | ············index:·index++, | ||
12 | ············criteria:·iteratee(value,·key,·list) | ||
13 | ········}; | ||
14 | ····}).sort(function(left,·right)·{ | ||
15 | ········var·a·=·left.criteria; | ||
16 | ········var·b·=·right.criteria; | ||
17 | ········if·(a·!==·b)·{ | ||
18 | ············if·(a·>·b·||·a·===·void·0)·return·1; | ||
19 | ············if·(a·<·b·||·b·===·void·0)·return·-1; | ||
20 | ········} | ||
21 | ········return·left.index·-·right.index; | ||
22 | ····}),·'value'); | ||
16 | } | 23 | } |
17 | module.exports·=·sort | 24 | module.exports·=·sortBy; |
Offset 1, 9 lines modified | Offset 1, 9 lines modified | ||
1 | var·_baseCreate·=·require('./index.js'); | 1 | var·_baseCreate·=·require('./index.js'); |
2 | var·isObject·=·require('./index9 | 2 | var·isObject·=·require('./index94.js'); |
3 | //·Internal·function·to·execute·`sourceFunc`·bound·to·`context`·with·optional | 3 | //·Internal·function·to·execute·`sourceFunc`·bound·to·`context`·with·optional |
4 | //·`args`.·Determines·whether·to·execute·a·function·as·a·constructor·or·as·a | 4 | //·`args`.·Determines·whether·to·execute·a·function·as·a·constructor·or·as·a |
5 | //·normal·function. | 5 | //·normal·function. |
6 | function·executeBound(sourceFunc,·boundFunc,·context,·callingContext,·args)·{ | 6 | function·executeBound(sourceFunc,·boundFunc,·context,·callingContext,·args)·{ |
7 | ····if·(!(callingContext·instanceof·boundFunc))·return·sourceFunc.apply(context,·args); | 7 | ····if·(!(callingContext·instanceof·boundFunc))·return·sourceFunc.apply(context,·args); |
8 | ····var·self·=·_baseCreate(sourceFunc.prototype); | 8 | ····var·self·=·_baseCreate(sourceFunc.prototype); |
Offset 1, 9 lines modified | Offset 1, 19 lines modified | ||
1 | //·Invokes·`interceptor`·with·the·`obj`·and·then·returns·`obj`. | ||
2 | //·The·primary·purpose·of·this·method·is·to·"tap·into"·a·method·chain,·in | ||
3 | //·order·to·perform·operations·on·intermediate·results·within·the·chain. | ||
4 | function·tap(obj,·interceptor)·{ | ||
5 | ··· | 1 | var·_cb·=·require('./index3.js'); |
2 | var·_getLength·=·require('./index17.js'); | ||
3 | //·Use·a·comparator·function·to·figure·out·the·smallest·index·at·which | ||
4 | //·an·object·should·be·inserted·so·as·to·maintain·order.·Uses·binary·search. | ||
5 | function·sortedIndex(array,·obj,·iteratee,·context)·{ | ||
6 | ····iteratee·=·_cb(iteratee,·context,·1); | ||
7 | ····var·value·=·iteratee(obj); | ||
8 | ····var·low·=·0, | ||
9 | ········high·=·_getLength(array); | ||
10 | ····while·(low·<·high)·{ | ||
11 | ········var·mid·=·Math.floor((low·+·high)·/·2); | ||
12 | ········if·(iteratee(array[mid])·<·value)·low·=·mid·+·1; | ||
13 | ········else·high·=·mid; | ||
14 | ····} | ||
6 | ····return· | 15 | ····return·low; |
7 | } | 16 | } |
8 | module.exports·=·t | 17 | module.exports·=·sortedIndex; |
Offset 1, 26 lines modified | Offset 1, 9 lines modified | ||
1 | //·Invokes·`interceptor`·with·the·`obj`·and·then·returns·`obj`. | ||
2 | //·The·primary·purpose·of·this·method·is·to·"tap·into"·a·method·chain,·in | ||
3 | //·order·to·perform·operations·on·intermediate·results·within·the·chain. | ||
4 | function·tap(obj,·interceptor)·{ | ||
5 | ····interceptor(obj); | ||
6 | ····return·obj; | ||
1 | var·_cb·=·require('./index3.js'); | ||
2 | var·pluck·=·require('./index120.js'); | ||
3 | var·map·=·require('./index103.js'); | ||
4 | //·Sort·the·object's·values·by·a·criterion·produced·by·an·iteratee. | ||
5 | function·sortBy(obj,·iteratee,·context)·{ | ||
6 | ····var·index·=·0; | ||
7 | ····iteratee·=·_cb(iteratee,·context); | ||
8 | ····return·pluck(map(obj,·function(value,·key,·list)·{ | ||
9 | ········return·{ | ||
10 | ············value:·value, | ||
11 | ············index:·index++, | ||
12 | ············criteria:·iteratee(value,·key,·list) | ||
13 | ········}; | ||
14 | ····}).sort(function(left,·right)·{ | ||
15 | ········var·a·=·left.criteria; | ||
16 | ········var·b·=·right.criteria; | ||
17 | ········if·(a·!==·b)·{ | ||
18 | ············if·(a·>·b·||·a·===·void·0)·return·1; | ||
19 | ············if·(a·<·b·||·b·===·void·0)·return·-1; | ||
20 | ········} | ||
21 | ········return·left.index·-·right.index; | ||
22 | ····}),·'value'); | ||
23 | } | 7 | } |
24 | module.exports·=· | 8 | module.exports·=·tap; |
Offset 1, 9 lines modified | Offset 1, 9 lines modified | ||
1 | var·defaults·=·require('./index47.js'); | 1 | var·defaults·=·require('./index47.js'); |
2 | var·underscore·=·require('./index1 | 2 | var·underscore·=·require('./index150.js'); |
3 | require('./index143.js'); | 3 | require('./index143.js'); |
4 | //·When·customizing·`_.templateSettings`,·if·you·don't·want·to·define·an | 4 | //·When·customizing·`_.templateSettings`,·if·you·don't·want·to·define·an |
5 | //·interpolation,·evaluation·or·escaping·regex,·we·need·one·that·is | 5 | //·interpolation,·evaluation·or·escaping·regex,·we·need·one·that·is |
6 | //·guaranteed·not·to·match. | 6 | //·guaranteed·not·to·match. |
7 | var·noMatch·=·/(.)^/; | 7 | var·noMatch·=·/(.)^/; |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | var·underscore·=·require('./index1 | 1 | var·underscore·=·require('./index150.js'); |
2 | //·By·default,·Underscore·uses·ERB-style·template·delimiters.·Change·the | 2 | //·By·default,·Underscore·uses·ERB-style·template·delimiters.·Change·the |
3 | //·following·template·settings·to·use·alternative·delimiters. | 3 | //·following·template·settings·to·use·alternative·delimiters. |
4 | var·templateSettings·=·underscore.templateSettings·=·{ | 4 | var·templateSettings·=·underscore.templateSettings·=·{ |
5 | ····evaluate:·/<%([\s\S]+?)%>/g, | 5 | ····evaluate:·/<%([\s\S]+?)%>/g, |
6 | ····interpolate:·/<%=([\s\S]+?)%>/g, | 6 | ····interpolate:·/<%=([\s\S]+?)%>/g, |
7 | ····escape:·/<%-([\s\S]+?)%>/g | 7 | ····escape:·/<%-([\s\S]+?)%>/g |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | var·now·=·require('./index11 | 1 | var·now·=·require('./index116.js'); |
2 | //·Returns·a·function,·that,·when·invoked,·will·only·be·triggered·at·most·once | 2 | //·Returns·a·function,·that,·when·invoked,·will·only·be·triggered·at·most·once |
3 | //·during·a·given·window·of·time.·Normally,·the·throttled·function·will·run | 3 | //·during·a·given·window·of·time.·Normally,·the·throttled·function·will·run |
4 | //·as·much·as·it·can,·without·ever·going·more·than·once·per·`wait`·duration; | 4 | //·as·much·as·it·can,·without·ever·going·more·than·once·per·`wait`·duration; |
5 | //·but·if·you'd·like·to·disable·the·execution·on·the·leading·edge,·pass | 5 | //·but·if·you'd·like·to·disable·the·execution·on·the·leading·edge,·pass |
6 | //·`{leading:·false}`.·To·disable·execution·on·the·trailing·edge,·ditto. | 6 | //·`{leading:·false}`.·To·disable·execution·on·the·trailing·edge,·ditto. |
7 | function·throttle(func,·wait,·options)·{ | 7 | function·throttle(func,·wait,·options)·{ |
Offset 1, 14 lines modified | Offset 1, 14 lines modified | ||
1 | var·isArray·=·require('./index7 | 1 | var·isArray·=·require('./index78.js'); |
2 | var·_setup·=·require('./index26.js'); | 2 | var·_setup·=·require('./index26.js'); |
3 | var·isString·=·require('./index9 | 3 | var·isString·=·require('./index97.js'); |
4 | var·_isArrayLike·=·require('./index21.js'); | 4 | var·_isArrayLike·=·require('./index21.js'); |
5 | var·map·=·require('./index10 | 5 | var·map·=·require('./index107.js'); |
6 | var·identity·=·require('./index6 | 6 | var·identity·=·require('./index68.js'); |
7 | var·values·=·require('./index15 | 7 | var·values·=·require('./index155.js'); |
8 | //·Safely·create·a·real,·live·array·from·anything·iterable. | 8 | //·Safely·create·a·real,·live·array·from·anything·iterable. |
9 | var·reStrSymbol·=·/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; | 9 | var·reStrSymbol·=·/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; |
10 | function·toArray(obj)·{ | 10 | function·toArray(obj)·{ |
11 | ····if·(!obj)·return·[]; | 11 | ····if·(!obj)·return·[]; |
12 | ····if·(isArray(obj))·return·_setup.slice.call(obj); | 12 | ····if·(isArray(obj))·return·_setup.slice.call(obj); |
Offset 1, 31 lines modified | Offset 1, 11 lines modified | ||
1 | var·underscore·=·require('./index1 | 1 | var·underscore·=·require('./index150.js'); |
2 | var· | 2 | var·isArray·=·require('./index78.js'); |
3 | var·_setup·=·require('./index26.js'); | ||
4 | var·_chainResult·=·require('./index4.js'); | ||
3 | //·Normalize·a·(deep)·property·`path`·to·array. | ||
4 | //·Like·`_.iteratee`,·this·function·can·be·customized. | ||
5 | function·toPath(path)·{ | ||
6 | ····return·isArray(path)·?·path·:·[path]; | ||
7 | } | ||
8 | underscore.toPath·=·toPath; | ||
5 | //·Add·all·mutator·`Array`·functions·to·the·wrapper. | ||
6 | each(['pop',·'push',·'reverse',·'shift',·'sort',·'splice',·'unshift'],·function(name)·{ | ||
7 | ····var·method·=·_setup.ArrayProto[name]; | ||
8 | ····underscore.prototype[name]·=·function()·{ | ||
9 | ········var·obj·=·this._wrapped; | ||
10 | ········if·(obj·!=·null)·{ | ||
11 | ············method.apply(obj,·arguments); | ||
12 | ············if·((name·===·'shift'·||·name·===·'splice')·&&·obj.length·===·0)·{ | ||
13 | ················delete·obj[0]; | ||
14 | ············} | ||
15 | ········} | ||
16 | ········return·_chainResult(this,·obj); | ||
17 | ····}; | ||
18 | }); | ||
9 | module.exports·=·toPath; | ||
19 | //·Add·all·accessor·`Array`·functions·to·the·wrapper. | ||
20 | each(['concat',·'join',·'slice'],·function(name)·{ | ||
21 | ····var·method·=·_setup.ArrayProto[name]; | ||
22 | ····underscore.prototype[name]·=·function()·{ | ||
23 | ········var·obj·=·this._wrapped; | ||
24 | ········if·(obj·!=·null)·obj·=·method.apply(obj,·arguments); | ||
25 | ········return·_chainResult(this,·obj); | ||
26 | ····}; | ||
27 | }); | ||
28 | module.exports·=·underscore; |
Offset 1, 11 lines modified | Offset 1, 31 lines modified | ||
1 | var·underscore·=·require('./index1 | 1 | var·underscore·=·require('./index150.js'); |
2 | var· | 2 | var·each·=·require('./index51.js'); |
3 | var·_setup·=·require('./index26.js'); | ||
4 | var·_chainResult·=·require('./index4.js'); | ||
3 | //·Normalize·a·(deep)·property·`path`·to·array. | ||
4 | //·Like·`_.iteratee`,·this·function·can·be·customized. | ||
5 | function·toPath(path)·{ | ||
6 | ····return·isArray(path)·?·path·:·[path]; | ||
7 | } | ||
8 | 5 | //·Add·all·mutator·`Array`·functions·to·the·wrapper. | |
6 | each(['pop',·'push',·'reverse',·'shift',·'sort',·'splice',·'unshift'],·function(name)·{ | ||
7 | ····var·method·=·_setup.ArrayProto[name]; | ||
8 | ····underscore.prototype[name]·=·function()·{ | ||
9 | ········var·obj·=·this._wrapped; | ||
10 | ········if·(obj·!=·null)·{ | ||
11 | ············method.apply(obj,·arguments); | ||
12 | ············if·((name·===·'shift'·||·name·===·'splice')·&&·obj.length·===·0)·{ | ||
13 | ················delete·obj[0]; | ||
14 | ············} | ||
15 | ········} | ||
16 | ········return·_chainResult(this,·obj); | ||
17 | ····}; | ||
18 | }); | ||
9 | 19 | //·Add·all·accessor·`Array`·functions·to·the·wrapper. | |
20 | each(['concat',·'join',·'slice'],·function(name)·{ | ||
21 | ····var·method·=·_setup.ArrayProto[name]; | ||
22 | ····underscore.prototype[name]·=·function()·{ | ||
23 | ········var·obj·=·this._wrapped; | ||
24 | ········if·(obj·!=·null)·obj·=·method.apply(obj,·arguments); | ||
25 | ········return·_chainResult(this,·obj); | ||
26 | ····}; | ||
27 | }); | ||
28 | module.exports·=·underscore; |
Offset 1, 27 lines modified | Offset 1, 19 lines modified | ||
1 | var·isObject·=·require('./index94.js'); | ||
1 | var·_setup·=·require('./index26.js'); | 2 | var·_setup·=·require('./index26.js'); |
3 | var·_has·=·require('./index19.js'); | ||
4 | var·_collectNonEnumProps·=·require('./index5.js'); | ||
5 | //·Retrieve·the·names·of·an·object's·own·properties. | ||
6 | //·Delegates·to·**ECMAScript·5**'s·native·`Object.keys`. | ||
2 | //·If·Underscore·is·called·as·a·function,·it·returns·a·wrapped·object·that·can | ||
3 | //·be·used·OO-style.·This·wrapper·holds·altered·versions·of·all·functions·added | ||
4 | //·through·`_.mixin`.·Wrapped·objects·may·be·chained. | ||
5 | function· | 7 | function·keys(obj)·{ |
6 | ····if·(obj·instanceof·_)·return·obj; | ||
7 | ····if·(!(this·instanceof·_))·return·new·_(obj); | ||
8 | ···· | 8 | ····if·(!isObject(obj))·return·[]; |
9 | ····if·(_setup.nativeKeys)·return·_setup.nativeKeys(obj); | ||
10 | ····var·keys·=·[]; | ||
11 | ····for·(var·key·in·obj) | ||
12 | ········if·(_has(obj,·key))·keys.push(key); | ||
13 | ····//·Ahem,·IE·<·9. | ||
14 | ····if·(_setup.hasEnumBug)·_collectNonEnumProps(obj,·keys); | ||
15 | ····return·keys; | ||
9 | } | 16 | } |
10 | _.VERSION·=·_setup.VERSION; | ||
11 | //·Extracts·the·result·from·a·wrapped·and·chained·object. | ||
12 | _.prototype.value·=·function()·{ | ||
13 | ····return·this._wrapped; | ||
14 | }; | ||
15 | //·Provide·unwrapping·proxies·for·some·methods·used·in·engine·operations | ||
16 | //·such·as·arithmetic·and·JSON·stringification. | ||
17 | _.prototype.valueOf·=·_.prototype.toJSON·=·_.prototype.value; | ||
18 | _.prototype.toString·=·function()·{ | ||
19 | ····return·String(this._wrapped); | ||
20 | }; | ||
21 | module.exports·=· | 17 | module.exports·=·keys; |
Offset 1, 11 lines modified | Offset 1, 11 lines modified | ||
1 | var·_getLength·=·require('./index17.js'); | 1 | var·_getLength·=·require('./index17.js'); |
2 | var·_isArrayLike·=·require('./index21.js'); | 2 | var·_isArrayLike·=·require('./index21.js'); |
3 | var·isArray·=·require('./index7 | 3 | var·isArray·=·require('./index78.js'); |
4 | var·isArguments·=·require('./index7 | 4 | var·isArguments·=·require('./index77.js'); |
5 | //·Internal·implementation·of·a·recursive·`flatten`·function. | 5 | //·Internal·implementation·of·a·recursive·`flatten`·function. |
6 | function·flatten(input,·depth,·strict,·output)·{ | 6 | function·flatten(input,·depth,·strict,·output)·{ |
7 | ····output·=·output·||·[]; | 7 | ····output·=·output·||·[]; |
8 | ····if·(!depth·&&·depth·!==·0)·{ | 8 | ····if·(!depth·&&·depth·!==·0)·{ |
9 | ········depth·=·Infinity; | 9 | ········depth·=·Infinity; |
10 | ····}·else·if·(depth·<=·0)·{ | 10 | ····}·else·if·(depth·<=·0)·{ |
Offset 1, 7 lines modified | Offset 1, 27 lines modified | ||
1 | var·_createEscaper·=·require('./index7.js'); | ||
2 | var·_ | 1 | var·_setup·=·require('./index26.js'); |
3 | //·Function·for·unescaping·strings·from·HTML·interpolation. | ||
4 | 2 | //·If·Underscore·is·called·as·a·function,·it·returns·a·wrapped·object·that·can | |
3 | //·be·used·OO-style.·This·wrapper·holds·altered·versions·of·all·functions·added | ||
4 | //·through·`_.mixin`.·Wrapped·objects·may·be·chained. | ||
5 | function·_(obj)·{ | ||
6 | ····if·(obj·instanceof·_)·return·obj; | ||
7 | ····if·(!(this·instanceof·_))·return·new·_(obj); | ||
8 | ····this._wrapped·=·obj; | ||
9 | } | ||
10 | _.VERSION·=·_setup.VERSION; | ||
11 | //·Extracts·the·result·from·a·wrapped·and·chained·object. | ||
12 | _.prototype.value·=·function()·{ | ||
13 | ····return·this._wrapped; | ||
14 | }; | ||
15 | //·Provide·unwrapping·proxies·for·some·methods·used·in·engine·operations | ||
16 | //·such·as·arithmetic·and·JSON·stringification. | ||
17 | _.prototype.valueOf·=·_.prototype.toJSON·=·_.prototype.value; | ||
18 | _.prototype.toString·=·function()·{ | ||
19 | ····return·String(this._wrapped); | ||
20 | }; | ||
5 | module.exports·=· | 21 | module.exports·=·_; |
Offset 1, 38 lines modified | Offset 1, 11 lines modified | ||
1 | var· | 1 | var·restArguments·=·require('./index133.js'); |
2 | var· | 2 | var·uniq·=·require('./index152.js'); |
3 | var·_ | 3 | var·_flatten·=·require('./index15.js'); |
4 | var·contains·=·require('./index43.js'); | ||
4 | //·Produce·an·array·that·contains·the·union:·each·distinct·element·from·all·of | ||
5 | //·the·passed-in·arrays. | ||
6 | var·union·=·restArguments(function(arrays)·{ | ||
7 | ····return·uniq(_flatten(arrays,·true,·true)); | ||
8 | }); | ||
5 | //·Produce·a·duplicate-free·version·of·the·array.·If·the·array·has·already | ||
6 | //·been·sorted,·you·have·the·option·of·using·a·faster·algorithm. | ||
7 | //·The·faster·algorithm·will·not·work·with·an·iteratee·if·the·iteratee | ||
8 | //·is·not·a·one-to-one·function,·so·providing·an·iteratee·will·disable | ||
9 | //·the·faster·algorithm. | ||
10 | function·uniq(array,·isSorted,·iteratee,·context)·{ | ||
11 | ····if·(!isBoolean(isSorted))·{ | ||
12 | ········context·=·iteratee; | ||
13 | ········iteratee·=·isSorted; | ||
14 | ········isSorted·=·false; | ||
15 | ····} | ||
16 | ····if·(iteratee·!=·null)·iteratee·=·_cb(iteratee,·context); | ||
17 | ····var·result·=·[]; | ||
18 | ····var·seen·=·[]; | ||
19 | ····for·(var·i·=·0,·length·=·_getLength(array);·i·<·length;·i++)·{ | ||
20 | ········var·value·=·array[i], | ||
21 | ············computed·=·iteratee·?·iteratee(value,·i,·array)·:·value; | ||
22 | ········if·(isSorted·&&·!iteratee)·{ | ||
23 | ············if·(!i·||·seen·!==·computed)·result.push(value); | ||
24 | ············seen·=·computed; | ||
25 | ········}·else·if·(iteratee)·{ | ||
26 | ············if·(!contains(seen,·computed))·{ | ||
27 | ················seen.push(computed); | ||
28 | ················result.push(value); | ||
29 | ············} | ||
30 | ········}·else·if·(!contains(result,·value))·{ | ||
31 | ············result.push(value); | ||
32 | ········} | ||
33 | ····} | ||
34 | ····return·result; | ||
35 | } | ||
36 | module.exports·=·uni | 9 | module.exports·=·union; |
Offset 1, 10 lines modified | Offset 1, 38 lines modified | ||
1 | //·Generate·a·unique·integer·id·(unique·within·the·entire·client·session). | ||
2 | //·Useful·for·temporary·DOM·ids. | ||
3 | var·i | 1 | var·isBoolean·=·require('./index80.js'); |
2 | var·_cb·=·require('./index3.js'); | ||
3 | var·_getLength·=·require('./index17.js'); | ||
4 | var·contains·=·require('./index44.js'); | ||
4 | function·uniqueId(prefix)·{ | ||
5 | ····var·id·=·++idCounter·+·''; | ||
6 | 5 | //·Produce·a·duplicate-free·version·of·the·array.·If·the·array·has·already | |
6 | //·been·sorted,·you·have·the·option·of·using·a·faster·algorithm. | ||
7 | //·The·faster·algorithm·will·not·work·with·an·iteratee·if·the·iteratee | ||
8 | //·is·not·a·one-to-one·function,·so·providing·an·iteratee·will·disable | ||
9 | //·the·faster·algorithm. | ||
10 | function·uniq(array,·isSorted,·iteratee,·context)·{ | ||
11 | ····if·(!isBoolean(isSorted))·{ | ||
12 | ········context·=·iteratee; | ||
13 | ········iteratee·=·isSorted; | ||
14 | ········isSorted·=·false; | ||
15 | ····} | ||
16 | ····if·(iteratee·!=·null)·iteratee·=·_cb(iteratee,·context); | ||
17 | ····var·result·=·[]; | ||
18 | ····var·seen·=·[]; | ||
19 | ····for·(var·i·=·0,·length·=·_getLength(array);·i·<·length;·i++)·{ | ||
20 | ········var·value·=·array[i], | ||
21 | ············computed·=·iteratee·?·iteratee(value,·i,·array)·:·value; | ||
22 | ········if·(isSorted·&&·!iteratee)·{ | ||
23 | ············if·(!i·||·seen·!==·computed)·result.push(value); | ||
24 | ············seen·=·computed; | ||
25 | ········}·else·if·(iteratee)·{ | ||
26 | ············if·(!contains(seen,·computed))·{ | ||
27 | ················seen.push(computed); | ||
28 | ················result.push(value); | ||
29 | ············} | ||
30 | ········}·else·if·(!contains(result,·value))·{ | ||
31 | ············result.push(value); | ||
32 | ········} | ||
33 | ····} | ||
34 | ····return·result; | ||
7 | } | 35 | } |
8 | module.exports·=·uniq | 36 | module.exports·=·uniq; |
Offset 1, 10 lines modified | Offset 1, 10 lines modified | ||
1 | var·max·=·require('./index10 | 1 | var·max·=·require('./index109.js'); |
2 | var·_getLength·=·require('./index17.js'); | 2 | var·_getLength·=·require('./index17.js'); |
3 | var·pluck·=·require('./index12 | 3 | var·pluck·=·require('./index124.js'); |
4 | //·Complement·of·zip.·Unzip·accepts·an·array·of·arrays·and·groups | 4 | //·Complement·of·zip.·Unzip·accepts·an·array·of·arrays·and·groups |
5 | //·each·array's·elements·on·shared·indices. | 5 | //·each·array's·elements·on·shared·indices. |
6 | function·unzip(array)·{ | 6 | function·unzip(array)·{ |
7 | ····var·length·=·(array·&&·max(array,·_getLength).length)·||·0; | 7 | ····var·length·=·(array·&&·max(array,·_getLength).length)·||·0; |
8 | ····var·result·=·Array(length); | 8 | ····var·result·=·Array(length); |
Offset 1, 14 lines modified | Offset 1, 10 lines modified | ||
1 | 1 | //·Generate·a·unique·integer·id·(unique·within·the·entire·client·session). | |
2 | //·Useful·for·temporary·DOM·ids. | ||
3 | var·idCounter·=·0; | ||
4 | function·uniqueId(prefix)·{ | ||
5 | ····var·id·=·++idCounter·+·''; | ||
6 | ····return·prefix·?·prefix·+·id·:·id; | ||
2 | //·Retrieve·the·values·of·an·object's·properties. | ||
3 | function·values(obj)·{ | ||
4 | ····var·_keys·=·keys(obj); | ||
5 | ····var·length·=·_keys.length; | ||
6 | ····var·values·=·Array(length); | ||
7 | ····for·(var·i·=·0;·i·<·length;·i++)·{ | ||
8 | ········values[i]·=·obj[_keys[i]]; | ||
9 | ····} | ||
10 | ····return·values; | ||
11 | } | 7 | } |
12 | module.exports·=· | 8 | module.exports·=·uniqueId; |
Offset 1, 10 lines modified | Offset 1, 14 lines modified | ||
1 | var·filter·=·require('./index55.js'); | ||
2 | var· | 1 | var·keys·=·require('./index149.js'); |
3 | //·Convenience·version·of·a·common·use·case·of·`_.filter`:·selecting·only | ||
4 | //·objects·containing·specific·`key:value`·pairs. | ||
5 | function·where(obj,·attrs)·{ | ||
6 | · | 2 | //·Retrieve·the·values·of·an·object's·properties. |
3 | function·values(obj)·{ | ||
4 | ····var·_keys·=·keys(obj); | ||
5 | ····var·length·=·_keys.length; | ||
6 | ····var·values·=·Array(length); | ||
7 | ····for·(var·i·=·0;·i·<·length;·i++)·{ | ||
8 | ········values[i]·=·obj[_keys[i]]; | ||
9 | ····} | ||
10 | ····return·values; | ||
7 | } | 11 | } |
8 | module.exports·=· | 12 | module.exports·=·values; |
Offset 1, 9 lines modified | Offset 1, 10 lines modified | ||
1 | var·restArguments·=·require('./index133.js'); | ||
2 | var· | 1 | var·filter·=·require('./index56.js'); |
2 | var·matcher·=·require('./index110.js'); | ||
3 | //·Return·a·version·of·the·array·that·does·not·contain·the·specified·value(s). | ||
4 | var·without·=·restArguments(function(array,·otherArrays)·{ | ||
5 | ····return·difference(array,·otherArrays); | ||
6 | 3 | //·Convenience·version·of·a·common·use·case·of·`_.filter`:·selecting·only | |
4 | //·objects·containing·specific·`key:value`·pairs. | ||
5 | function·where(obj,·attrs)·{ | ||
6 | ····return·filter(obj,·matcher(attrs)); | ||
7 | } | ||
7 | module.exports·=·w | 8 | module.exports·=·where; |
Offset 1, 10 lines modified | Offset 1, 9 lines modified | ||
1 | var· | 1 | var·restArguments·=·require('./index133.js'); |
2 | var·difference·=·require('./index50.js'); | ||
3 | //·Return·a·version·of·the·array·that·does·not·contain·the·specified·value(s). | ||
4 | var·without·=·restArguments(function(array,·otherArrays)·{ | ||
5 | ····return·difference(array,·otherArrays); | ||
6 | }); | ||
2 | //·Returns·the·first·function·passed·as·an·argument·to·the·second, | ||
3 | //·allowing·you·to·adjust·arguments,·run·code·before·and·after,·and | ||
4 | //·conditionally·execute·the·original·function. | ||
5 | function·wrap(func,·wrapper)·{ | ||
6 | ····return·partial(wrapper,·func); | ||
7 | } | ||
8 | module.exports·=·w | 7 | module.exports·=·without; |
Offset 1, 16 lines modified | Offset 1, 10 lines modified | ||
1 | var· | 1 | var·partial·=·require('./index121.js'); |
2 | //·Returns·the·first·function·passed·as·an·argument·to·the·second, | ||
3 | //·allowing·you·to·adjust·arguments,·run·code·before·and·after,·and | ||
4 | //·conditionally·execute·the·original·function. | ||
5 | function·wrap(func,·wrapper)·{ | ||
6 | ····return·partial(wrapper,·func); | ||
2 | //·Chunk·a·single·array·into·multiple·arrays,·each·containing·`count`·or·fewer | ||
3 | //·items. | ||
4 | function·chunk(array,·count)·{ | ||
5 | ····if·(count·==·null·||·count·<·1)·return·[]; | ||
6 | ····var·result·=·[]; | ||
7 | ····var·i·=·0, | ||
8 | ········length·=·array.length; | ||
9 | ····while·(i·<·length)·{ | ||
10 | ········result.push(_setup.slice.call(array,·i,·i·+=·count)); | ||
11 | ····} | ||
12 | ····return·result; | ||
13 | } | 7 | } |
14 | module.exports·=· | 8 | module.exports·=·wrap; |
Offset 1, 11 lines modified | Offset 1, 7 lines modified | ||
1 | var·restArguments·=·require('./index133.js'); | ||
2 | var·uniq·=·require('./index151.js'); | ||
3 | var·_ | 1 | var·_createEscaper·=·require('./index7.js'); |
2 | var·_unescapeMap·=·require('./index32.js'); | ||
3 | //·Function·for·unescaping·strings·from·HTML·interpolation. | ||
4 | var·unescape·=·_createEscaper(_unescapeMap); | ||
4 | //·Produce·an·array·that·contains·the·union:·each·distinct·element·from·all·of | ||
5 | //·the·passed-in·arrays. | ||
6 | var·union·=·restArguments(function(arrays)·{ | ||
7 | ····return·uniq(_flatten(arrays,·true,·true)); | ||
8 | }); | ||
9 | module.exports·=·un | 5 | module.exports·=·unescape; |
Offset 1, 13 lines modified | Offset 1, 13 lines modified | ||
1 | var·identity·=·require('./index6 | 1 | var·identity·=·require('./index68.js'); |
2 | var·isFunction·=·require('./index8 | 2 | var·isFunction·=·require('./index88.js'); |
3 | var·isObject·=·require('./index9 | 3 | var·isObject·=·require('./index94.js'); |
4 | var·isArray·=·require('./index7 | 4 | var·isArray·=·require('./index78.js'); |
5 | var·matcher·=·require('./index1 | 5 | var·matcher·=·require('./index110.js'); |
6 | var·property·=·require('./index12 | 6 | var·property·=·require('./index125.js'); |
7 | var·_optimizeCb·=·require('./index25.js'); | 7 | var·_optimizeCb·=·require('./index25.js'); |
8 | //·An·internal·function·to·generate·callbacks·that·can·be·applied·to·each | 8 | //·An·internal·function·to·generate·callbacks·that·can·be·applied·to·each |
9 | //·element·in·a·collection,·returning·the·desired·result·—·either·`_.identity`, | 9 | //·element·in·a·collection,·returning·the·desired·result·—·either·`_.identity`, |
10 | //·an·arbitrary·callback,·a·property·matcher,·or·a·property·accessor. | 10 | //·an·arbitrary·callback,·a·property·matcher,·or·a·property·accessor. |
11 | function·baseIteratee(value,·context,·argCount)·{ | 11 | function·baseIteratee(value,·context,·argCount)·{ |
12 | ····if·(value·==·null)·return·identity; | 12 | ····if·(value·==·null)·return·identity; |
Offset 1, 9 lines modified | Offset 1, 9 lines modified | ||
1 | var·_getLength·=·require('./index17.js'); | 1 | var·_getLength·=·require('./index17.js'); |
2 | var·isFunction·=·require('./index8 | 2 | var·isFunction·=·require('./index88.js'); |
3 | var·allKeys·=·require('./index34.js'); | 3 | var·allKeys·=·require('./index34.js'); |
4 | //·Since·the·regular·`Object.prototype.toString`·type·tests·don't·work·for | 4 | //·Since·the·regular·`Object.prototype.toString`·type·tests·don't·work·for |
5 | //·some·types·in·IE·11,·we·use·a·fingerprinting·heuristic·instead,·based | 5 | //·some·types·in·IE·11,·we·use·a·fingerprinting·heuristic·instead,·based |
6 | //·on·the·methods.·It's·not·great,·but·it's·the·best·we·got. | 6 | //·on·the·methods.·It's·not·great,·but·it's·the·best·we·got. |
7 | //·The·fingerprint·method·lists·are·defined·below. | 7 | //·The·fingerprint·method·lists·are·defined·below. |
8 | function·ie11fingerprint(methods)·{ | 8 | function·ie11fingerprint(methods)·{ |
Offset 1, 10 lines modified | Offset 1, 10 lines modified | ||
1 | var·underscore·=·require('./index1 | 1 | var·underscore·=·require('./index150.js'); |
2 | var·_baseIteratee·=·require('./index2.js'); | 2 | var·_baseIteratee·=·require('./index2.js'); |
3 | var·iteratee·=·require('./index | 3 | var·iteratee·=·require('./index102.js'); |
4 | //·The·function·we·call·internally·to·generate·a·callback.·It·invokes | 4 | //·The·function·we·call·internally·to·generate·a·callback.·It·invokes |
5 | //·`_.iteratee`·if·overridden,·otherwise·`baseIteratee`. | 5 | //·`_.iteratee`·if·overridden,·otherwise·`baseIteratee`. |
6 | function·cb(value,·context,·argCount)·{ | 6 | function·cb(value,·context,·argCount)·{ |
7 | ····if·(underscore.iteratee·!==·iteratee)·return·underscore.iteratee(value,·context); | 7 | ····if·(underscore.iteratee·!==·iteratee)·return·underscore.iteratee(value,·context); |
8 | ····return·_baseIteratee(value,·context,·argCount); | 8 | ····return·_baseIteratee(value,·context,·argCount); |
9 | } | 9 | } |
Offset 1, 9 lines modified | Offset 1, 9 lines modified | ||
1 | var·underscore·=·require('./index1 | 1 | var·underscore·=·require('./index150.js'); |
2 | require('./index14 | 2 | require('./index147.js'); |
3 | //·Internal·wrapper·for·`_.toPath`·to·enable·minification. | 3 | //·Internal·wrapper·for·`_.toPath`·to·enable·minification. |
4 | //·Similar·to·`cb`·for·`_.iteratee`. | 4 | //·Similar·to·`cb`·for·`_.iteratee`. |
5 | function·toPath(path)·{ | 5 | function·toPath(path)·{ |
6 | ····return·underscore.toPath(path); | 6 | ····return·underscore.toPath(path); |
7 | } | 7 | } |
Offset 1, 7 lines modified | Offset 1, 7 lines modified | ||
1 | var·invert·=·require('./index7 | 1 | var·invert·=·require('./index75.js'); |
2 | var·_escapeMap·=·require('./index1 | 2 | var·_escapeMap·=·require('./index12.js'); |
3 | //·Internal·list·of·HTML·entities·for·unescaping. | 3 | //·Internal·list·of·HTML·entities·for·unescaping. |
4 | var·unescapeMap·=·invert(_escapeMap); | 4 | var·unescapeMap·=·invert(_escapeMap); |
5 | module.exports·=·unescapeMap; | 5 | module.exports·=·unescapeMap; |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | var·isObject·=·require('./index9 | 1 | var·isObject·=·require('./index94.js'); |
2 | var·_setup·=·require('./index26.js'); | 2 | var·_setup·=·require('./index26.js'); |
3 | var·_collectNonEnumProps·=·require('./index5.js'); | 3 | var·_collectNonEnumProps·=·require('./index5.js'); |
4 | //·Retrieve·all·the·enumerable·property·names·of·an·object. | 4 | //·Retrieve·all·the·enumerable·property·names·of·an·object. |
5 | function·allKeys(obj)·{ | 5 | function·allKeys(obj)·{ |
6 | ····if·(!isObject(obj))·return·[]; | 6 | ····if·(!isObject(obj))·return·[]; |
7 | ····var·keys·=·[]; | 7 | ····var·keys·=·[]; |
Offset 1, 9 lines modified | Offset 1, 9 lines modified | ||
1 | var·restArguments·=·require('./index133.js'); | 1 | var·restArguments·=·require('./index133.js'); |
2 | var·isFunction·=·require('./index8 | 2 | var·isFunction·=·require('./index88.js'); |
3 | var·_executeBound·=·require('./index14.js'); | 3 | var·_executeBound·=·require('./index14.js'); |
4 | //·Create·a·function·bound·to·a·given·object·(assigning·`this`,·and·arguments, | 4 | //·Create·a·function·bound·to·a·given·object·(assigning·`this`,·and·arguments, |
5 | //·optionally). | 5 | //·optionally). |
6 | var·bind·=·restArguments(function(func,·context,·args)·{ | 6 | var·bind·=·restArguments(function(func,·context,·args)·{ |
7 | ····if·(!isFunction(func))·throw·new·TypeError('Bind·must·be·called·on·a·function'); | 7 | ····if·(!isFunction(func))·throw·new·TypeError('Bind·must·be·called·on·a·function'); |
8 | ····var·bound·=·restArguments(function(callArgs)·{ | 8 | ····var·bound·=·restArguments(function(callArgs)·{ |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | var·underscore·=·require('./index1 | 1 | var·underscore·=·require('./index150.js'); |
2 | //·Start·chaining·a·wrapped·Underscore·object. | 2 | //·Start·chaining·a·wrapped·Underscore·object. |
3 | function·chain(obj)·{ | 3 | function·chain(obj)·{ |
4 | ····var·instance·=·underscore(obj); | 4 | ····var·instance·=·underscore(obj); |
5 | ····instance._chain·=·true; | 5 | ····instance._chain·=·true; |
6 | ····return·instance; | 6 | ····return·instance; |
7 | } | 7 | } |
Offset 1, 11 lines modified | Offset 1, 16 lines modified | ||
1 | var· | 1 | var·_setup·=·require('./index26.js'); |
2 | var·isArray·=·require('./index74.js'); | ||
3 | var·extend·=·require('./index54.js'); | ||
4 | //·Create·a·(shallow-cloned)·duplicate·of·an·object. | ||
5 | function·clone(obj)·{ | ||
6 | ····if·(!isObject(obj))·return·obj; | ||
7 | 2 | //·Chunk·a·single·array·into·multiple·arrays,·each·containing·`count`·or·fewer | |
3 | //·items. | ||
4 | function·chunk(array,·count)·{ | ||
5 | ····if·(count·==·null·||·count·<·1)·return·[]; | ||
6 | ····var·result·=·[]; | ||
7 | ····var·i·=·0, | ||
8 | ········length·=·array.length; | ||
9 | ····while·(i·<·length)·{ | ||
10 | ········result.push(_setup.slice.call(array,·i,·i·+=·count)); | ||
11 | ····} | ||
12 | ····return·result; | ||
8 | } | 13 | } |
9 | module.exports·=·c | 14 | module.exports·=·chunk; |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | var·underscore·=·require('./index1 | 1 | var·underscore·=·require('./index150.js'); |
2 | //·Helper·function·to·continue·chaining·intermediate·results. | 2 | //·Helper·function·to·continue·chaining·intermediate·results. |
3 | function·chainResult(instance,·obj)·{ | 3 | function·chainResult(instance,·obj)·{ |
4 | ····return·instance._chain·?·underscore(obj).chain()·:·obj; | 4 | ····return·instance._chain·?·underscore(obj).chain()·:·obj; |
5 | } | 5 | } |
6 | module.exports·=·chainResult; | 6 | module.exports·=·chainResult; |
Offset 1, 8 lines modified | Offset 1, 11 lines modified | ||
1 | var·isObject·=·require('./index94.js'); | ||
2 | var·isArray·=·require('./index78.js'); | ||
1 | var· | 3 | var·extend·=·require('./index54.js'); |
2 | //·Trim·out·all·falsy·values·from·an·array. | ||
3 | function·compact(array)·{ | ||
4 | 4 | //·Create·a·(shallow-cloned)·duplicate·of·an·object. | |
5 | function·clone(obj)·{ | ||
6 | ····if·(!isObject(obj))·return·obj; | ||
7 | ····return·isArray(obj)·?·obj.slice()·:·extend({},·obj); | ||
5 | } | 8 | } |
6 | module.exports·=·c | 9 | module.exports·=·clone; |
Offset 1, 14 lines modified | Offset 1, 8 lines modified | ||
1 | //·Returns·a·function·that·is·the·composition·of·a·list·of·functions,·each | ||
2 | 1 | var·filter·=·require('./index56.js'); | |
2 | //·Trim·out·all·falsy·values·from·an·array. | ||
3 | function·comp | 3 | function·compact(array)·{ |
4 | ····return·filter(array,·Boolean); | ||
4 | ····var·args·=·arguments; | ||
5 | ····var·start·=·args.length·-·1; | ||
6 | ····return·function()·{ | ||
7 | ········var·i·=·start; | ||
8 | ········var·result·=·args[start].apply(this,·arguments); | ||
9 | ········while·(i--)·result·=·args[i].call(this,·result); | ||
10 | ········return·result; | ||
11 | ····}; | ||
12 | } | 5 | } |
13 | module.exports·=·comp | 6 | module.exports·=·compact; |
Offset 1, 8 lines modified | Offset 1, 14 lines modified | ||
1 | //·Predicate-generating·function.·Often·useful·outside·of·Underscore. | ||
2 | function·co | 1 | //·Returns·a·function·that·is·the·composition·of·a·list·of·functions,·each |
2 | //·consuming·the·return·value·of·the·function·that·follows. | ||
3 | function·compose()·{ | ||
4 | ····var·args·=·arguments; | ||
5 | ····var·start·=·args.length·-·1; | ||
3 | ····return·function()·{ | 6 | ····return·function()·{ |
7 | ········var·i·=·start; | ||
8 | ········var·result·=·args[start].apply(this,·arguments); | ||
9 | ········while·(i--)·result·=·args[i].call(this,·result); | ||
4 | ········return· | 10 | ········return·result; |
5 | ····}; | 11 | ····}; |
6 | } | 12 | } |
7 | module.exports·=·co | 13 | module.exports·=·compose; |
Offset 1, 12 lines modified | Offset 1, 8 lines modified | ||
1 | //·Predicate-generating·function.·Often·useful·outside·of·Underscore. | ||
2 | function·constant(value)·{ | ||
3 | ····return·function()·{ | ||
4 | ········return·value; | ||
5 | ····}; | ||
1 | var·_isArrayLike·=·require('./index21.js'); | ||
2 | var·values·=·require('./index154.js'); | ||
3 | var·indexOf·=·require('./index68.js'); | ||
4 | //·Determine·if·the·array·or·object·contains·a·given·item·(using·`===`). | ||
5 | function·contains(obj,·item,·fromIndex,·guard)·{ | ||
6 | ····if·(!_isArrayLike(obj))·obj·=·values(obj); | ||
7 | ····if·(typeof·fromIndex·!=·'number'·||·guard)·fromIndex·=·0; | ||
8 | ····return·indexOf(obj,·item,·fromIndex)·>=·0; | ||
9 | } | 6 | } |
10 | module.exports·=·conta | 7 | module.exports·=·constant; |
Offset 1, 12 lines modified | Offset 1, 12 lines modified | ||
1 | var·_ | 1 | var·_isArrayLike·=·require('./index21.js'); |
2 | var· | 2 | var·values·=·require('./index155.js'); |
3 | var·indexOf·=·require('./index73.js'); | ||
4 | //·Determine·if·the·array·or·object·contains·a·given·item·(using·`===`). | ||
5 | function·contains(obj,·item,·fromIndex,·guard)·{ | ||
6 | ····if·(!_isArrayLike(obj))·obj·=·values(obj); | ||
7 | ····if·(typeof·fromIndex·!=·'number'·||·guard)·fromIndex·=·0; | ||
8 | ····return·indexOf(obj,·item,·fromIndex)·>=·0; | ||
9 | } | ||
3 | //·Counts·instances·of·an·object·that·group·by·a·certain·criterion.·Pass | ||
4 | //·either·a·string·attribute·to·count·by,·or·a·function·that·returns·the | ||
5 | //·criterion. | ||
6 | var·countBy·=·_group(function(result,·value,·key)·{ | ||
7 | ····if·(_has(result,·key))·result[key]++; | ||
8 | ····else·result[key]·=·1; | ||
9 | }); | ||
10 | module.exports·=·co | 10 | module.exports·=·contains; |
Offset 1, 13 lines modified | Offset 1, 12 lines modified | ||
1 | var·_group·=·require('./index18.js'); | ||
1 | var·_ | 2 | var·_has·=·require('./index19.js'); |
2 | var·extendOwn·=·require('./index59.js'); | ||
3 | //·Counts·instances·of·an·object·that·group·by·a·certain·criterion.·Pass | ||
4 | //·either·a·string·attribute·to·count·by,·or·a·function·that·returns·the | ||
5 | //·criterion. | ||
6 | var·countBy·=·_group(function(result,·value,·key)·{ | ||
7 | ····if·(_has(result,·key))·result[key]++; | ||
8 | ····else·result[key]·=·1; | ||
9 | }); | ||
3 | //·Creates·an·object·that·inherits·from·the·given·prototype·object. | ||
4 | //·If·additional·properties·are·provided·then·they·will·be·added·to·the | ||
5 | //·created·object. | ||
6 | function·create(prototype,·props)·{ | ||
7 | ····var·result·=·_baseCreate(prototype); | ||
8 | ····if·(props)·extendOwn(result,·props); | ||
9 | ····return·result; | ||
10 | } | ||
11 | module.exports·=·c | 10 | module.exports·=·countBy; |
Offset 1, 42 lines modified | Offset 1, 13 lines modified | ||
1 | var· | 1 | var·_baseCreate·=·require('./index.js'); |
2 | var·n | 2 | var·extendOwn·=·require('./index55.js'); |
3 | //·Creates·an·object·that·inherits·from·the·given·prototype·object. | ||
4 | //·If·additional·properties·are·provided·then·they·will·be·added·to·the | ||
5 | //·created·object. | ||
6 | function·create(prototype,·props)·{ | ||
7 | ····var·result·=·_baseCreate(prototype); | ||
8 | ····if·(props)·extendOwn(result,·props); | ||
3 | //·When·a·sequence·of·calls·of·the·returned·function·ends,·the·argument | ||
4 | //·function·is·triggered.·The·end·of·a·sequence·is·defined·by·the·`wait` | ||
5 | //·parameter.·If·`immediate`·is·passed,·the·argument·function·will·be | ||
6 | //·triggered·at·the·beginning·of·the·sequence·instead·of·at·the·end. | ||
7 | function·debounce(func,·wait,·immediate)·{ | ||
8 | ····var·timeout,·previous,·args,·result,·context; | ||
9 | ····var·later·=·function()·{ | ||
10 | ········var·passed·=·now()·-·previous; | ||
11 | ········if·(wait·>·passed)·{ | ||
12 | ············timeout·=·setTimeout(later,·wait·-·passed); | ||
13 | ········}·else·{ | ||
14 | ············timeout·=·null; | ||
15 | ············if·(!immediate)·result·=·func.apply(context,·args); | ||
16 | ············//·This·check·is·needed·because·`func`·can·recursively·invoke·`debounced`. | ||
17 | ············if·(!timeout)·args·=·context·=·null; | ||
18 | ········} | ||
19 | ····}; | ||
20 | ····var·debounced·=·restArguments(function(_args)·{ | ||
21 | ········context·=·this; | ||
22 | ········args·=·_args; | ||
23 | ········previous·=·now(); | ||
24 | ········if·(!timeout)·{ | ||
25 | ············timeout·=·setTimeout(later,·wait); | ||
26 | ············if·(immediate)·result·=·func.apply(context,·args); | ||
27 | ········} | ||
28 | ···· | 9 | ····return·result; |
29 | ····}); | ||
30 | ····debounced.cancel·=·function()·{ | ||
31 | ········clearTimeout(timeout); | ||
32 | ········timeout·=·args·=·context·=·null; | ||
33 | ····}; | ||
34 | ····return·debounced; | ||
35 | } | 10 | } |
36 | module.exports·=· | 11 | module.exports·=·create; |
Offset 1, 9 lines modified | Offset 1, 9 lines modified | ||
1 | var·partial·=·require('./index1 | 1 | var·partial·=·require('./index121.js'); |
2 | var·delay·=·require('./index49.js'); | 2 | var·delay·=·require('./index49.js'); |
3 | var·underscore·=·require('./index1 | 3 | var·underscore·=·require('./index150.js'); |
4 | //·Defers·a·function,·scheduling·it·to·run·after·the·current·call·stack·has | 4 | //·Defers·a·function,·scheduling·it·to·run·after·the·current·call·stack·has |
5 | //·cleared. | 5 | //·cleared. |
6 | var·defer·=·partial(delay,·underscore,·1); | 6 | var·defer·=·partial(delay,·underscore,·1); |
7 | module.exports·=·defer; | 7 | module.exports·=·defer; |
Offset 1, 9 lines modified | Offset 1, 9 lines modified | ||
1 | var·_setup·=·require('./index26.js'); | 1 | var·_setup·=·require('./index26.js'); |
2 | var·isFunction·=·require('./index8 | 2 | var·isFunction·=·require('./index88.js'); |
3 | var·_has·=·require('./index19.js'); | 3 | var·_has·=·require('./index19.js'); |
4 | //·Internal·helper·to·create·a·simple·lookup·structure. | 4 | //·Internal·helper·to·create·a·simple·lookup·structure. |
5 | //·`collectNonEnumProps`·used·to·depend·on·`_.contains`,·but·this·led·to | 5 | //·`collectNonEnumProps`·used·to·depend·on·`_.contains`,·but·this·led·to |
6 | //·circular·imports.·`emulatedSet`·is·a·one-off·solution·that·only·works·for | 6 | //·circular·imports.·`emulatedSet`·is·a·one-off·solution·that·only·works·for |
7 | //·arrays·of·strings. | 7 | //·arrays·of·strings. |
8 | function·emulatedSet(keys)·{ | 8 | function·emulatedSet(keys)·{ |
Offset 1, 11 lines modified | Offset 1, 11 lines modified | ||
1 | var·restArguments·=·require('./index133.js'); | 1 | var·restArguments·=·require('./index133.js'); |
2 | var·_flatten·=·require('./index15.js'); | 2 | var·_flatten·=·require('./index15.js'); |
3 | var·filter·=·require('./index5 | 3 | var·filter·=·require('./index56.js'); |
4 | var·contains·=·require('./index4 | 4 | var·contains·=·require('./index44.js'); |
5 | //·Take·the·difference·between·one·array·and·a·number·of·other·arrays. | 5 | //·Take·the·difference·between·one·array·and·a·number·of·other·arrays. |
6 | //·Only·the·elements·present·in·just·the·first·array·will·remain. | 6 | //·Only·the·elements·present·in·just·the·first·array·will·remain. |
7 | var·difference·=·restArguments(function(array,·rest)·{ | 7 | var·difference·=·restArguments(function(array,·rest)·{ |
8 | ····rest·=·_flatten(rest,·true,·true); | 8 | ····rest·=·_flatten(rest,·true,·true); |
9 | ····return·filter(array,·function(value)·{ | 9 | ····return·filter(array,·function(value)·{ |
10 | ········return·!contains(rest,·value); | 10 | ········return·!contains(rest,·value); |
Offset 1, 10 lines modified | Offset 1, 10 lines modified | ||
1 | var·_optimizeCb·=·require('./index25.js'); | 1 | var·_optimizeCb·=·require('./index25.js'); |
2 | var·_isArrayLike·=·require('./index21.js'); | 2 | var·_isArrayLike·=·require('./index21.js'); |
3 | var·keys·=·require('./index1 | 3 | var·keys·=·require('./index149.js'); |
4 | //·The·cornerstone·for·collection·functions,·an·`each` | 4 | //·The·cornerstone·for·collection·functions,·an·`each` |
5 | //·implementation,·aka·`forEach`. | 5 | //·implementation,·aka·`forEach`. |
6 | //·Handles·raw·objects·in·addition·to·array-likes.·Treats·all | 6 | //·Handles·raw·objects·in·addition·to·array-likes.·Treats·all |
7 | //·sparse·array-likes·as·if·they·were·dense. | 7 | //·sparse·array-likes·as·if·they·were·dense. |
8 | function·each(obj,·iteratee,·context)·{ | 8 | function·each(obj,·iteratee,·context)·{ |
9 | ····iteratee·=·_optimizeCb(iteratee,·context); | 9 | ····iteratee·=·_optimizeCb(iteratee,·context); |
Offset 1, 7 lines modified | Offset 1, 7 lines modified | ||
1 | var·_createEscaper·=·require('./index7.js'); | 1 | var·_createEscaper·=·require('./index7.js'); |
2 | var·_escapeMap·=·require('./index1 | 2 | var·_escapeMap·=·require('./index12.js'); |
3 | //·Function·for·escaping·strings·to·HTML·interpolation. | 3 | //·Function·for·escaping·strings·to·HTML·interpolation. |
4 | var·escape·=·_createEscaper(_escapeMap); | 4 | var·escape·=·_createEscaper(_escapeMap); |
5 | module.exports·=·escape; | 5 | module.exports·=·escape; |
Offset 1, 10 lines modified | Offset 1, 10 lines modified | ||
1 | var·_cb·=·require('./index3.js'); | 1 | var·_cb·=·require('./index3.js'); |
2 | var·_isArrayLike·=·require('./index21.js'); | 2 | var·_isArrayLike·=·require('./index21.js'); |
3 | var·keys·=·require('./index1 | 3 | var·keys·=·require('./index149.js'); |
4 | //·Determine·whether·all·of·the·elements·pass·a·truth·test. | 4 | //·Determine·whether·all·of·the·elements·pass·a·truth·test. |
5 | function·every(obj,·predicate,·context)·{ | 5 | function·every(obj,·predicate,·context)·{ |
6 | ····predicate·=·_cb(predicate,·context); | 6 | ····predicate·=·_cb(predicate,·context); |
7 | ····var·_keys·=·!_isArrayLike(obj)·&&·keys(obj), | 7 | ····var·_keys·=·!_isArrayLike(obj)·&&·keys(obj), |
8 | ········length·=·(_keys·||·obj).length; | 8 | ········length·=·(_keys·||·obj).length; |
9 | ····for·(var·index·=·0;·index·<·length;·index++)·{ | 9 | ····for·(var·index·=·0;·index·<·length;·index++)·{ |
Offset 1, 14 lines modified | Offset 1, 9 lines modified | ||
1 | var·_c | 1 | var·_createAssigner·=·require('./index6.js'); |
2 | var· | 2 | var·keys·=·require('./index149.js'); |
3 | //·Assigns·a·given·object·with·all·the·own·properties·in·the·passed-in | ||
4 | //·object(s). | ||
5 | //·(https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) | ||
6 | var·extendOwn·=·_createAssigner(keys); | ||
3 | //·Return·all·the·elements·that·pass·a·truth·test. | ||
4 | function·filter(obj,·predicate,·context)·{ | ||
5 | ····var·results·=·[]; | ||
6 | ····predicate·=·_cb(predicate,·context); | ||
7 | ····each(obj,·function(value,·index,·list)·{ | ||
8 | ········if·(predicate(value,·index,·list))·results.push(value); | ||
9 | ····}); | ||
10 | ····return·results; | ||
11 | } | ||
12 | module.exports·=· | 7 | module.exports·=·extendOwn; |
Offset 1, 12 lines modified | Offset 1, 14 lines modified | ||
1 | var·_isArrayLike·=·require('./index21.js'); | ||
2 | var· | 1 | var·_cb·=·require('./index3.js'); |
3 | var· | 2 | var·each·=·require('./index51.js'); |
4 | //·Return· | 3 | //·Return·all·the·elements·that·pass·a·truth·test. |
5 | function·fi | 4 | function·filter(obj,·predicate,·context)·{ |
6 | ····var·keyFinder·=·_isArrayLike(obj)·?·findIndex·:·findKey; | ||
7 | ····var·key·=·keyFinder(obj,·predicate,·context); | ||
8 | ···· | 5 | ····var·results·=·[]; |
6 | ····predicate·=·_cb(predicate,·context); | ||
7 | ····each(obj,·function(value,·index,·list)·{ | ||
8 | ········if·(predicate(value,·index,·list))·results.push(value); | ||
9 | ····}); | ||
10 | ····return·results; | ||
9 | } | 11 | } |
10 | module.exports·=·fi | 12 | module.exports·=·filter; |
Offset 1, 6 lines modified | Offset 1, 12 lines modified | ||
1 | var·_ | 1 | var·_isArrayLike·=·require('./index21.js'); |
2 | var·findIndex·=·require('./index58.js'); | ||
3 | var·findKey·=·require('./index59.js'); | ||
2 | //·Return | 4 | //·Return·the·first·value·which·passes·a·truth·test. |
3 | 5 | function·find(obj,·predicate,·context)·{ | |
6 | ····var·keyFinder·=·_isArrayLike(obj)·?·findIndex·:·findKey; | ||
7 | ····var·key·=·keyFinder(obj,·predicate,·context); | ||
8 | ····if·(key·!==·void·0·&&·key·!==·-1)·return·obj[key]; | ||
9 | } | ||
4 | module.exports·=·find | 10 | module.exports·=·find; |
Offset 1, 15 lines modified | Offset 1, 6 lines modified | ||
1 | var·_createPredicateIndexFinder·=·require('./index9.js'); | ||
1 | var·_cb·=·require('./index3.js'); | ||
2 | var·keys·=·require('./index100.js'); | ||
3 | //·Returns·the·first· | 2 | //·Returns·the·first·index·on·an·array-like·that·passes·a·truth·test. |
3 | var·findIndex·=·_createPredicateIndexFinder(1); | ||
4 | function·findKey(obj,·predicate,·context)·{ | ||
5 | ····predicate·=·_cb(predicate,·context); | ||
6 | ····var·_keys·=·keys(obj), | ||
7 | ········key; | ||
8 | ····for·(var·i·=·0,·length·=·_keys.length;·i·<·length;·i++)·{ | ||
9 | ········key·=·_keys[i]; | ||
10 | ········if·(predicate(obj[key],·key,·obj))·return·key; | ||
11 | ····} | ||
12 | } | ||
13 | module.exports·=·find | 4 | module.exports·=·findIndex; |
Offset 1, 9 lines modified | Offset 1, 15 lines modified | ||
1 | var·_c | 1 | var·_cb·=·require('./index3.js'); |
2 | var·keys·=·require('./index1 | 2 | var·keys·=·require('./index149.js'); |
3 | //·Assigns·a·given·object·with·all·the·own·properties·in·the·passed-in | ||
4 | //·object(s). | ||
5 | //·(https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) | ||
6 | 3 | //·Returns·the·first·key·on·an·object·that·passes·a·truth·test. | |
4 | function·findKey(obj,·predicate,·context)·{ | ||
5 | ····predicate·=·_cb(predicate,·context); | ||
6 | ····var·_keys·=·keys(obj), | ||
7 | ········key; | ||
8 | ····for·(var·i·=·0,·length·=·_keys.length;·i·<·length;·i++)·{ | ||
9 | ········key·=·_keys[i]; | ||
10 | ········if·(predicate(obj[key],·key,·obj))·return·key; | ||
11 | ····} | ||
12 | } | ||
7 | module.exports·=· | 13 | module.exports·=·findKey; |
Offset 1, 9 lines modified | Offset 1, 9 lines modified | ||
1 | var·find·=·require('./index5 | 1 | var·find·=·require('./index57.js'); |
2 | var·matcher·=·require('./index1 | 2 | var·matcher·=·require('./index110.js'); |
3 | //·Convenience·version·of·a·common·use·case·of·`_.find`:·getting·the·first | 3 | //·Convenience·version·of·a·common·use·case·of·`_.find`:·getting·the·first |
4 | //·object·containing·specific·`key:value`·pairs. | 4 | //·object·containing·specific·`key:value`·pairs. |
5 | function·findWhere(obj,·attrs)·{ | 5 | function·findWhere(obj,·attrs)·{ |
6 | ····return·find(obj,·matcher(attrs)); | 6 | ····return·find(obj,·matcher(attrs)); |
7 | } | 7 | } |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | var·initial·=·require('./index | 1 | var·initial·=·require('./index72.js'); |
2 | //·Get·the·first·element·of·an·array.·Passing·**n**·will·return·the·first·N | 2 | //·Get·the·first·element·of·an·array.·Passing·**n**·will·return·the·first·N |
3 | //·values·in·the·array.·The·**guard**·check·allows·it·to·work·with·`_.map`. | 3 | //·values·in·the·array.·The·**guard**·check·allows·it·to·work·with·`_.map`. |
4 | function·first(array,·n,·guard)·{ | 4 | function·first(array,·n,·guard)·{ |
5 | ····if·(array·==·null·||·array.length·<·1)·return·n·==·null·||·guard·?·void·0·:·[]; | 5 | ····if·(array·==·null·||·array.length·<·1)·return·n·==·null·||·guard·?·void·0·:·[]; |
6 | ····if·(n·==·null·||·guard)·return·array[0]; | 6 | ····if·(n·==·null·||·guard)·return·array[0]; |
7 | ····return·initial(array,·array.length·-·n); | 7 | ····return·initial(array,·array.length·-·n); |
Offset 1, 18 lines modified | Offset 1, 9 lines modified | ||
1 | var·_ | 1 | var·_flatten·=·require('./index15.js'); |
2 | var·_toPath·=·require('./index31.js'); | ||
2 | //·Flatten·out·an·array,·either·recursively·(by·default),·or·up·to·`depth`. | ||
3 | //·Passing·`true`·or·`false`·as·`depth`·means·`1`·or·`Infinity`,·respectively. | ||
4 | function·flatten(array,·depth)·{ | ||
5 | ····return·_flatten(array,·depth,·false); | ||
3 | //·Shortcut·function·for·checking·if·an·object·has·a·given·property·directly·on | ||
4 | //·itself·(in·other·words,·not·on·a·prototype).·Unlike·the·internal·`has` | ||
5 | //·function,·this·public·version·can·also·traverse·nested·properties. | ||
6 | function·has(obj,·path)·{ | ||
7 | ····path·=·_toPath(path); | ||
8 | ····var·length·=·path.length; | ||
9 | ····for·(var·i·=·0;·i·<·length;·i++)·{ | ||
10 | ········var·key·=·path[i]; | ||
11 | ········if·(!_has(obj,·key))·return·false; | ||
12 | ········obj·=·obj[key]; | ||
13 | ····} | ||
14 | ····return·!!length; | ||
15 | } | 6 | } |
16 | module.exports·=· | 7 | module.exports·=·flatten; |
Offset 1, 6 lines modified | Offset 1, 12 lines modified | ||
1 | //·Keep·the·identity·function·around·for·default·iteratees. | ||
2 | function·identity(value)·{ | ||
3 | ·· | 1 | var·isFunction·=·require('./index88.js'); |
2 | //·Return·a·sorted·list·of·the·function·names·available·on·the·object. | ||
3 | function·functions(obj)·{ | ||
4 | ····var·names·=·[]; | ||
5 | ····for·(var·key·in·obj)·{ | ||
6 | ········if·(isFunction(obj[key]))·names.push(key); | ||
7 | ····} | ||
8 | ····return·names.sort(); | ||
4 | } | 9 | } |
5 | module.exports·=· | 10 | module.exports·=·functions; |
Offset 1, 28 lines modified | Offset 1, 14 lines modified | ||
1 | var·_toPath·=·require('./index31.js'); | ||
1 | var· | 2 | var·_deepGet·=·require('./index13.js'); |
2 | var· | 3 | var·isUndefined·=·require('./index100.js'); |
4 | //·Get·the·value·of·the·(deep)·property·on·`path`·from·`object`. | ||
5 | //·If·any·property·in·`path`·does·not·exist·or·if·the·value·is | ||
6 | //·`undefined`,·return·`defaultValue`·instead. | ||
7 | //·The·`path`·is·normalized·through·`_.toPath`. | ||
8 | function·get(object,·path,·defaultValue)·{ | ||
9 | ····var·value·=·_deepGet(object,·_toPath(path)); | ||
10 | ····return·isUndefined(value)·?·defaultValue·:·value; | ||
11 | } | ||
3 | //·Default·Export | ||
4 | //·============== | ||
5 | //·In·this·module,·we·mix·our·bundled·exports·into·the·`_`·object·and·export | ||
6 | //·the·result.·This·is·analogous·to·setting·`module.exports·=·_`·in·CommonJS. | ||
7 | //·Hence,·this·module·is·also·the·entry·point·of·our·UMD·bundle·and·the·package | ||
8 | //·entry·point·for·CommonJS·and·AMD·users.·In·other·words,·this·is·(the·source | ||
9 | //·of)·the·module·you·are·interfacing·with·when·you·do·any·of·the·following: | ||
10 | // | ||
11 | //·```js | ||
12 | //·//·CommonJS | ||
13 | //·var·_·=·require('underscore'); | ||
14 | // | ||
15 | //·//·AMD | ||
16 | //·define(['underscore'],·function(_)·{...}); | ||
17 | // | ||
18 | //·//·UMD·in·the·browser | ||
19 | //·//·_·is·available·as·a·global·variable | ||
20 | //·``` | ||
21 | //·Add·all·of·the·Underscore·functions·to·the·wrapper·object. | ||
22 | var·_·=·mixin(index); | ||
23 | //·Legacy·Node.js·API. | ||
24 | _._·=·_; | ||
25 | module.exports·=· | 12 | module.exports·=·get; |
Offset 1, 281 lines modified | Offset 1, 11 lines modified | ||
1 | Object.defineProperty(exports,·'__esModule',·{ | ||
2 | ····value:·true | ||
3 | }); | ||
4 | var·_ | 1 | var·_group·=·require('./index18.js'); |
5 | var·restArguments·=·require('./index133.js'); | ||
6 | var·isObject·=·require('./index90.js'); | ||
7 | var·isNull·=·require('./index88.js'); | ||
8 | var·isUndefined·=·require('./index96.js'); | ||
9 | var·isBoolean·=·require('./index76.js'); | ||
10 | var·isElement·=·require('./index79.js'); | ||
11 | var·isString·=·require('./index93.js'); | ||
12 | var·isNumber·=·require('./index89.js'); | ||
13 | var·isDate·=·require('./index78.js'); | ||
14 | var·isRegExp·=·require('./index91.js'); | ||
15 | var·isError·=·require('./index82.js'); | ||
16 | var·isSymbol·=·require('./index94.js'); | ||
17 | var·isArrayBuffer·=·require('./index75.js'); | ||
18 | var·isDataView·=·require('./index77.js'); | ||
19 | var·isArray·=·require('./index74.js'); | ||
20 | var·isFunction·=·require('./index84.js'); | ||
21 | var·isArguments·=·require('./index73.js'); | ||
22 | var·isFinite·=·require('./index83.js'); | ||
23 | var·isNaN·=·require('./index87.js'); | ||
24 | var·isTypedArray·=·require('./index95.js'); | ||
25 | var·isEmpty·=·require('./index80.js'); | ||
26 | var·isMatch·=·require('./index86.js'); | ||
27 | var·isEqual·=·require('./index81.js'); | ||
28 | var·isMap·=·require('./index85.js'); | ||
29 | var·isWeakMap·=·require('./index97.js'); | ||
30 | var·isSet·=·require('./index92.js'); | ||
31 | var·isWeakSet·=·require('./index98.js'); | ||
32 | var·keys·=·require('./index100.js'); | ||
33 | var·allKeys·=·require('./index34.js'); | ||
34 | var·values·=·require('./index154.js'); | ||
35 | var·pairs·=·require('./index116.js'); | ||
36 | var·invert·=·require('./index71.js'); | ||
37 | var·functions·=·require('./index129.js'); | ||
38 | var·extend·=·require('./index54.js'); | ||
39 | var·extendOwn·=·require('./index59.js'); | ||
40 | var·defaults·=·require('./index47.js'); | ||
41 | var·create·=·require('./index45.js'); | ||
42 | var·clone·=·require('./index39.js'); | ||
43 | var·tap·=·require('./index140.js'); | ||
44 | var·get·=·require('./index130.js'); | ||
45 | var·has·=·require('./index | 2 | var·_has·=·require('./index19.js'); |
46 | var·mapObject·=·require('./index104.js'); | ||
47 | var·identity·=·require('./index64.js'); | ||
48 | var·constant·=·require('./index42.js'); | ||
49 | var·noop·=·require('./index111.js'); | ||
50 | var·toPath·=·require('./index148.js'); | ||
51 | var·property·=·require('./index121.js'); | ||
52 | var·propertyOf·=·require('./index122.js'); | ||
53 | var·matcher·=·require('./index105.js'); | ||
54 | var·times·=·require('./index145.js'); | ||
55 | var·random·=·require('./index123.js'); | ||
56 | var·now·=·require('./index112.js'); | ||
57 | var·escape·=·require('./index52.js'); | ||
58 | var·unescape·=·require('./index150.js'); | ||
59 | var·templateSettings·=·require('./index143.js'); | ||
60 | var·template·=·require('./index142.js'); | ||
61 | var·result·=·require('./index134.js'); | ||
62 | var·uniqueId·=·require('./index152.js'); | ||
63 | var·chain·=·require('./index38.js'); | ||
64 | var·iteratee·=·require('./index99.js'); | ||
65 | var·partial·=·require('./index117.js'); | ||
66 | var·bind·=·require('./index36.js'); | ||
67 | var·bindAll·=·require('./index37.js'); | ||
68 | var·memoize·=·require('./index107.js'); | ||
69 | var·delay·=·require('./index49.js'); | ||
70 | var·defer·=·require('./index48.js'); | ||
71 | var·throttle·=·require('./index144.js'); | ||
72 | var·debounce·=·require('./index46.js'); | ||
73 | var·wrap·=·require('./index157.js'); | ||
74 | var·negate·=·require('./index110.js'); | ||
75 | var·compose·=·require('./index41.js'); | ||
76 | var·after·=·require('./index33.js'); | ||
77 | var·before·=·require('./index35.js'); | ||
78 | var·once·=·require('./index115.js'); | ||
79 | var·findKey·=·require('./index58.js'); | ||
80 | var·findIndex·=·require('./index57.js'); | ||
81 | var·findLastIndex·=·require('./index60.js'); | ||
82 | var·sortedIndex·=·require('./index139.js'); | ||
83 | var·indexOf·=·require('./index68.js'); | ||
84 | var·lastIndexOf·=·require('./index102.js'); | ||
85 | var·find·=·require('./index56.js'); | ||
86 | var·findWhere·=·require('./index61.js'); | ||
87 | var·each·=·require('./index51.js'); | ||
88 | var·map·=·require('./index103.js'); | ||
89 | var·reduce·=·require('./index125.js'); | ||
90 | var·reduceRight·=·require('./index126.js'); | ||
91 | var·filter·=·require('./index55.js'); | ||
92 | var·reject·=·require('./index127.js'); | ||
93 | var·every·=·require('./index53.js'); | ||
94 | var·some·=·require('./index138.js'); | ||
95 | var·contains·=·require('./index43.js'); | ||
96 | var·invoke·=·require('./index72.js'); | ||
97 | var·pluck·=·require('./index120.js'); | ||
98 | var·where·=·require('./index155.js'); | ||
99 | var·max·=·require('./index106.js'); | ||
100 | var·min·=·require('./index108.js'); | ||
101 | var·shuffle·=·require('./index136.js'); | ||
102 | var·sample·=·require('./index135.js'); | ||
103 | var·sortBy·=·require('./index141.js'); | ||
104 | var·groupBy·=·require('./index131.js'); | ||
105 | var·indexBy·=·require('./index67.js'); | ||
106 | var·countBy·=·require('./index44.js'); | ||
107 | var·partition·=·require('./index118.js'); | ||
108 | var·toArray·=·require('./index146.js'); | ||
109 | var·size·=·require('./index137.js'); | ||
110 | var·pick·=·require('./index119.js'); | ||
111 | var·omit·=·require('./index114.js'); | ||
112 | var·first·=·require('./index62.js'); | ||
113 | var·initial·=·require('./index69.js'); | ||
114 | var·last·=·require('./index101.js'); | ||
115 | var·rest·=·require('./index132.js'); | ||
116 | var·compact·=·require('./index40.js'); | ||
117 | var·flatten·=·require('./index128.js'); | ||
118 | var·without·=·require('./index156.js'); | ||
119 | var·uniq·=·require('./index151.js'); | ||
120 | var·union·=·require('./index160.js'); | ||
121 | var·intersection·=·require('./index70.js'); | ||
122 | var·difference·=·require('./index50.js'); | ||
123 | var·unzip·=·require('./index153.js'); | ||
124 | var·zip·=·require('./index158.js'); | ||
125 | var·object·=·require('./index113.js'); | ||
126 | var·range·=·require('./index124.js'); | ||
Max diff block lines reached; 4345/9618 bytes (45.18%) of diff not shown. |
Offset 1, 9 lines modified | Offset 1, 18 lines modified | ||
1 | var·_ | 1 | var·_has·=·require('./index19.js'); |
2 | var·_toPath·=·require('./index31.js'); | ||
2 | //·Indexes·the·object's·values·by·a·criterion,·similar·to·`_.groupBy`,·but·for | ||
3 | //·when·you·know·that·your·index·values·will·be·unique. | ||
4 | var·indexBy·=·_group(function(result,·value,·key)·{ | ||
5 | ····result[key]·=·value; | ||
6 | 3 | //·Shortcut·function·for·checking·if·an·object·has·a·given·property·directly·on | |
4 | //·itself·(in·other·words,·not·on·a·prototype).·Unlike·the·internal·`has` | ||
5 | //·function,·this·public·version·can·also·traverse·nested·properties. | ||
6 | function·has(obj,·path)·{ | ||
7 | ····path·=·_toPath(path); | ||
8 | ····var·length·=·path.length; | ||
9 | ····for·(var·i·=·0;·i·<·length;·i++)·{ | ||
10 | ········var·key·=·path[i]; | ||
11 | ········if·(!_has(obj,·key))·return·false; | ||
12 | ········obj·=·obj[key]; | ||
13 | ····} | ||
14 | ····return·!!length; | ||
15 | } | ||
7 | module.exports·=· | 16 | module.exports·=·has; |
Offset 1, 11 lines modified | Offset 1, 6 lines modified | ||
1 | var·sortedIndex·=·require('./index139.js'); | ||
2 | var·findIndex·=·require('./index57.js'); | ||
3 | 1 | //·Keep·the·identity·function·around·for·default·iteratees. | |
2 | function·identity(value)·{ | ||
3 | ····return·value; | ||
4 | } | ||
4 | //·Return·the·position·of·the·first·occurrence·of·an·item·in·an·array, | ||
5 | //·or·-1·if·the·item·is·not·included·in·the·array. | ||
6 | //·If·the·array·is·large·and·already·in·sort·order,·pass·`true` | ||
7 | //·for·**isSorted**·to·use·binary·search. | ||
8 | var·indexOf·=·_createIndexFinder(1,·findIndex,·sortedIndex); | ||
9 | module.exports·=·i | 5 | module.exports·=·identity; |
Offset 1, 10 lines modified | Offset 1, 28 lines modified | ||
1 | var· | 1 | var·index·=·require('./index70.js'); |
2 | var·mixin·=·require('./index113.js'); | ||
2 | //·Returns·everything·but·the·last·entry·of·the·array.·Especially·useful·on | ||
3 | //·the·arguments·object.·Passing·**n**·will·return·all·the·values·in | ||
4 | //·the·array,·excluding·the·last·N. | ||
5 | function·initial(array,·n,·guard)·{ | ||
6 | ····return·_setup.slice.call(array,·0,·Math.max(0,·array.length·-·(n·==·null·||·guard·?·1·:·n))); | ||
7 | 3 | //·Default·Export | |
4 | //·============== | ||
5 | //·In·this·module,·we·mix·our·bundled·exports·into·the·`_`·object·and·export | ||
6 | //·the·result.·This·is·analogous·to·setting·`module.exports·=·_`·in·CommonJS. | ||
7 | //·Hence,·this·module·is·also·the·entry·point·of·our·UMD·bundle·and·the·package | ||
8 | //·entry·point·for·CommonJS·and·AMD·users.·In·other·words,·this·is·(the·source | ||
9 | //·of)·the·module·you·are·interfacing·with·when·you·do·any·of·the·following: | ||
10 | // | ||
11 | //·```js | ||
12 | //·//·CommonJS | ||
13 | //·var·_·=·require('underscore'); | ||
14 | // | ||
15 | //·//·AMD | ||
16 | //·define(['underscore'],·function(_)·{...}); | ||
17 | // | ||
18 | //·//·UMD·in·the·browser | ||
19 | //·//·_·is·available·as·a·global·variable | ||
20 | //·``` | ||
21 | //·Add·all·of·the·Underscore·functions·to·the·wrapper·object. | ||
22 | var·_·=·mixin(index); | ||
23 | //·Legacy·Node.js·API. | ||
24 | _._·=·_; | ||
8 | module.exports·=· | 25 | module.exports·=·_; |
Offset 1, 8 lines modified | Offset 1, 8 lines modified | ||
1 | var·keys·=·require('./index1 | 1 | var·keys·=·require('./index149.js'); |
2 | //·Internal·helper·to·generate·functions·for·escaping·and·unescaping·strings | 2 | //·Internal·helper·to·generate·functions·for·escaping·and·unescaping·strings |
3 | //·to/from·HTML·interpolation. | 3 | //·to/from·HTML·interpolation. |
4 | function·createEscaper(map)·{ | 4 | function·createEscaper(map)·{ |
5 | ····var·escaper·=·function(match)·{ | 5 | ····var·escaper·=·function(match)·{ |
6 | ········return·map[match]; | 6 | ········return·map[match]; |
7 | ····}; | 7 | ····}; |
Offset 1, 21 lines modified | Offset 1, 281 lines modified | ||
1 | var·_getLength·=·require('./index17.js'); | ||
2 | 1 | Object.defineProperty(exports,·'__esModule',·{ | |
2 | ····value:·true | ||
3 | }); | ||
3 | //·Produce·an·array·that·contains·every·item·shared·between·all·the | ||
4 | //·passed-in·arrays. | ||
5 | function·intersection(array)·{ | ||
6 | ····var·result·=·[]; | ||
7 | ····var·argsLength·=·arguments.length; | ||
8 | ····for·(var·i·=·0,·length·=·_getLength(array);·i·<·length;·i++)·{ | ||
9 | ········var·item·=·array[i]; | ||
10 | ········if·(contains(result,·item))·continue; | ||
11 | ········var·j; | ||
12 | ········for·(j·=·1;·j·<·argsLength;·j++)·{ | ||
13 | ············if·(!contains(arguments[j],·item))·break; | ||
14 | ········} | ||
15 | ········if·(j·===·argsLength)·result.push(item); | ||
16 | ····} | ||
17 | ····return·result; | ||
18 | 4 | var·_setup·=·require('./index26.js'); | |
5 | var·restArguments·=·require('./index133.js'); | ||
6 | var·isObject·=·require('./index94.js'); | ||
7 | var·isNull·=·require('./index92.js'); | ||
8 | var·isUndefined·=·require('./index100.js'); | ||
9 | var·isBoolean·=·require('./index80.js'); | ||
10 | var·isElement·=·require('./index83.js'); | ||
11 | var·isString·=·require('./index97.js'); | ||
12 | var·isNumber·=·require('./index93.js'); | ||
13 | var·isDate·=·require('./index82.js'); | ||
14 | var·isRegExp·=·require('./index95.js'); | ||
15 | var·isError·=·require('./index86.js'); | ||
16 | var·isSymbol·=·require('./index98.js'); | ||
17 | var·isArrayBuffer·=·require('./index79.js'); | ||
18 | var·isDataView·=·require('./index81.js'); | ||
19 | var·isArray·=·require('./index78.js'); | ||
20 | var·isFunction·=·require('./index88.js'); | ||
21 | var·isArguments·=·require('./index77.js'); | ||
22 | var·isFinite·=·require('./index87.js'); | ||
23 | var·isNaN·=·require('./index91.js'); | ||
24 | var·isTypedArray·=·require('./index99.js'); | ||
25 | var·isEmpty·=·require('./index84.js'); | ||
26 | var·isMatch·=·require('./index90.js'); | ||
27 | var·isEqual·=·require('./index85.js'); | ||
28 | var·isMap·=·require('./index89.js'); | ||
29 | var·isWeakMap·=·require('./index103.js'); | ||
30 | var·isSet·=·require('./index96.js'); | ||
31 | var·isWeakSet·=·require('./index101.js'); | ||
32 | var·keys·=·require('./index149.js'); | ||
33 | var·allKeys·=·require('./index34.js'); | ||
34 | var·values·=·require('./index155.js'); | ||
35 | var·pairs·=·require('./index120.js'); | ||
36 | var·invert·=·require('./index75.js'); | ||
37 | var·functions·=·require('./index64.js'); | ||
38 | var·extend·=·require('./index54.js'); | ||
39 | var·extendOwn·=·require('./index55.js'); | ||
40 | var·defaults·=·require('./index47.js'); | ||
41 | var·create·=·require('./index46.js'); | ||
42 | var·clone·=·require('./index40.js'); | ||
43 | var·tap·=·require('./index141.js'); | ||
44 | var·get·=·require('./index65.js'); | ||
45 | var·has·=·require('./index67.js'); | ||
46 | var·mapObject·=·require('./index108.js'); | ||
47 | var·identity·=·require('./index68.js'); | ||
48 | var·constant·=·require('./index43.js'); | ||
49 | var·noop·=·require('./index115.js'); | ||
50 | var·toPath·=·require('./index147.js'); | ||
51 | var·property·=·require('./index125.js'); | ||
52 | var·propertyOf·=·require('./index126.js'); | ||
53 | var·matcher·=·require('./index110.js'); | ||
54 | var·times·=·require('./index145.js'); | ||
55 | var·random·=·require('./index127.js'); | ||
56 | var·now·=·require('./index116.js'); | ||
57 | var·escape·=·require('./index52.js'); | ||
58 | var·unescape·=·require('./index160.js'); | ||
59 | var·templateSettings·=·require('./index143.js'); | ||
60 | var·template·=·require('./index142.js'); | ||
61 | var·result·=·require('./index134.js'); | ||
62 | var·uniqueId·=·require('./index154.js'); | ||
63 | var·chain·=·require('./index38.js'); | ||
64 | var·iteratee·=·require('./index102.js'); | ||
65 | var·partial·=·require('./index121.js'); | ||
66 | var·bind·=·require('./index36.js'); | ||
67 | var·bindAll·=·require('./index37.js'); | ||
68 | var·memoize·=·require('./index111.js'); | ||
69 | var·delay·=·require('./index49.js'); | ||
70 | var·defer·=·require('./index48.js'); | ||
71 | var·throttle·=·require('./index144.js'); | ||
72 | var·debounce·=·require('./index105.js'); | ||
73 | var·wrap·=·require('./index159.js'); | ||
74 | var·negate·=·require('./index114.js'); | ||
75 | var·compose·=·require('./index42.js'); | ||
76 | var·after·=·require('./index33.js'); | ||
77 | var·before·=·require('./index35.js'); | ||
78 | var·once·=·require('./index119.js'); | ||
79 | var·findKey·=·require('./index59.js'); | ||
80 | var·findIndex·=·require('./index58.js'); | ||
81 | var·findLastIndex·=·require('./index60.js'); | ||
82 | var·sortedIndex·=·require('./index140.js'); | ||
83 | var·indexOf·=·require('./index73.js'); | ||
84 | var·lastIndexOf·=·require('./index106.js'); | ||
85 | var·find·=·require('./index57.js'); | ||
86 | var·findWhere·=·require('./index61.js'); | ||
87 | var·each·=·require('./index51.js'); | ||
88 | var·map·=·require('./index107.js'); | ||
89 | var·reduce·=·require('./index129.js'); | ||
90 | var·reduceRight·=·require('./index130.js'); | ||
91 | var·filter·=·require('./index56.js'); | ||
92 | var·reject·=·require('./index131.js'); | ||
93 | var·every·=·require('./index53.js'); | ||
94 | var·some·=·require('./index138.js'); | ||
95 | var·contains·=·require('./index44.js'); | ||
96 | var·invoke·=·require('./index76.js'); | ||
97 | var·pluck·=·require('./index124.js'); | ||
98 | var·where·=·require('./index156.js'); | ||
99 | var·max·=·require('./index109.js'); | ||
100 | var·min·=·require('./index112.js'); | ||
101 | var·shuffle·=·require('./index136.js'); | ||
102 | var·sample·=·require('./index135.js'); | ||
103 | var·sortBy·=·require('./index139.js'); | ||
104 | var·groupBy·=·require('./index66.js'); | ||
105 | var·indexBy·=·require('./index71.js'); | ||
106 | var·countBy·=·require('./index45.js'); | ||
107 | var·partition·=·require('./index122.js'); | ||
108 | var·toArray·=·require('./index146.js'); | ||
109 | var·size·=·require('./index137.js'); | ||
110 | var·pick·=·require('./index123.js'); | ||
Max diff block lines reached; 4069/9886 bytes (41.16%) of diff not shown. |
Offset 1, 13 lines modified | Offset 1, 9 lines modified | ||
1 | var· | 1 | var·_group·=·require('./index18.js'); |
2 | //·Indexes·the·object's·values·by·a·criterion,·similar·to·`_.groupBy`,·but·for | ||
3 | //·when·you·know·that·your·index·values·will·be·unique. | ||
4 | var·indexBy·=·_group(function(result,·value,·key)·{ | ||
5 | ····result[key]·=·value; | ||
6 | }); | ||
2 | //·Invert·the·keys·and·values·of·an·object.·The·values·must·be·serializable. | ||
3 | function·invert(obj)·{ | ||
4 | ····var·result·=·{}; | ||
5 | ····var·_keys·=·keys(obj); | ||
6 | ····for·(var·i·=·0,·length·=·_keys.length;·i·<·length;·i++)·{ | ||
7 | ········result[obj[_keys[i]]]·=·_keys[i]; | ||
8 | ····} | ||
9 | ····return·result; | ||
10 | } | ||
11 | module.exports·=·in | 7 | module.exports·=·indexBy; |
Offset 1, 30 lines modified | Offset 1, 10 lines modified | ||
1 | var·restArguments·=·require('./index133.js'); | ||
2 | var·isFunction·=·require('./index84.js'); | ||
3 | var·map·=·require('./index103.js'); | ||
4 | var·_ | 1 | var·_setup·=·require('./index26.js'); |
5 | var·_toPath·=·require('./index31.js'); | ||
2 | //·Returns·everything·but·the·last·entry·of·the·array.·Especially·useful·on | ||
3 | //·the·arguments·object.·Passing·**n**·will·return·all·the·values·in | ||
4 | //·the·array,·excluding·the·last·N. | ||
5 | function·initial(array,·n,·guard)·{ | ||
6 | ····return·_setup.slice.call(array,·0,·Math.max(0,·array.length·-·(n·==·null·||·guard·?·1·:·n))); | ||
7 | } | ||
6 | //·Invoke·a·method·(with·arguments)·on·every·item·in·a·collection. | ||
7 | var·invoke·=·restArguments(function(obj,·path,·args)·{ | ||
8 | ····var·contextPath,·func; | ||
9 | ····if·(isFunction(path))·{ | ||
10 | ········func·=·path; | ||
11 | ····}·else·{ | ||
12 | ········path·=·_toPath(path); | ||
13 | ········contextPath·=·path.slice(0,·-1); | ||
14 | ········path·=·path[path.length·-·1]; | ||
15 | ····} | ||
16 | ····return·map(obj,·function(context)·{ | ||
17 | ········var·method·=·func; | ||
18 | ········if·(!method)·{ | ||
19 | ············if·(contextPath·&&·contextPath.length)·{ | ||
20 | ················context·=·_deepGet(context,·contextPath); | ||
21 | ············} | ||
22 | ············if·(context·==·null)·return·void·0; | ||
23 | ············method·=·context[path]; | ||
24 | ········} | ||
25 | ········return·method·==·null·?·method·:·method.apply(context,·args); | ||
26 | ····}); | ||
27 | }); | ||
28 | module.exports·=·in | 8 | module.exports·=·initial; |
Offset 1, 18 lines modified | Offset 1, 11 lines modified | ||
1 | var·_tagTester·=·require('./index29.js'); | ||
2 | var· | 1 | var·sortedIndex·=·require('./index140.js'); |
2 | var·findIndex·=·require('./index58.js'); | ||
3 | var·_createIndexFinder·=·require('./index8.js'); | ||
3 | 4 | //·Return·the·position·of·the·first·occurrence·of·an·item·in·an·array, | |
5 | //·or·-1·if·the·item·is·not·included·in·the·array. | ||
6 | //·If·the·array·is·large·and·already·in·sort·order,·pass·`true` | ||
7 | //·for·**isSorted**·to·use·binary·search. | ||
8 | var·indexOf·=·_createIndexFinder(1,·findIndex,·sortedIndex); | ||
9 | module.exports·=·indexOf; | ||
4 | //·Define·a·fallback·version·of·the·method·in·browsers·(ahem,·IE·<·9),·where | ||
5 | //·there·isn't·any·inspectable·"Arguments"·type. | ||
6 | (function()·{ | ||
7 | ····if·(!isArguments(arguments))·{ | ||
8 | ········isArguments·=·function(obj)·{ | ||
9 | ············return·_has(obj,·'callee'); | ||
10 | ········}; | ||
11 | ····} | ||
12 | }()); | ||
13 | var·isArguments$1·=·isArguments; | ||
14 | module.exports·=·isArguments$1; |
Offset 1, 8 lines modified | Offset 1, 21 lines modified | ||
1 | var·_ | 1 | var·_getLength·=·require('./index17.js'); |
2 | var· | 2 | var·contains·=·require('./index44.js'); |
3 | //·Is·a·given·value·an·array? | ||
4 | //·Delegates·to·ECMA5's·native·`Array.isArray`. | ||
5 | 3 | //·Produce·an·array·that·contains·every·item·shared·between·all·the | |
4 | //·passed-in·arrays. | ||
5 | function·intersection(array)·{ | ||
6 | ····var·result·=·[]; | ||
7 | ····var·argsLength·=·arguments.length; | ||
8 | ····for·(var·i·=·0,·length·=·_getLength(array);·i·<·length;·i++)·{ | ||
9 | ········var·item·=·array[i]; | ||
10 | ········if·(contains(result,·item))·continue; | ||
11 | ········var·j; | ||
12 | ········for·(j·=·1;·j·<·argsLength;·j++)·{ | ||
13 | ············if·(!contains(arguments[j],·item))·break; | ||
14 | ········} | ||
15 | ········if·(j·===·argsLength)·result.push(item); | ||
16 | ····} | ||
17 | ····return·result; | ||
18 | } | ||
6 | module.exports·=·is | 19 | module.exports·=·intersection; |
Offset 1, 5 lines modified | Offset 1, 13 lines modified | ||
1 | var· | 1 | var·keys·=·require('./index149.js'); |
2 | v | 2 | //·Invert·the·keys·and·values·of·an·object.·The·values·must·be·serializable. |
3 | function·invert(obj)·{ | ||
4 | ····var·result·=·{}; | ||
5 | ····var·_keys·=·keys(obj); | ||
6 | ····for·(var·i·=·0,·length·=·_keys.length;·i·<·length;·i++)·{ | ||
7 | ········result[obj[_keys[i]]]·=·_keys[i]; | ||
8 | ····} | ||
9 | ····return·result; | ||
10 | } | ||
3 | module.exports·=·i | 11 | module.exports·=·invert; |
Offset 1, 8 lines modified | Offset 1, 30 lines modified | ||
1 | var·restArguments·=·require('./index133.js'); | ||
2 | var·isFunction·=·require('./index88.js'); | ||
3 | var·map·=·require('./index107.js'); | ||
1 | var·_ | 4 | var·_deepGet·=·require('./index13.js'); |
5 | var·_toPath·=·require('./index31.js'); | ||
2 | //·Is·a·given·value·a·boolean? | ||
3 | function·isBoolean(obj)·{ | ||
4 | ····return·obj·===·true·||·obj·===·false·||·_setup.toString.call(obj)·===·'[object·Boolean]'; | ||
5 | 6 | //·Invoke·a·method·(with·arguments)·on·every·item·in·a·collection. | |
7 | var·invoke·=·restArguments(function(obj,·path,·args)·{ | ||
8 | ····var·contextPath,·func; | ||
9 | ····if·(isFunction(path))·{ | ||
10 | ········func·=·path; | ||
11 | ····}·else·{ | ||
12 | ········path·=·_toPath(path); | ||
13 | ········contextPath·=·path.slice(0,·-1); | ||
14 | ········path·=·path[path.length·-·1]; | ||
15 | ····} | ||
16 | ····return·map(obj,·function(context)·{ | ||
17 | ········var·method·=·func; | ||
18 | ········if·(!method)·{ | ||
19 | ············if·(contextPath·&&·contextPath.length)·{ | ||
20 | ················context·=·_deepGet(context,·contextPath); | ||
21 | ············} | ||
22 | ············if·(context·==·null)·return·void·0; | ||
23 | ············method·=·context[path]; | ||
24 | ········} | ||
25 | ········return·method·==·null·?·method·:·method.apply(context,·args); | ||
26 | ····}); | ||
27 | }); | ||
6 | module.exports·=·i | 28 | module.exports·=·invoke; |
Offset 1, 16 lines modified | Offset 1, 18 lines modified | ||
1 | var·_tagTester·=·require('./index29.js'); | 1 | var·_tagTester·=·require('./index29.js'); |
2 | var· | 2 | var·_has·=·require('./index19.js'); |
3 | var·isArrayBuffer·=·require('./index75.js'); | ||
4 | var·_stringTagBug·=·require('./index28.js'); | ||
5 | var·is | 3 | var·isArguments·=·_tagTester('Arguments'); |
6 | //·In·IE·10·-·Edge·13,·we·need·a·different·heuristic | ||
7 | //·to·determine·whether·an·object·is·a·`DataView`. | ||
8 | function·ie10IsDataView(obj)·{ | ||
9 | ····return·obj·!=·null·&&·isFunction(obj.getInt8)·&&·isArrayBuffer(obj.buffer); | ||
10 | 4 | //·Define·a·fallback·version·of·the·method·in·browsers·(ahem,·IE·<·9),·where | |
5 | //·there·isn't·any·inspectable·"Arguments"·type. | ||
6 | (function()·{ | ||
7 | ····if·(!isArguments(arguments))·{ | ||
8 | ········isArguments·=·function(obj)·{ | ||
9 | ············return·_has(obj,·'callee'); | ||
10 | ········}; | ||
11 | ····} | ||
12 | }()); | ||
11 | var·is | 13 | var·isArguments$1·=·isArguments; |
12 | module.exports·=·is | 14 | module.exports·=·isArguments$1; |
Offset 1, 5 lines modified | Offset 1, 8 lines modified | ||
1 | var·_setup·=·require('./index26.js'); | ||
1 | var·_tagTester·=·require('./index29.js'); | 2 | var·_tagTester·=·require('./index29.js'); |
2 | 3 | //·Is·a·given·value·an·array? | |
4 | //·Delegates·to·ECMA5's·native·`Array.isArray`. | ||
5 | var·isArray·=·_setup.nativeIsArray·||·_tagTester('Array'); | ||
3 | module.exports·=·is | 6 | module.exports·=·isArray; |
Offset 1, 6 lines modified | Offset 1, 5 lines modified | ||
1 | var·_tagTester·=·require('./index29.js'); | ||
1 | //·Is·a·given·value·a·DOM·element? | ||
2 | function·isElement(obj)·{ | ||
3 | ····return·!!(obj·&&·obj.nodeType·===·1); | ||
4 | } | ||
5 | 2 | var·isArrayBuffer·=·_tagTester('ArrayBuffer'); | |
3 | module.exports·=·isArrayBuffer; |
Offset 1, 10 lines modified | Offset 1, 10 lines modified | ||
1 | var·_getLength·=·require('./index17.js'); | 1 | var·_getLength·=·require('./index17.js'); |
2 | var·_setup·=·require('./index26.js'); | 2 | var·_setup·=·require('./index26.js'); |
3 | var·isNaN·=·require('./index | 3 | var·isNaN·=·require('./index91.js'); |
4 | //·Internal·function·to·generate·the·`_.indexOf`·and·`_.lastIndexOf`·functions. | 4 | //·Internal·function·to·generate·the·`_.indexOf`·and·`_.lastIndexOf`·functions. |
5 | function·createIndexFinder(dir,·predicateFind,·sortedIndex)·{ | 5 | function·createIndexFinder(dir,·predicateFind,·sortedIndex)·{ |
6 | ····return·function(array,·item,·idx)·{ | 6 | ····return·function(array,·item,·idx)·{ |
7 | ········var·i·=·0, | 7 | ········var·i·=·0, |
8 | ············length·=·_getLength(array); | 8 | ············length·=·_getLength(array); |
9 | ········if·(typeof·idx·==·'number')·{ | 9 | ········if·(typeof·idx·==·'number')·{ |
Offset 1, 20 lines modified | Offset 1, 8 lines modified | ||
1 | var·_getLength·=·require('./index17.js'); | ||
2 | var·isArray·=·require('./index74.js'); | ||
3 | var·isString·=·require('./index93.js'); | ||
4 | var·isArguments·=·require('./index73.js'); | ||
5 | var· | 1 | var·_setup·=·require('./index26.js'); |
2 | //·Is·a·given·value·a·boolean? | ||
6 | //·Is·a·given·array,·string,·or·object·empty? | ||
7 | //·An·"empty"·object·has·no·enumerable·own-properties. | ||
8 | function·is | 3 | function·isBoolean(obj)·{ |
4 | ····return·obj·===·true·||·obj·===·false·||·_setup.toString.call(obj)·===·'[object·Boolean]'; | ||
9 | ····if·(obj·==·null)·return·true; | ||
10 | ····//·Skip·the·more·expensive·`toString`-based·type·checks·if·`obj`·has·no | ||
11 | ····//·`.length`. | ||
12 | ····var·length·=·_getLength(obj); | ||
13 | ····if·(typeof·length·==·'number'·&&·( | ||
14 | ············isArray(obj)·||·isString(obj)·||·isArguments(obj) | ||
15 | ········))·return·length·===·0; | ||
16 | ····return·_getLength(keys(obj))·===·0; | ||
17 | } | 5 | } |
18 | module.exports·=·is | 6 | module.exports·=·isBoolean; |
Offset 1, 142 lines modified | Offset 1, 16 lines modified | ||
1 | var·underscore·=·require('./index149.js'); | ||
2 | var·_ | 1 | var·_tagTester·=·require('./index29.js'); |
3 | var·_getByteLength·=·require('./index16.js'); | ||
4 | var·isTypedArray·=·require('./index95.js'); | ||
5 | var·isFunction·=·require('./index8 | 2 | var·isFunction·=·require('./index88.js'); |
3 | var·isArrayBuffer·=·require('./index79.js'); | ||
6 | var·_stringTagBug·=·require('./index28.js'); | 4 | var·_stringTagBug·=·require('./index28.js'); |
7 | var·isDataView·=·require('./index77.js'); | ||
8 | var·keys·=·require('./index100.js'); | ||
9 | var·_has·=·require('./index19.js'); | ||
10 | var·_toBufferView·=·require('./index30.js'); | ||
5 | var·isDataView·=·_tagTester('DataView'); | ||
11 | //·We·use·this·string·twice,·so·give·it·a·name·for·minification. | ||
12 | var·tagDataView·=·'[object·DataView]'; | ||
6 | //·In·IE·10·-·Edge·13,·we·need·a·different·heuristic | ||
7 | //·to·determine·whether·an·object·is·a·`DataView`. | ||
8 | function·ie10IsDataView(obj)·{ | ||
9 | ····return·obj·!=·null·&&·isFunction(obj.getInt8)·&&·isArrayBuffer(obj.buffer); | ||
13 | //·Internal·recursive·comparison·function·for·`_.isEqual`. | ||
14 | function·eq(a,·b,·aStack,·bStack)·{ | ||
15 | ····//·Identical·objects·are·equal.·`0·===·-0`,·but·they·aren't·identical. | ||
16 | ····//·See·the·[Harmony·`egal`·proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). | ||
17 | ····if·(a·===·b)·return·a·!==·0·||·1·/·a·===·1·/·b; | ||
18 | ····//·`null`·or·`undefined`·only·equal·to·itself·(strict·comparison). | ||
19 | ····if·(a·==·null·||·b·==·null)·return·false; | ||
20 | ····//·`NaN`s·are·equivalent,·but·non-reflexive. | ||
21 | ····if·(a·!==·a)·return·b·!==·b; | ||
22 | ····//·Exhaust·primitive·checks | ||
23 | ····var·type·=·typeof·a; | ||
24 | ····if·(type·!==·'function'·&&·type·!==·'object'·&&·typeof·b·!=·'object')·return·false; | ||
25 | ····return·deepEq(a,·b,·aStack,·bStack); | ||
26 | } | 10 | } |
11 | var·isDataView$1·=·(_stringTagBug.hasStringTagBug·?·ie10IsDataView·:·isDataView); | ||
27 | //·Internal·recursive·comparison·function·for·`_.isEqual`. | ||
28 | function·deepEq(a,·b,·aStack,·bStack)·{ | ||
29 | ····//·Unwrap·any·wrapped·objects. | ||
30 | ····if·(a·instanceof·underscore)·a·=·a._wrapped; | ||
31 | ····if·(b·instanceof·underscore)·b·=·b._wrapped; | ||
32 | ····//·Compare·`[[Class]]`·names. | ||
33 | ····var·className·=·_setup.toString.call(a); | ||
34 | ····if·(className·!==·_setup.toString.call(b))·return·false; | ||
35 | ····//·Work·around·a·bug·in·IE·10·-·Edge·13. | ||
36 | ····if·(_stringTagBug.hasStringTagBug·&&·className·==·'[object·Object]'·&&·isDataView(a))·{ | ||
37 | ········if·(!isDataView(b))·return·false; | ||
38 | ········className·=·tagDataView; | ||
39 | ····} | ||
40 | ····switch·(className)·{ | ||
41 | ········//·These·types·are·compared·by·value. | ||
42 | ········case·'[object·RegExp]': | ||
43 | ············//·RegExps·are·coerced·to·strings·for·comparison·(Note:·''·+·/a/i·===·'/a/i') | ||
44 | ········case·'[object·String]': | ||
45 | ············//·Primitives·and·their·corresponding·object·wrappers·are·equivalent;·thus,·`"5"`·is | ||
46 | ············//·equivalent·to·`new·String("5")`. | ||
47 | ············return·''·+·a·===·''·+·b; | ||
48 | ········case·'[object·Number]': | ||
49 | ············//·`NaN`s·are·equivalent,·but·non-reflexive. | ||
50 | ············//·Object(NaN)·is·equivalent·to·NaN. | ||
51 | ············if·(+a·!==·+a)·return·+b·!==·+b; | ||
52 | ············//·An·`egal`·comparison·is·performed·for·other·numeric·values. | ||
53 | ············return·+a·===·0·?·1·/·+a·===·1·/·b·:·+a·===·+b; | ||
54 | ········case·'[object·Date]': | ||
55 | ········case·'[object·Boolean]': | ||
56 | ············//·Coerce·dates·and·booleans·to·numeric·primitive·values.·Dates·are·compared·by·their | ||
57 | ············//·millisecond·representations.·Note·that·invalid·dates·with·millisecond·representations | ||
58 | ············//·of·`NaN`·are·not·equivalent. | ||
59 | ············return·+a·===·+b; | ||
60 | ········case·'[object·Symbol]': | ||
61 | ············return·_setup.SymbolProto.valueOf.call(a)·===·_setup.SymbolProto.valueOf.call(b); | ||
62 | ········case·'[object·ArrayBuffer]': | ||
63 | ········case·tagDataView: | ||
64 | ············//·Coerce·to·typed·array·so·we·can·fall·through. | ||
65 | ············return·deepEq(_toBufferView(a),·_toBufferView(b),·aStack,·bStack); | ||
66 | ····} | ||
67 | ····var·areArrays·=·className·===·'[object·Array]'; | ||
68 | ····if·(!areArrays·&&·isTypedArray(a))·{ | ||
69 | ········var·byteLength·=·_getByteLength(a); | ||
70 | ········if·(byteLength·!==·_getByteLength(b))·return·false; | ||
71 | ········if·(a.buffer·===·b.buffer·&&·a.byteOffset·===·b.byteOffset)·return·true; | ||
72 | ········areArrays·=·true; | ||
73 | ····} | ||
74 | ····if·(!areArrays)·{ | ||
75 | ········if·(typeof·a·!=·'object'·||·typeof·b·!=·'object')·return·false; | ||
76 | ········//·Objects·with·different·constructors·are·not·equivalent,·but·`Object`s·or·`Array`s | ||
77 | ········//·from·different·frames·are. | ||
78 | ········var·aCtor·=·a.constructor, | ||
79 | ············bCtor·=·b.constructor; | ||
80 | ········if·(aCtor·!==·bCtor·&&·!(isFunction(aCtor)·&&·aCtor·instanceof·aCtor·&& | ||
81 | ················isFunction(bCtor)·&&·bCtor·instanceof·bCtor)·&& | ||
82 | ············('constructor'·in·a·&&·'constructor'·in·b))·{ | ||
83 | ············return·false; | ||
84 | ········} | ||
85 | ····} | ||
86 | ····//·Assume·equality·for·cyclic·structures.·The·algorithm·for·detecting·cyclic | ||
87 | ····//·structures·is·adapted·from·ES·5.1·section·15.12.3,·abstract·operation·`JO`. | ||
88 | ····//·Initializing·stack·of·traversed·objects. | ||
89 | ····//·It's·done·here·since·we·only·need·them·for·objects·and·arrays·comparison. | ||
90 | ····aStack·=·aStack·||·[]; | ||
91 | ····bStack·=·bStack·||·[]; | ||
92 | ····var·length·=·aStack.length; | ||
93 | ····while·(length--)·{ | ||
94 | ········//·Linear·search.·Performance·is·inversely·proportional·to·the·number·of | ||
95 | ········//·unique·nested·structures. | ||
96 | ········if·(aStack[length]·===·a)·return·bStack[length]·===·b; | ||
97 | ····} | ||
98 | ····//·Add·the·first·object·to·the·stack·of·traversed·objects. | ||
99 | ····aStack.push(a); | ||
100 | ····bStack.push(b); | ||
101 | ····//·Recursively·compare·objects·and·arrays. | ||
102 | ····if·(areArrays)·{ | ||
103 | ········//·Compare·array·lengths·to·determine·if·a·deep·comparison·is·necessary. | ||
104 | ········length·=·a.length; | ||
105 | ········if·(length·!==·b.length)·return·false; | ||
106 | ········//·Deep·compare·the·contents,·ignoring·non-numeric·properties. | ||
107 | ········while·(length--)·{ | ||
108 | ············if·(!eq(a[length],·b[length],·aStack,·bStack))·return·false; | ||
109 | ········} | ||
110 | ····}·else·{ | ||
111 | ········//·Deep·compare·objects. | ||
112 | ········var·_keys·=·keys(a), | ||
Max diff block lines reached; -1/6582 bytes (-0.02%) of diff not shown. |
Offset 1, 5 lines modified | Offset 1, 5 lines modified | ||
1 | var·_tagTester·=·require('./index29.js'); | 1 | var·_tagTester·=·require('./index29.js'); |
2 | var·is | 2 | var·isDate·=·_tagTester('Date'); |
3 | module.exports·=·is | 3 | module.exports·=·isDate; |
Offset 1, 9 lines modified | Offset 1, 6 lines modified | ||
1 | //·Is·a·given·value·a·DOM·element? | ||
1 | var·_setup·=·require('./index26.js'); | ||
2 | var·isSymbol·=·require('./index94.js'); | ||
3 | //·Is·a·given·object·a·finite·number? | ||
4 | function·is | 2 | function·isElement(obj)·{ |
5 | ····return·! | 3 | ····return·!!(obj·&&·obj.nodeType·===·1); |
6 | } | 4 | } |
7 | module.exports·=·is | 5 | module.exports·=·isElement; |
Offset 1, 17 lines modified | Offset 1, 20 lines modified | ||
1 | var·_getLength·=·require('./index17.js'); | ||
2 | var·isArray·=·require('./index78.js'); | ||
3 | var·isString·=·require('./index97.js'); | ||
4 | var·isArguments·=·require('./index77.js'); | ||
1 | var· | 5 | var·keys·=·require('./index149.js'); |
2 | var·_setup·=·require('./index26.js'); | ||
3 | var·isFunction·=·_tagTester('Function'); | ||
4 | //·Optimize·`isFunction`·if·appropriate.·Work·around·some·`typeof`·bugs·in·old | ||
5 | //·v8,·IE·11·(#1621),·Safari·8·(#1929),·and·PhantomJS·(#2236). | ||
6 | var·nodelist·=·_setup.root.document·&&·_setup.root.document.childNodes; | ||
7 | if·(typeof·/./·!=·'function'·&&·typeof·Int8Array·!=·'object'·&&·typeof·nodelist·!=·'function')·{ | ||
8 | ····isFunction·=·function(obj)·{ | ||
9 | ········return·typeof·obj·==·'function'·||·false; | ||
10 | ···· | 6 | //·Is·a·given·array,·string,·or·object·empty? |
7 | //·An·"empty"·object·has·no·enumerable·own-properties. | ||
8 | function·isEmpty(obj)·{ | ||
9 | ····if·(obj·==·null)·return·true; | ||
10 | ····//·Skip·the·more·expensive·`toString`-based·type·checks·if·`obj`·has·no | ||
11 | ····//·`.length`. | ||
12 | ····var·length·=·_getLength(obj); | ||
13 | ····if·(typeof·length·==·'number'·&&·( | ||
14 | ············isArray(obj)·||·isString(obj)·||·isArguments(obj) | ||
15 | ········))·return·length·===·0; | ||
16 | ····return·_getLength(keys(obj))·===·0; | ||
11 | } | 17 | } |
12 | var·isFunction$1·=·isFunction; | ||
13 | module.exports·=·is | 18 | module.exports·=·isEmpty; |
Offset 1, 7 lines modified | Offset 1, 142 lines modified | ||
1 | var·underscore·=·require('./index150.js'); | ||
1 | var·_ | 2 | var·_setup·=·require('./index26.js'); |
3 | var·_getByteLength·=·require('./index16.js'); | ||
4 | var·isTypedArray·=·require('./index99.js'); | ||
5 | var·isFunction·=·require('./index88.js'); | ||
2 | var·_stringTagBug·=·require('./index28.js'); | 6 | var·_stringTagBug·=·require('./index28.js'); |
7 | var·isDataView·=·require('./index81.js'); | ||
8 | var·keys·=·require('./index149.js'); | ||
9 | var·_has·=·require('./index19.js'); | ||
3 | var·_ | 10 | var·_toBufferView·=·require('./index30.js'); |
4 | 11 | //·We·use·this·string·twice,·so·give·it·a·name·for·minification. | |
12 | var·tagDataView·=·'[object·DataView]'; | ||
13 | //·Internal·recursive·comparison·function·for·`_.isEqual`. | ||
14 | function·eq(a,·b,·aStack,·bStack)·{ | ||
15 | ····//·Identical·objects·are·equal.·`0·===·-0`,·but·they·aren't·identical. | ||
16 | ····//·See·the·[Harmony·`egal`·proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). | ||
17 | ····if·(a·===·b)·return·a·!==·0·||·1·/·a·===·1·/·b; | ||
18 | ····//·`null`·or·`undefined`·only·equal·to·itself·(strict·comparison). | ||
19 | ····if·(a·==·null·||·b·==·null)·return·false; | ||
20 | ····//·`NaN`s·are·equivalent,·but·non-reflexive. | ||
21 | ····if·(a·!==·a)·return·b·!==·b; | ||
22 | ····//·Exhaust·primitive·checks | ||
23 | ····var·type·=·typeof·a; | ||
24 | ····if·(type·!==·'function'·&&·type·!==·'object'·&&·typeof·b·!=·'object')·return·false; | ||
25 | ····return·deepEq(a,·b,·aStack,·bStack); | ||
26 | } | ||
27 | //·Internal·recursive·comparison·function·for·`_.isEqual`. | ||
28 | function·deepEq(a,·b,·aStack,·bStack)·{ | ||
29 | ····//·Unwrap·any·wrapped·objects. | ||
30 | ····if·(a·instanceof·underscore)·a·=·a._wrapped; | ||
31 | ····if·(b·instanceof·underscore)·b·=·b._wrapped; | ||
32 | ····//·Compare·`[[Class]]`·names. | ||
33 | ····var·className·=·_setup.toString.call(a); | ||
34 | ····if·(className·!==·_setup.toString.call(b))·return·false; | ||
35 | ····//·Work·around·a·bug·in·IE·10·-·Edge·13. | ||
36 | ····if·(_stringTagBug.hasStringTagBug·&&·className·==·'[object·Object]'·&&·isDataView(a))·{ | ||
37 | ········if·(!isDataView(b))·return·false; | ||
38 | ········className·=·tagDataView; | ||
39 | ····} | ||
40 | ····switch·(className)·{ | ||
41 | ········//·These·types·are·compared·by·value. | ||
42 | ········case·'[object·RegExp]': | ||
43 | ············//·RegExps·are·coerced·to·strings·for·comparison·(Note:·''·+·/a/i·===·'/a/i') | ||
44 | ········case·'[object·String]': | ||
45 | ············//·Primitives·and·their·corresponding·object·wrappers·are·equivalent;·thus,·`"5"`·is | ||
46 | ············//·equivalent·to·`new·String("5")`. | ||
47 | ············return·''·+·a·===·''·+·b; | ||
48 | ········case·'[object·Number]': | ||
49 | ············//·`NaN`s·are·equivalent,·but·non-reflexive. | ||
50 | ············//·Object(NaN)·is·equivalent·to·NaN. | ||
51 | ············if·(+a·!==·+a)·return·+b·!==·+b; | ||
52 | ············//·An·`egal`·comparison·is·performed·for·other·numeric·values. | ||
53 | ············return·+a·===·0·?·1·/·+a·===·1·/·b·:·+a·===·+b; | ||
54 | ········case·'[object·Date]': | ||
55 | ········case·'[object·Boolean]': | ||
56 | ············//·Coerce·dates·and·booleans·to·numeric·primitive·values.·Dates·are·compared·by·their | ||
57 | ············//·millisecond·representations.·Note·that·invalid·dates·with·millisecond·representations | ||
58 | ············//·of·`NaN`·are·not·equivalent. | ||
59 | ············return·+a·===·+b; | ||
60 | ········case·'[object·Symbol]': | ||
61 | ············return·_setup.SymbolProto.valueOf.call(a)·===·_setup.SymbolProto.valueOf.call(b); | ||
62 | ········case·'[object·ArrayBuffer]': | ||
63 | ········case·tagDataView: | ||
64 | ············//·Coerce·to·typed·array·so·we·can·fall·through. | ||
65 | ············return·deepEq(_toBufferView(a),·_toBufferView(b),·aStack,·bStack); | ||
66 | ····} | ||
67 | ····var·areArrays·=·className·===·'[object·Array]'; | ||
68 | ····if·(!areArrays·&&·isTypedArray(a))·{ | ||
69 | ········var·byteLength·=·_getByteLength(a); | ||
70 | ········if·(byteLength·!==·_getByteLength(b))·return·false; | ||
71 | ········if·(a.buffer·===·b.buffer·&&·a.byteOffset·===·b.byteOffset)·return·true; | ||
72 | ········areArrays·=·true; | ||
73 | ····} | ||
74 | ····if·(!areArrays)·{ | ||
75 | ········if·(typeof·a·!=·'object'·||·typeof·b·!=·'object')·return·false; | ||
76 | ········//·Objects·with·different·constructors·are·not·equivalent,·but·`Object`s·or·`Array`s | ||
77 | ········//·from·different·frames·are. | ||
78 | ········var·aCtor·=·a.constructor, | ||
79 | ············bCtor·=·b.constructor; | ||
80 | ········if·(aCtor·!==·bCtor·&&·!(isFunction(aCtor)·&&·aCtor·instanceof·aCtor·&& | ||
81 | ················isFunction(bCtor)·&&·bCtor·instanceof·bCtor)·&& | ||
82 | ············('constructor'·in·a·&&·'constructor'·in·b))·{ | ||
83 | ············return·false; | ||
84 | ········} | ||
85 | ····} | ||
86 | ····//·Assume·equality·for·cyclic·structures.·The·algorithm·for·detecting·cyclic | ||
87 | ····//·structures·is·adapted·from·ES·5.1·section·15.12.3,·abstract·operation·`JO`. | ||
88 | ····//·Initializing·stack·of·traversed·objects. | ||
89 | ····//·It's·done·here·since·we·only·need·them·for·objects·and·arrays·comparison. | ||
90 | ····aStack·=·aStack·||·[]; | ||
91 | ····bStack·=·bStack·||·[]; | ||
92 | ····var·length·=·aStack.length; | ||
93 | ····while·(length--)·{ | ||
94 | ········//·Linear·search.·Performance·is·inversely·proportional·to·the·number·of | ||
95 | ········//·unique·nested·structures. | ||
96 | ········if·(aStack[length]·===·a)·return·bStack[length]·===·b; | ||
97 | ····} | ||
98 | ····//·Add·the·first·object·to·the·stack·of·traversed·objects. | ||
99 | ····aStack.push(a); | ||
100 | ····bStack.push(b); | ||
101 | ····//·Recursively·compare·objects·and·arrays. | ||
102 | ····if·(areArrays)·{ | ||
103 | ········//·Compare·array·lengths·to·determine·if·a·deep·comparison·is·necessary. | ||
104 | ········length·=·a.length; | ||
105 | ········if·(length·!==·b.length)·return·false; | ||
106 | ········//·Deep·compare·the·contents,·ignoring·non-numeric·properties. | ||
107 | ········while·(length--)·{ | ||
108 | ············if·(!eq(a[length],·b[length],·aStack,·bStack))·return·false; | ||
109 | ········} | ||
110 | ····}·else·{ | ||
111 | ········//·Deep·compare·objects. | ||
112 | ········var·_keys·=·keys(a), | ||
113 | ············key; | ||
114 | ········length·=·_keys.length; | ||
115 | ········//·Ensure·that·both·objects·contain·the·same·number·of·properties·before·comparing·deep·equality. | ||
116 | ········if·(keys(b).length·!==·length)·return·false; | ||
117 | ········while·(length--)·{ | ||
118 | ············//·Deep·compare·each·member | ||
119 | ············key·=·_keys[length]; | ||
Max diff block lines reached; -1/6315 bytes (-0.02%) of diff not shown. |
Offset 1, 16 lines modified | Offset 1, 5 lines modified | ||
1 | var· | 1 | var·_tagTester·=·require('./index29.js'); |
2 | var·isError·=·_tagTester('Error'); | ||
2 | //·Returns·whether·an·object·has·a·given·set·of·`key:value`·pairs. | ||
3 | function·isMatch(object,·attrs)·{ | ||
4 | ····var·_keys·=·keys(attrs), | ||
5 | ········length·=·_keys.length; | ||
6 | ····if·(object·==·null)·return·!length; | ||
7 | ····var·obj·=·Object(object); | ||
8 | ····for·(var·i·=·0;·i·<·length;·i++)·{ | ||
9 | ········var·key·=·_keys[i]; | ||
10 | ········if·(attrs[key]·!==·obj[key]·||·!(key·in·obj))·return·false; | ||
11 | ····} | ||
12 | ····return·true; | ||
13 | } | ||
14 | module.exports·=·is | 3 | module.exports·=·isError; |
Offset 1, 9 lines modified | Offset 1, 9 lines modified | ||
1 | var·_setup·=·require('./index26.js'); | 1 | var·_setup·=·require('./index26.js'); |
2 | var·is | 2 | var·isSymbol·=·require('./index98.js'); |
3 | //·Is· | 3 | //·Is·a·given·object·a·finite·number? |
4 | function·is | 4 | function·isFinite(obj)·{ |
5 | ····return·is | 5 | ····return·!isSymbol(obj)·&&·_setup._isFinite(obj)·&&·!isNaN(parseFloat(obj)); |
6 | } | 6 | } |
7 | module.exports·=·is | 7 | module.exports·=·isFinite; |
Offset 1, 6 lines modified | Offset 1, 17 lines modified | ||
1 | //·Is·a·given·value·equal·to·null? | ||
2 | function·isNull(obj)·{ | ||
3 | ·· | 1 | var·_tagTester·=·require('./index29.js'); |
2 | var·_setup·=·require('./index26.js'); | ||
3 | var·isFunction·=·_tagTester('Function'); | ||
4 | //·Optimize·`isFunction`·if·appropriate.·Work·around·some·`typeof`·bugs·in·old | ||
5 | //·v8,·IE·11·(#1621),·Safari·8·(#1929),·and·PhantomJS·(#2236). | ||
6 | var·nodelist·=·_setup.root.document·&&·_setup.root.document.childNodes; | ||
7 | if·(typeof·/./·!=·'function'·&&·typeof·Int8Array·!=·'object'·&&·typeof·nodelist·!=·'function')·{ | ||
8 | ····isFunction·=·function(obj)·{ | ||
9 | ········return·typeof·obj·==·'function'·||·false; | ||
10 | ····}; | ||
4 | } | 11 | } |
12 | var·isFunction$1·=·isFunction; | ||
5 | module.exports·=·is | 13 | module.exports·=·isFunction$1; |
Offset 1, 5 lines modified | Offset 1, 7 lines modified | ||
1 | var·_tagTester·=·require('./index29.js'); | 1 | var·_tagTester·=·require('./index29.js'); |
2 | var·_stringTagBug·=·require('./index28.js'); | ||
3 | var·_methodFingerprint·=·require('./index24.js'); | ||
2 | var·is | 4 | var·isMap·=·_stringTagBug.isIE11·?·_methodFingerprint.ie11fingerprint(_methodFingerprint.mapMethods)·:·_tagTester('Map'); |
3 | module.exports·=·is | 5 | module.exports·=·isMap; |
Offset 1, 7 lines modified | Offset 1, 16 lines modified | ||
1 | //·Is·a·given·variable·an·object? | ||
2 | function·isObject(obj)·{ | ||
3 | ····var·type·=·typeof·obj; | ||
4 | 1 | var·keys·=·require('./index149.js'); | |
2 | //·Returns·whether·an·object·has·a·given·set·of·`key:value`·pairs. | ||
3 | function·isMatch(object,·attrs)·{ | ||
4 | ····var·_keys·=·keys(attrs), | ||
5 | ········length·=·_keys.length; | ||
6 | ····if·(object·==·null)·return·!length; | ||
7 | ····var·obj·=·Object(object); | ||
8 | ····for·(var·i·=·0;·i·<·length;·i++)·{ | ||
9 | ········var·key·=·_keys[i]; | ||
10 | ········if·(attrs[key]·!==·obj[key]·||·!(key·in·obj))·return·false; | ||
11 | ····} | ||
12 | ····return·true; | ||
5 | } | 13 | } |
6 | module.exports·=·is | 14 | module.exports·=·isMatch; |
Offset 1, 5 lines modified | Offset 1, 9 lines modified | ||
1 | var·_setup·=·require('./index26.js'); | ||
1 | var· | 2 | var·isNumber·=·require('./index93.js'); |
2 | 3 | //·Is·the·given·value·`NaN`? | |
4 | function·isNaN(obj)·{ | ||
5 | ····return·isNumber(obj)·&&·_setup._isNaN(obj); | ||
6 | } | ||
3 | module.exports·=·is | 7 | module.exports·=·isNaN; |
Offset 1, 7 lines modified | Offset 1, 6 lines modified | ||
1 | var·_tagTester·=·require('./index29.js'); | ||
2 | var·_stringTagBug·=·require('./index28.js'); | ||
3 | 1 | //·Is·a·given·value·equal·to·null? | |
2 | function·isNull(obj)·{ | ||
3 | ····return·obj·===·null; | ||
4 | } | ||
4 | var·isSet·=·_stringTagBug.isIE11·?·_methodFingerprint.ie11fingerprint(_methodFingerprint.setMethods)·:·_tagTester('Set'); | ||
5 | module.exports·=·is | 5 | module.exports·=·isNull; |
Offset 1, 5 lines modified | Offset 1, 5 lines modified | ||
1 | var·_tagTester·=·require('./index29.js'); | 1 | var·_tagTester·=·require('./index29.js'); |
2 | var·is | 2 | var·isNumber·=·_tagTester('Number'); |
3 | module.exports·=·is | 3 | module.exports·=·isNumber; |
Offset 1, 5 lines modified | Offset 1, 7 lines modified | ||
1 | 1 | //·Is·a·given·variable·an·object? | |
2 | function·isObject(obj)·{ | ||
3 | ····var·type·=·typeof·obj; | ||
4 | ····return·type·===·'function'·||·(type·===·'object'·&&·!!obj); | ||
5 | } | ||
2 | var·isSymbol·=·_tagTester('Symbol'); | ||
3 | module.exports·=·is | 6 | module.exports·=·isObject; |
Offset 1, 18 lines modified | Offset 1, 5 lines modified | ||
1 | var·_ | 1 | var·_tagTester·=·require('./index29.js'); |
2 | var·isDataView·=·require('./index77.js'); | ||
3 | var·constant·=·require('./index42.js'); | ||
4 | var·_isBufferLike·=·require('./index22.js'); | ||
2 | var·isRegExp·=·_tagTester('RegExp'); | ||
5 | //·Is·a·given·value·a·typed·array? | ||
6 | var·typedArrayPattern·=·/\[object·((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; | ||
3 | module.exports·=·isRegExp; | ||
7 | function·isTypedArray(obj)·{ | ||
8 | ····//·`ArrayBuffer.isView`·is·the·most·future-proof,·so·use·it·when·available. | ||
9 | ····//·Otherwise,·fall·back·on·the·above·regular·expression. | ||
10 | ····return·_setup.nativeIsView·?·(_setup.nativeIsView(obj)·&&·!isDataView(obj))·: | ||
11 | ········_isBufferLike(obj)·&&·typedArrayPattern.test(_setup.toString.call(obj)); | ||
12 | } | ||
13 | var·isTypedArray$1·=·_setup.supportsArrayBuffer·?·isTypedArray·:·constant(false); | ||
14 | module.exports·=·isTypedArray$1; |
Offset 1, 6 lines modified | Offset 1, 7 lines modified | ||
1 | var·_tagTester·=·require('./index29.js'); | ||
2 | var·_stringTagBug·=·require('./index28.js'); | ||
3 | var·_methodFingerprint·=·require('./index24.js'); | ||
1 | //·Is·a·given·variable·undefined? | ||
2 | function·isUndefined(obj)·{ | ||
3 | ····return·obj·===·void·0; | ||
4 | } | ||
4 | var·isSet·=·_stringTagBug.isIE11·?·_methodFingerprint.ie11fingerprint(_methodFingerprint.setMethods)·:·_tagTester('Set'); | ||
5 | module.exports·=·is | 5 | module.exports·=·isSet; |
Offset 1, 7 lines modified | Offset 1, 5 lines modified | ||
1 | var·_tagTester·=·require('./index29.js'); | 1 | var·_tagTester·=·require('./index29.js'); |
2 | var·_stringTagBug·=·require('./index28.js'); | ||
3 | var·_methodFingerprint·=·require('./index24.js'); | ||
4 | var·is | 2 | var·isString·=·_tagTester('String'); |
5 | module.exports·=·is | 3 | module.exports·=·isString; |
Offset 1, 5 lines modified | Offset 1, 5 lines modified | ||
1 | var·_tagTester·=·require('./index29.js'); | 1 | var·_tagTester·=·require('./index29.js'); |
2 | var·is | 2 | var·isSymbol·=·_tagTester('Symbol'); |
3 | module.exports·=·is | 3 | module.exports·=·isSymbol; |
Offset 1, 12 lines modified | Offset 1, 18 lines modified | ||
1 | var·underscore·=·require('./index149.js'); | ||
2 | var·_ | 1 | var·_setup·=·require('./index26.js'); |
2 | var·isDataView·=·require('./index81.js'); | ||
3 | var·constant·=·require('./index43.js'); | ||
4 | var·_isBufferLike·=·require('./index22.js'); | ||
3 | //·External·wrapper·for·our·callback·generator.·Users·may·customize | ||
4 | //·`_.iteratee`·if·they·want·additional·predicate/iteratee·shorthand·styles. | ||
5 | //·This·abstraction·hides·the·internal-only·`argCount`·argument. | ||
6 | function·iteratee(value,·context)·{ | ||
7 | 5 | //·Is·a·given·value·a·typed·array? | |
6 | var·typedArrayPattern·=·/\[object·((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; | ||
7 | function·isTypedArray(obj)·{ | ||
8 | ····//·`ArrayBuffer.isView`·is·the·most·future-proof,·so·use·it·when·available. | ||
9 | ····//·Otherwise,·fall·back·on·the·above·regular·expression. | ||
10 | ····return·_setup.nativeIsView·?·(_setup.nativeIsView(obj)·&&·!isDataView(obj))·: | ||
11 | ········_isBufferLike(obj)·&&·typedArrayPattern.test(_setup.toString.call(obj)); | ||
8 | } | 12 | } |
9 | underscore.iteratee·=·iteratee; | ||
13 | var·isTypedArray$1·=·_setup.supportsArrayBuffer·?·isTypedArray·:·constant(false); | ||
10 | module.exports·=·i | 14 | module.exports·=·isTypedArray$1; |