@donmahallem/lerna2codecov 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/dist/cjs/_virtual/git-host-info.cjs +8 -0
  2. package/dist/cjs/_virtual/git-host-info.cjs.map +1 -0
  3. package/dist/cjs/_virtual/index3.cjs +2 -2
  4. package/dist/cjs/_virtual/index4.cjs +2 -2
  5. package/dist/cjs/node_modules/@lerna/package/index.cjs +3 -4
  6. package/dist/cjs/node_modules/@lerna/package/index.cjs.map +1 -1
  7. package/dist/cjs/node_modules/hosted-git-info/git-host-info.cjs +89 -183
  8. package/dist/cjs/node_modules/hosted-git-info/git-host-info.cjs.map +1 -1
  9. package/dist/cjs/node_modules/hosted-git-info/git-host.cjs +165 -109
  10. package/dist/cjs/node_modules/hosted-git-info/git-host.cjs.map +1 -1
  11. package/dist/cjs/node_modules/hosted-git-info/index.cjs +157 -238
  12. package/dist/cjs/node_modules/hosted-git-info/index.cjs.map +1 -1
  13. package/dist/cjs/node_modules/load-json-file/index.cjs +7 -7
  14. package/dist/cjs/node_modules/lru-cache/index.cjs +343 -332
  15. package/dist/cjs/node_modules/lru-cache/index.cjs.map +1 -1
  16. package/dist/cjs/node_modules/npm-package-arg/npa.cjs +95 -141
  17. package/dist/cjs/node_modules/npm-package-arg/npa.cjs.map +1 -1
  18. package/dist/cjs/node_modules/semver/classes/comparator.cjs +6 -7
  19. package/dist/cjs/node_modules/semver/classes/comparator.cjs.map +1 -1
  20. package/dist/cjs/node_modules/semver/classes/range.cjs +6 -7
  21. package/dist/cjs/node_modules/semver/classes/range.cjs.map +1 -1
  22. package/dist/cjs/node_modules/semver/classes/semver.cjs +301 -292
  23. package/dist/cjs/node_modules/semver/classes/semver.cjs.map +1 -1
  24. package/dist/cjs/node_modules/semver/functions/clean.cjs +18 -8
  25. package/dist/cjs/node_modules/semver/functions/clean.cjs.map +1 -1
  26. package/dist/cjs/node_modules/semver/functions/cmp.cjs +60 -50
  27. package/dist/cjs/node_modules/semver/functions/cmp.cjs.map +1 -1
  28. package/dist/cjs/node_modules/semver/functions/coerce.cjs +67 -58
  29. package/dist/cjs/node_modules/semver/functions/coerce.cjs.map +1 -1
  30. package/dist/cjs/node_modules/semver/functions/compare-build.cjs +18 -8
  31. package/dist/cjs/node_modules/semver/functions/compare-build.cjs.map +1 -1
  32. package/dist/cjs/node_modules/semver/functions/compare-loose.cjs +15 -5
  33. package/dist/cjs/node_modules/semver/functions/compare-loose.cjs.map +1 -1
  34. package/dist/cjs/node_modules/semver/functions/compare.cjs +15 -5
  35. package/dist/cjs/node_modules/semver/functions/compare.cjs.map +1 -1
  36. package/dist/cjs/node_modules/semver/functions/diff.cjs +35 -25
  37. package/dist/cjs/node_modules/semver/functions/diff.cjs.map +1 -1
  38. package/dist/cjs/node_modules/semver/functions/eq.cjs +15 -5
  39. package/dist/cjs/node_modules/semver/functions/eq.cjs.map +1 -1
  40. package/dist/cjs/node_modules/semver/functions/gt.cjs +15 -5
  41. package/dist/cjs/node_modules/semver/functions/gt.cjs.map +1 -1
  42. package/dist/cjs/node_modules/semver/functions/gte.cjs +15 -5
  43. package/dist/cjs/node_modules/semver/functions/gte.cjs.map +1 -1
  44. package/dist/cjs/node_modules/semver/functions/inc.cjs +27 -17
  45. package/dist/cjs/node_modules/semver/functions/inc.cjs.map +1 -1
  46. package/dist/cjs/node_modules/semver/functions/lt.cjs +15 -5
  47. package/dist/cjs/node_modules/semver/functions/lt.cjs.map +1 -1
  48. package/dist/cjs/node_modules/semver/functions/lte.cjs +15 -5
  49. package/dist/cjs/node_modules/semver/functions/lte.cjs.map +1 -1
  50. package/dist/cjs/node_modules/semver/functions/major.cjs +14 -4
  51. package/dist/cjs/node_modules/semver/functions/major.cjs.map +1 -1
  52. package/dist/cjs/node_modules/semver/functions/minor.cjs +14 -4
  53. package/dist/cjs/node_modules/semver/functions/minor.cjs.map +1 -1
  54. package/dist/cjs/node_modules/semver/functions/neq.cjs +15 -5
  55. package/dist/cjs/node_modules/semver/functions/neq.cjs.map +1 -1
  56. package/dist/cjs/node_modules/semver/functions/parse.cjs +48 -39
  57. package/dist/cjs/node_modules/semver/functions/parse.cjs.map +1 -1
  58. package/dist/cjs/node_modules/semver/functions/patch.cjs +14 -4
  59. package/dist/cjs/node_modules/semver/functions/patch.cjs.map +1 -1
  60. package/dist/cjs/node_modules/semver/functions/prerelease.cjs +18 -8
  61. package/dist/cjs/node_modules/semver/functions/prerelease.cjs.map +1 -1
  62. package/dist/cjs/node_modules/semver/functions/rcompare.cjs +15 -5
  63. package/dist/cjs/node_modules/semver/functions/rcompare.cjs.map +1 -1
  64. package/dist/cjs/node_modules/semver/functions/rsort.cjs +15 -5
  65. package/dist/cjs/node_modules/semver/functions/rsort.cjs.map +1 -1
  66. package/dist/cjs/node_modules/semver/functions/satisfies.cjs +21 -11
  67. package/dist/cjs/node_modules/semver/functions/satisfies.cjs.map +1 -1
  68. package/dist/cjs/node_modules/semver/functions/sort.cjs +15 -5
  69. package/dist/cjs/node_modules/semver/functions/sort.cjs.map +1 -1
  70. package/dist/cjs/node_modules/semver/functions/valid.cjs +18 -8
  71. package/dist/cjs/node_modules/semver/functions/valid.cjs.map +1 -1
  72. package/dist/cjs/node_modules/semver/index.cjs +60 -51
  73. package/dist/cjs/node_modules/semver/index.cjs.map +1 -1
  74. package/dist/cjs/node_modules/semver/internal/constants.cjs +25 -15
  75. package/dist/cjs/node_modules/semver/internal/constants.cjs.map +1 -1
  76. package/dist/cjs/node_modules/semver/internal/debug.cjs +19 -9
  77. package/dist/cjs/node_modules/semver/internal/debug.cjs.map +1 -1
  78. package/dist/cjs/node_modules/semver/internal/identifiers.cjs +35 -25
  79. package/dist/cjs/node_modules/semver/internal/identifiers.cjs.map +1 -1
  80. package/dist/cjs/node_modules/semver/internal/parse-options.cjs +22 -12
  81. package/dist/cjs/node_modules/semver/internal/parse-options.cjs.map +1 -1
  82. package/dist/cjs/node_modules/semver/internal/re.cjs +172 -161
  83. package/dist/cjs/node_modules/semver/internal/re.cjs.map +1 -1
  84. package/dist/cjs/node_modules/semver/ranges/gtr.cjs +16 -6
  85. package/dist/cjs/node_modules/semver/ranges/gtr.cjs.map +1 -1
  86. package/dist/cjs/node_modules/semver/ranges/intersects.cjs +18 -8
  87. package/dist/cjs/node_modules/semver/ranges/intersects.cjs.map +1 -1
  88. package/dist/cjs/node_modules/semver/ranges/ltr.cjs +16 -6
  89. package/dist/cjs/node_modules/semver/ranges/ltr.cjs.map +1 -1
  90. package/dist/cjs/node_modules/semver/ranges/max-satisfying.cjs +35 -25
  91. package/dist/cjs/node_modules/semver/ranges/max-satisfying.cjs.map +1 -1
  92. package/dist/cjs/node_modules/semver/ranges/min-satisfying.cjs +35 -25
  93. package/dist/cjs/node_modules/semver/ranges/min-satisfying.cjs.map +1 -1
  94. package/dist/cjs/node_modules/semver/ranges/min-version.cjs +66 -56
  95. package/dist/cjs/node_modules/semver/ranges/min-version.cjs.map +1 -1
  96. package/dist/cjs/node_modules/semver/ranges/outside.cjs +86 -76
  97. package/dist/cjs/node_modules/semver/ranges/outside.cjs.map +1 -1
  98. package/dist/cjs/node_modules/semver/ranges/simplify.cjs +59 -49
  99. package/dist/cjs/node_modules/semver/ranges/simplify.cjs.map +1 -1
  100. package/dist/cjs/node_modules/semver/ranges/subset.cjs +259 -249
  101. package/dist/cjs/node_modules/semver/ranges/subset.cjs.map +1 -1
  102. package/dist/cjs/node_modules/semver/ranges/to-comparators.cjs +17 -7
  103. package/dist/cjs/node_modules/semver/ranges/to-comparators.cjs.map +1 -1
  104. package/dist/cjs/node_modules/semver/ranges/valid.cjs +22 -12
  105. package/dist/cjs/node_modules/semver/ranges/valid.cjs.map +1 -1
  106. package/dist/cjs/node_modules/supports-color/index.cjs +3 -3
  107. package/dist/cjs/node_modules/validate-npm-package-name/index.cjs +118 -108
  108. package/dist/cjs/node_modules/validate-npm-package-name/index.cjs.map +1 -1
  109. package/dist/cjs/node_modules/write-pkg/index.cjs +3 -3
  110. package/dist/cjs/node_modules/write-pkg/node_modules/make-dir/index.cjs +3 -3
  111. package/dist/cjs/node_modules/write-pkg/node_modules/make-dir/index.cjs.map +1 -1
  112. package/dist/cjs/node_modules/write-pkg/node_modules/write-file-atomic/index.cjs +3 -3
  113. package/dist/cjs/node_modules/write-pkg/node_modules/write-json-file/index.cjs +3 -3
  114. package/dist/cjs/node_modules/yallist/yallist.cjs +435 -425
  115. package/dist/cjs/node_modules/yallist/yallist.cjs.map +1 -1
  116. package/dist/cjs/update-config.cjs +2 -2
  117. package/dist/esm/_virtual/git-host-info.mjs +4 -0
  118. package/dist/esm/_virtual/git-host-info.mjs.map +1 -0
  119. package/dist/esm/_virtual/index3.mjs +2 -2
  120. package/dist/esm/_virtual/index4.mjs +2 -2
  121. package/dist/esm/node_modules/@lerna/package/index.mjs +2 -3
  122. package/dist/esm/node_modules/@lerna/package/index.mjs.map +1 -1
  123. package/dist/esm/node_modules/hosted-git-info/git-host-info.mjs +87 -183
  124. package/dist/esm/node_modules/hosted-git-info/git-host-info.mjs.map +1 -1
  125. package/dist/esm/node_modules/hosted-git-info/git-host.mjs +165 -111
  126. package/dist/esm/node_modules/hosted-git-info/git-host.mjs.map +1 -1
  127. package/dist/esm/node_modules/hosted-git-info/index.mjs +159 -242
  128. package/dist/esm/node_modules/hosted-git-info/index.mjs.map +1 -1
  129. package/dist/esm/node_modules/load-json-file/index.mjs +2 -2
  130. package/dist/esm/node_modules/load-json-file/index.mjs.map +1 -1
  131. package/dist/esm/node_modules/lru-cache/index.mjs +343 -334
  132. package/dist/esm/node_modules/lru-cache/index.mjs.map +1 -1
  133. package/dist/esm/node_modules/npm-package-arg/npa.mjs +93 -139
  134. package/dist/esm/node_modules/npm-package-arg/npa.mjs.map +1 -1
  135. package/dist/esm/node_modules/semver/classes/comparator.mjs +11 -12
  136. package/dist/esm/node_modules/semver/classes/comparator.mjs.map +1 -1
  137. package/dist/esm/node_modules/semver/classes/range.mjs +21 -22
  138. package/dist/esm/node_modules/semver/classes/range.mjs.map +1 -1
  139. package/dist/esm/node_modules/semver/classes/semver.mjs +301 -294
  140. package/dist/esm/node_modules/semver/classes/semver.mjs.map +1 -1
  141. package/dist/esm/node_modules/semver/functions/clean.mjs +16 -8
  142. package/dist/esm/node_modules/semver/functions/clean.mjs.map +1 -1
  143. package/dist/esm/node_modules/semver/functions/cmp.mjs +69 -61
  144. package/dist/esm/node_modules/semver/functions/cmp.mjs.map +1 -1
  145. package/dist/esm/node_modules/semver/functions/coerce.mjs +66 -59
  146. package/dist/esm/node_modules/semver/functions/coerce.mjs.map +1 -1
  147. package/dist/esm/node_modules/semver/functions/compare-build.mjs +17 -9
  148. package/dist/esm/node_modules/semver/functions/compare-build.mjs.map +1 -1
  149. package/dist/esm/node_modules/semver/functions/compare-loose.mjs +13 -5
  150. package/dist/esm/node_modules/semver/functions/compare-loose.mjs.map +1 -1
  151. package/dist/esm/node_modules/semver/functions/compare.mjs +14 -6
  152. package/dist/esm/node_modules/semver/functions/compare.mjs.map +1 -1
  153. package/dist/esm/node_modules/semver/functions/diff.mjs +33 -25
  154. package/dist/esm/node_modules/semver/functions/diff.mjs.map +1 -1
  155. package/dist/esm/node_modules/semver/functions/eq.mjs +13 -5
  156. package/dist/esm/node_modules/semver/functions/eq.mjs.map +1 -1
  157. package/dist/esm/node_modules/semver/functions/gt.mjs +13 -5
  158. package/dist/esm/node_modules/semver/functions/gt.mjs.map +1 -1
  159. package/dist/esm/node_modules/semver/functions/gte.mjs +13 -5
  160. package/dist/esm/node_modules/semver/functions/gte.mjs.map +1 -1
  161. package/dist/esm/node_modules/semver/functions/inc.mjs +26 -18
  162. package/dist/esm/node_modules/semver/functions/inc.mjs.map +1 -1
  163. package/dist/esm/node_modules/semver/functions/lt.mjs +13 -5
  164. package/dist/esm/node_modules/semver/functions/lt.mjs.map +1 -1
  165. package/dist/esm/node_modules/semver/functions/lte.mjs +13 -5
  166. package/dist/esm/node_modules/semver/functions/lte.mjs.map +1 -1
  167. package/dist/esm/node_modules/semver/functions/major.mjs +13 -5
  168. package/dist/esm/node_modules/semver/functions/major.mjs.map +1 -1
  169. package/dist/esm/node_modules/semver/functions/minor.mjs +13 -5
  170. package/dist/esm/node_modules/semver/functions/minor.mjs.map +1 -1
  171. package/dist/esm/node_modules/semver/functions/neq.mjs +13 -5
  172. package/dist/esm/node_modules/semver/functions/neq.mjs.map +1 -1
  173. package/dist/esm/node_modules/semver/functions/parse.mjs +48 -41
  174. package/dist/esm/node_modules/semver/functions/parse.mjs.map +1 -1
  175. package/dist/esm/node_modules/semver/functions/patch.mjs +13 -5
  176. package/dist/esm/node_modules/semver/functions/patch.mjs.map +1 -1
  177. package/dist/esm/node_modules/semver/functions/prerelease.mjs +16 -8
  178. package/dist/esm/node_modules/semver/functions/prerelease.mjs.map +1 -1
  179. package/dist/esm/node_modules/semver/functions/rcompare.mjs +13 -5
  180. package/dist/esm/node_modules/semver/functions/rcompare.mjs.map +1 -1
  181. package/dist/esm/node_modules/semver/functions/rsort.mjs +13 -5
  182. package/dist/esm/node_modules/semver/functions/rsort.mjs.map +1 -1
  183. package/dist/esm/node_modules/semver/functions/satisfies.mjs +19 -11
  184. package/dist/esm/node_modules/semver/functions/satisfies.mjs.map +1 -1
  185. package/dist/esm/node_modules/semver/functions/sort.mjs +13 -5
  186. package/dist/esm/node_modules/semver/functions/sort.mjs.map +1 -1
  187. package/dist/esm/node_modules/semver/functions/valid.mjs +16 -8
  188. package/dist/esm/node_modules/semver/functions/valid.mjs.map +1 -1
  189. package/dist/esm/node_modules/semver/index.mjs +96 -89
  190. package/dist/esm/node_modules/semver/index.mjs.map +1 -1
  191. package/dist/esm/node_modules/semver/internal/constants.mjs +23 -15
  192. package/dist/esm/node_modules/semver/internal/constants.mjs.map +1 -1
  193. package/dist/esm/node_modules/semver/internal/debug.mjs +17 -9
  194. package/dist/esm/node_modules/semver/internal/debug.mjs.map +1 -1
  195. package/dist/esm/node_modules/semver/internal/identifiers.mjs +28 -20
  196. package/dist/esm/node_modules/semver/internal/identifiers.mjs.map +1 -1
  197. package/dist/esm/node_modules/semver/internal/parse-options.mjs +20 -12
  198. package/dist/esm/node_modules/semver/internal/parse-options.mjs.map +1 -1
  199. package/dist/esm/node_modules/semver/internal/re.mjs +175 -166
  200. package/dist/esm/node_modules/semver/internal/re.mjs.map +1 -1
  201. package/dist/esm/node_modules/semver/ranges/gtr.mjs +14 -6
  202. package/dist/esm/node_modules/semver/ranges/gtr.mjs.map +1 -1
  203. package/dist/esm/node_modules/semver/ranges/intersects.mjs +16 -8
  204. package/dist/esm/node_modules/semver/ranges/intersects.mjs.map +1 -1
  205. package/dist/esm/node_modules/semver/ranges/ltr.mjs +14 -6
  206. package/dist/esm/node_modules/semver/ranges/ltr.mjs.map +1 -1
  207. package/dist/esm/node_modules/semver/ranges/max-satisfying.mjs +34 -26
  208. package/dist/esm/node_modules/semver/ranges/max-satisfying.mjs.map +1 -1
  209. package/dist/esm/node_modules/semver/ranges/min-satisfying.mjs +34 -26
  210. package/dist/esm/node_modules/semver/ranges/min-satisfying.mjs.map +1 -1
  211. package/dist/esm/node_modules/semver/ranges/min-version.mjs +65 -57
  212. package/dist/esm/node_modules/semver/ranges/min-version.mjs.map +1 -1
  213. package/dist/esm/node_modules/semver/ranges/outside.mjs +85 -77
  214. package/dist/esm/node_modules/semver/ranges/outside.mjs.map +1 -1
  215. package/dist/esm/node_modules/semver/ranges/simplify.mjs +57 -49
  216. package/dist/esm/node_modules/semver/ranges/simplify.mjs.map +1 -1
  217. package/dist/esm/node_modules/semver/ranges/subset.mjs +257 -249
  218. package/dist/esm/node_modules/semver/ranges/subset.mjs.map +1 -1
  219. package/dist/esm/node_modules/semver/ranges/to-comparators.mjs +15 -7
  220. package/dist/esm/node_modules/semver/ranges/to-comparators.mjs.map +1 -1
  221. package/dist/esm/node_modules/semver/ranges/valid.mjs +20 -12
  222. package/dist/esm/node_modules/semver/ranges/valid.mjs.map +1 -1
  223. package/dist/esm/node_modules/supports-color/index.mjs +2 -2
  224. package/dist/esm/node_modules/validate-npm-package-name/index.mjs +114 -107
  225. package/dist/esm/node_modules/validate-npm-package-name/index.mjs.map +1 -1
  226. package/dist/esm/node_modules/write-pkg/index.mjs +2 -2
  227. package/dist/esm/node_modules/write-pkg/index.mjs.map +1 -1
  228. package/dist/esm/node_modules/write-pkg/node_modules/make-dir/index.mjs +2 -2
  229. package/dist/esm/node_modules/write-pkg/node_modules/make-dir/index.mjs.map +1 -1
  230. package/dist/esm/node_modules/write-pkg/node_modules/write-file-atomic/index.mjs +2 -2
  231. package/dist/esm/node_modules/write-pkg/node_modules/write-file-atomic/index.mjs.map +1 -1
  232. package/dist/esm/node_modules/write-pkg/node_modules/write-json-file/index.mjs +2 -2
  233. package/dist/esm/node_modules/write-pkg/node_modules/write-json-file/index.mjs.map +1 -1
  234. package/dist/esm/node_modules/yallist/yallist.mjs +433 -425
  235. package/dist/esm/node_modules/yallist/yallist.mjs.map +1 -1
  236. package/package.json +4 -4
@@ -1,432 +1,442 @@
1
1
  'use strict';
2
2
 
3
- const iterator = require('./iterator.cjs');
4
-
5
- var yallist = Yallist;
6
-
7
- Yallist.Node = Node;
8
- Yallist.create = Yallist;
9
-
10
- function Yallist (list) {
11
- var self = this;
12
- if (!(self instanceof Yallist)) {
13
- self = new Yallist();
14
- }
15
-
16
- self.tail = null;
17
- self.head = null;
18
- self.length = 0;
19
-
20
- if (list && typeof list.forEach === 'function') {
21
- list.forEach(function (item) {
22
- self.push(item);
23
- });
24
- } else if (arguments.length > 0) {
25
- for (var i = 0, l = arguments.length; i < l; i++) {
26
- self.push(arguments[i]);
27
- }
28
- }
29
-
30
- return self
31
- }
3
+ Object.defineProperty(exports, '__esModule', { value: true });
32
4
 
33
- Yallist.prototype.removeNode = function (node) {
34
- if (node.list !== this) {
35
- throw new Error('removing node which does not belong to this list')
36
- }
37
-
38
- var next = node.next;
39
- var prev = node.prev;
40
-
41
- if (next) {
42
- next.prev = prev;
43
- }
44
-
45
- if (prev) {
46
- prev.next = next;
47
- }
48
-
49
- if (node === this.head) {
50
- this.head = next;
51
- }
52
- if (node === this.tail) {
53
- this.tail = prev;
54
- }
55
-
56
- node.list.length--;
57
- node.next = null;
58
- node.prev = null;
59
- node.list = null;
60
-
61
- return next
62
- };
63
-
64
- Yallist.prototype.unshiftNode = function (node) {
65
- if (node === this.head) {
66
- return
67
- }
68
-
69
- if (node.list) {
70
- node.list.removeNode(node);
71
- }
72
-
73
- var head = this.head;
74
- node.list = this;
75
- node.next = head;
76
- if (head) {
77
- head.prev = node;
78
- }
79
-
80
- this.head = node;
81
- if (!this.tail) {
82
- this.tail = node;
83
- }
84
- this.length++;
85
- };
86
-
87
- Yallist.prototype.pushNode = function (node) {
88
- if (node === this.tail) {
89
- return
90
- }
91
-
92
- if (node.list) {
93
- node.list.removeNode(node);
94
- }
95
-
96
- var tail = this.tail;
97
- node.list = this;
98
- node.prev = tail;
99
- if (tail) {
100
- tail.next = node;
101
- }
102
-
103
- this.tail = node;
104
- if (!this.head) {
105
- this.head = node;
106
- }
107
- this.length++;
108
- };
109
-
110
- Yallist.prototype.push = function () {
111
- for (var i = 0, l = arguments.length; i < l; i++) {
112
- push(this, arguments[i]);
113
- }
114
- return this.length
115
- };
116
-
117
- Yallist.prototype.unshift = function () {
118
- for (var i = 0, l = arguments.length; i < l; i++) {
119
- unshift(this, arguments[i]);
120
- }
121
- return this.length
122
- };
123
-
124
- Yallist.prototype.pop = function () {
125
- if (!this.tail) {
126
- return undefined
127
- }
128
-
129
- var res = this.tail.value;
130
- this.tail = this.tail.prev;
131
- if (this.tail) {
132
- this.tail.next = null;
133
- } else {
134
- this.head = null;
135
- }
136
- this.length--;
137
- return res
138
- };
139
-
140
- Yallist.prototype.shift = function () {
141
- if (!this.head) {
142
- return undefined
143
- }
144
-
145
- var res = this.head.value;
146
- this.head = this.head.next;
147
- if (this.head) {
148
- this.head.prev = null;
149
- } else {
150
- this.tail = null;
151
- }
152
- this.length--;
153
- return res
154
- };
155
-
156
- Yallist.prototype.forEach = function (fn, thisp) {
157
- thisp = thisp || this;
158
- for (var walker = this.head, i = 0; walker !== null; i++) {
159
- fn.call(thisp, walker.value, i, this);
160
- walker = walker.next;
161
- }
162
- };
163
-
164
- Yallist.prototype.forEachReverse = function (fn, thisp) {
165
- thisp = thisp || this;
166
- for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
167
- fn.call(thisp, walker.value, i, this);
168
- walker = walker.prev;
169
- }
170
- };
171
-
172
- Yallist.prototype.get = function (n) {
173
- for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
174
- // abort out of the list early if we hit a cycle
175
- walker = walker.next;
176
- }
177
- if (i === n && walker !== null) {
178
- return walker.value
179
- }
180
- };
181
-
182
- Yallist.prototype.getReverse = function (n) {
183
- for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
184
- // abort out of the list early if we hit a cycle
185
- walker = walker.prev;
186
- }
187
- if (i === n && walker !== null) {
188
- return walker.value
189
- }
190
- };
191
-
192
- Yallist.prototype.map = function (fn, thisp) {
193
- thisp = thisp || this;
194
- var res = new Yallist();
195
- for (var walker = this.head; walker !== null;) {
196
- res.push(fn.call(thisp, walker.value, this));
197
- walker = walker.next;
198
- }
199
- return res
200
- };
201
-
202
- Yallist.prototype.mapReverse = function (fn, thisp) {
203
- thisp = thisp || this;
204
- var res = new Yallist();
205
- for (var walker = this.tail; walker !== null;) {
206
- res.push(fn.call(thisp, walker.value, this));
207
- walker = walker.prev;
208
- }
209
- return res
210
- };
211
-
212
- Yallist.prototype.reduce = function (fn, initial) {
213
- var acc;
214
- var walker = this.head;
215
- if (arguments.length > 1) {
216
- acc = initial;
217
- } else if (this.head) {
218
- walker = this.head.next;
219
- acc = this.head.value;
220
- } else {
221
- throw new TypeError('Reduce of empty list with no initial value')
222
- }
223
-
224
- for (var i = 0; walker !== null; i++) {
225
- acc = fn(acc, walker.value, i);
226
- walker = walker.next;
227
- }
228
-
229
- return acc
230
- };
231
-
232
- Yallist.prototype.reduceReverse = function (fn, initial) {
233
- var acc;
234
- var walker = this.tail;
235
- if (arguments.length > 1) {
236
- acc = initial;
237
- } else if (this.tail) {
238
- walker = this.tail.prev;
239
- acc = this.tail.value;
240
- } else {
241
- throw new TypeError('Reduce of empty list with no initial value')
242
- }
243
-
244
- for (var i = this.length - 1; walker !== null; i--) {
245
- acc = fn(acc, walker.value, i);
246
- walker = walker.prev;
247
- }
248
-
249
- return acc
250
- };
251
-
252
- Yallist.prototype.toArray = function () {
253
- var arr = new Array(this.length);
254
- for (var i = 0, walker = this.head; walker !== null; i++) {
255
- arr[i] = walker.value;
256
- walker = walker.next;
257
- }
258
- return arr
259
- };
260
-
261
- Yallist.prototype.toArrayReverse = function () {
262
- var arr = new Array(this.length);
263
- for (var i = 0, walker = this.tail; walker !== null; i++) {
264
- arr[i] = walker.value;
265
- walker = walker.prev;
266
- }
267
- return arr
268
- };
269
-
270
- Yallist.prototype.slice = function (from, to) {
271
- to = to || this.length;
272
- if (to < 0) {
273
- to += this.length;
274
- }
275
- from = from || 0;
276
- if (from < 0) {
277
- from += this.length;
278
- }
279
- var ret = new Yallist();
280
- if (to < from || to < 0) {
281
- return ret
282
- }
283
- if (from < 0) {
284
- from = 0;
285
- }
286
- if (to > this.length) {
287
- to = this.length;
288
- }
289
- for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
290
- walker = walker.next;
291
- }
292
- for (; walker !== null && i < to; i++, walker = walker.next) {
293
- ret.push(walker.value);
294
- }
295
- return ret
296
- };
297
-
298
- Yallist.prototype.sliceReverse = function (from, to) {
299
- to = to || this.length;
300
- if (to < 0) {
301
- to += this.length;
302
- }
303
- from = from || 0;
304
- if (from < 0) {
305
- from += this.length;
306
- }
307
- var ret = new Yallist();
308
- if (to < from || to < 0) {
309
- return ret
310
- }
311
- if (from < 0) {
312
- from = 0;
313
- }
314
- if (to > this.length) {
315
- to = this.length;
316
- }
317
- for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
318
- walker = walker.prev;
319
- }
320
- for (; walker !== null && i > from; i--, walker = walker.prev) {
321
- ret.push(walker.value);
322
- }
323
- return ret
324
- };
325
-
326
- Yallist.prototype.splice = function (start, deleteCount, ...nodes) {
327
- if (start > this.length) {
328
- start = this.length - 1;
329
- }
330
- if (start < 0) {
331
- start = this.length + start;
332
- }
333
-
334
- for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
335
- walker = walker.next;
336
- }
337
-
338
- var ret = [];
339
- for (var i = 0; walker && i < deleteCount; i++) {
340
- ret.push(walker.value);
341
- walker = this.removeNode(walker);
342
- }
343
- if (walker === null) {
344
- walker = this.tail;
345
- }
346
-
347
- if (walker !== this.head && walker !== this.tail) {
348
- walker = walker.prev;
349
- }
350
-
351
- for (var i = 0; i < nodes.length; i++) {
352
- walker = insert(this, walker, nodes[i]);
353
- }
354
- return ret;
355
- };
356
-
357
- Yallist.prototype.reverse = function () {
358
- var head = this.head;
359
- var tail = this.tail;
360
- for (var walker = head; walker !== null; walker = walker.prev) {
361
- var p = walker.prev;
362
- walker.prev = walker.next;
363
- walker.next = p;
364
- }
365
- this.head = tail;
366
- this.tail = head;
367
- return this
368
- };
369
-
370
- function insert (self, node, value) {
371
- var inserted = node === self.head ?
372
- new Node(value, null, node, self) :
373
- new Node(value, node, node.next, self);
374
-
375
- if (inserted.next === null) {
376
- self.tail = inserted;
377
- }
378
- if (inserted.prev === null) {
379
- self.head = inserted;
380
- }
381
-
382
- self.length++;
383
-
384
- return inserted
385
- }
386
-
387
- function push (self, item) {
388
- self.tail = new Node(item, self.tail, null, self);
389
- if (!self.head) {
390
- self.head = self.tail;
391
- }
392
- self.length++;
393
- }
394
-
395
- function unshift (self, item) {
396
- self.head = new Node(item, null, self.head, self);
397
- if (!self.tail) {
398
- self.tail = self.head;
399
- }
400
- self.length++;
401
- }
5
+ const iterator = require('./iterator.cjs');
402
6
 
403
- function Node (value, prev, next, list) {
404
- if (!(this instanceof Node)) {
405
- return new Node(value, prev, next, list)
406
- }
407
-
408
- this.list = list;
409
- this.value = value;
410
-
411
- if (prev) {
412
- prev.next = this;
413
- this.prev = prev;
414
- } else {
415
- this.prev = null;
416
- }
417
-
418
- if (next) {
419
- next.prev = this;
420
- this.next = next;
421
- } else {
422
- this.next = null;
423
- }
7
+ var yallist;
8
+ var hasRequiredYallist;
9
+
10
+ function requireYallist () {
11
+ if (hasRequiredYallist) return yallist;
12
+ hasRequiredYallist = 1;
13
+ yallist = Yallist;
14
+
15
+ Yallist.Node = Node;
16
+ Yallist.create = Yallist;
17
+
18
+ function Yallist (list) {
19
+ var self = this;
20
+ if (!(self instanceof Yallist)) {
21
+ self = new Yallist();
22
+ }
23
+
24
+ self.tail = null;
25
+ self.head = null;
26
+ self.length = 0;
27
+
28
+ if (list && typeof list.forEach === 'function') {
29
+ list.forEach(function (item) {
30
+ self.push(item);
31
+ });
32
+ } else if (arguments.length > 0) {
33
+ for (var i = 0, l = arguments.length; i < l; i++) {
34
+ self.push(arguments[i]);
35
+ }
36
+ }
37
+
38
+ return self
39
+ }
40
+
41
+ Yallist.prototype.removeNode = function (node) {
42
+ if (node.list !== this) {
43
+ throw new Error('removing node which does not belong to this list')
44
+ }
45
+
46
+ var next = node.next;
47
+ var prev = node.prev;
48
+
49
+ if (next) {
50
+ next.prev = prev;
51
+ }
52
+
53
+ if (prev) {
54
+ prev.next = next;
55
+ }
56
+
57
+ if (node === this.head) {
58
+ this.head = next;
59
+ }
60
+ if (node === this.tail) {
61
+ this.tail = prev;
62
+ }
63
+
64
+ node.list.length--;
65
+ node.next = null;
66
+ node.prev = null;
67
+ node.list = null;
68
+
69
+ return next
70
+ };
71
+
72
+ Yallist.prototype.unshiftNode = function (node) {
73
+ if (node === this.head) {
74
+ return
75
+ }
76
+
77
+ if (node.list) {
78
+ node.list.removeNode(node);
79
+ }
80
+
81
+ var head = this.head;
82
+ node.list = this;
83
+ node.next = head;
84
+ if (head) {
85
+ head.prev = node;
86
+ }
87
+
88
+ this.head = node;
89
+ if (!this.tail) {
90
+ this.tail = node;
91
+ }
92
+ this.length++;
93
+ };
94
+
95
+ Yallist.prototype.pushNode = function (node) {
96
+ if (node === this.tail) {
97
+ return
98
+ }
99
+
100
+ if (node.list) {
101
+ node.list.removeNode(node);
102
+ }
103
+
104
+ var tail = this.tail;
105
+ node.list = this;
106
+ node.prev = tail;
107
+ if (tail) {
108
+ tail.next = node;
109
+ }
110
+
111
+ this.tail = node;
112
+ if (!this.head) {
113
+ this.head = node;
114
+ }
115
+ this.length++;
116
+ };
117
+
118
+ Yallist.prototype.push = function () {
119
+ for (var i = 0, l = arguments.length; i < l; i++) {
120
+ push(this, arguments[i]);
121
+ }
122
+ return this.length
123
+ };
124
+
125
+ Yallist.prototype.unshift = function () {
126
+ for (var i = 0, l = arguments.length; i < l; i++) {
127
+ unshift(this, arguments[i]);
128
+ }
129
+ return this.length
130
+ };
131
+
132
+ Yallist.prototype.pop = function () {
133
+ if (!this.tail) {
134
+ return undefined
135
+ }
136
+
137
+ var res = this.tail.value;
138
+ this.tail = this.tail.prev;
139
+ if (this.tail) {
140
+ this.tail.next = null;
141
+ } else {
142
+ this.head = null;
143
+ }
144
+ this.length--;
145
+ return res
146
+ };
147
+
148
+ Yallist.prototype.shift = function () {
149
+ if (!this.head) {
150
+ return undefined
151
+ }
152
+
153
+ var res = this.head.value;
154
+ this.head = this.head.next;
155
+ if (this.head) {
156
+ this.head.prev = null;
157
+ } else {
158
+ this.tail = null;
159
+ }
160
+ this.length--;
161
+ return res
162
+ };
163
+
164
+ Yallist.prototype.forEach = function (fn, thisp) {
165
+ thisp = thisp || this;
166
+ for (var walker = this.head, i = 0; walker !== null; i++) {
167
+ fn.call(thisp, walker.value, i, this);
168
+ walker = walker.next;
169
+ }
170
+ };
171
+
172
+ Yallist.prototype.forEachReverse = function (fn, thisp) {
173
+ thisp = thisp || this;
174
+ for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
175
+ fn.call(thisp, walker.value, i, this);
176
+ walker = walker.prev;
177
+ }
178
+ };
179
+
180
+ Yallist.prototype.get = function (n) {
181
+ for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
182
+ // abort out of the list early if we hit a cycle
183
+ walker = walker.next;
184
+ }
185
+ if (i === n && walker !== null) {
186
+ return walker.value
187
+ }
188
+ };
189
+
190
+ Yallist.prototype.getReverse = function (n) {
191
+ for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
192
+ // abort out of the list early if we hit a cycle
193
+ walker = walker.prev;
194
+ }
195
+ if (i === n && walker !== null) {
196
+ return walker.value
197
+ }
198
+ };
199
+
200
+ Yallist.prototype.map = function (fn, thisp) {
201
+ thisp = thisp || this;
202
+ var res = new Yallist();
203
+ for (var walker = this.head; walker !== null;) {
204
+ res.push(fn.call(thisp, walker.value, this));
205
+ walker = walker.next;
206
+ }
207
+ return res
208
+ };
209
+
210
+ Yallist.prototype.mapReverse = function (fn, thisp) {
211
+ thisp = thisp || this;
212
+ var res = new Yallist();
213
+ for (var walker = this.tail; walker !== null;) {
214
+ res.push(fn.call(thisp, walker.value, this));
215
+ walker = walker.prev;
216
+ }
217
+ return res
218
+ };
219
+
220
+ Yallist.prototype.reduce = function (fn, initial) {
221
+ var acc;
222
+ var walker = this.head;
223
+ if (arguments.length > 1) {
224
+ acc = initial;
225
+ } else if (this.head) {
226
+ walker = this.head.next;
227
+ acc = this.head.value;
228
+ } else {
229
+ throw new TypeError('Reduce of empty list with no initial value')
230
+ }
231
+
232
+ for (var i = 0; walker !== null; i++) {
233
+ acc = fn(acc, walker.value, i);
234
+ walker = walker.next;
235
+ }
236
+
237
+ return acc
238
+ };
239
+
240
+ Yallist.prototype.reduceReverse = function (fn, initial) {
241
+ var acc;
242
+ var walker = this.tail;
243
+ if (arguments.length > 1) {
244
+ acc = initial;
245
+ } else if (this.tail) {
246
+ walker = this.tail.prev;
247
+ acc = this.tail.value;
248
+ } else {
249
+ throw new TypeError('Reduce of empty list with no initial value')
250
+ }
251
+
252
+ for (var i = this.length - 1; walker !== null; i--) {
253
+ acc = fn(acc, walker.value, i);
254
+ walker = walker.prev;
255
+ }
256
+
257
+ return acc
258
+ };
259
+
260
+ Yallist.prototype.toArray = function () {
261
+ var arr = new Array(this.length);
262
+ for (var i = 0, walker = this.head; walker !== null; i++) {
263
+ arr[i] = walker.value;
264
+ walker = walker.next;
265
+ }
266
+ return arr
267
+ };
268
+
269
+ Yallist.prototype.toArrayReverse = function () {
270
+ var arr = new Array(this.length);
271
+ for (var i = 0, walker = this.tail; walker !== null; i++) {
272
+ arr[i] = walker.value;
273
+ walker = walker.prev;
274
+ }
275
+ return arr
276
+ };
277
+
278
+ Yallist.prototype.slice = function (from, to) {
279
+ to = to || this.length;
280
+ if (to < 0) {
281
+ to += this.length;
282
+ }
283
+ from = from || 0;
284
+ if (from < 0) {
285
+ from += this.length;
286
+ }
287
+ var ret = new Yallist();
288
+ if (to < from || to < 0) {
289
+ return ret
290
+ }
291
+ if (from < 0) {
292
+ from = 0;
293
+ }
294
+ if (to > this.length) {
295
+ to = this.length;
296
+ }
297
+ for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
298
+ walker = walker.next;
299
+ }
300
+ for (; walker !== null && i < to; i++, walker = walker.next) {
301
+ ret.push(walker.value);
302
+ }
303
+ return ret
304
+ };
305
+
306
+ Yallist.prototype.sliceReverse = function (from, to) {
307
+ to = to || this.length;
308
+ if (to < 0) {
309
+ to += this.length;
310
+ }
311
+ from = from || 0;
312
+ if (from < 0) {
313
+ from += this.length;
314
+ }
315
+ var ret = new Yallist();
316
+ if (to < from || to < 0) {
317
+ return ret
318
+ }
319
+ if (from < 0) {
320
+ from = 0;
321
+ }
322
+ if (to > this.length) {
323
+ to = this.length;
324
+ }
325
+ for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
326
+ walker = walker.prev;
327
+ }
328
+ for (; walker !== null && i > from; i--, walker = walker.prev) {
329
+ ret.push(walker.value);
330
+ }
331
+ return ret
332
+ };
333
+
334
+ Yallist.prototype.splice = function (start, deleteCount, ...nodes) {
335
+ if (start > this.length) {
336
+ start = this.length - 1;
337
+ }
338
+ if (start < 0) {
339
+ start = this.length + start;
340
+ }
341
+
342
+ for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
343
+ walker = walker.next;
344
+ }
345
+
346
+ var ret = [];
347
+ for (var i = 0; walker && i < deleteCount; i++) {
348
+ ret.push(walker.value);
349
+ walker = this.removeNode(walker);
350
+ }
351
+ if (walker === null) {
352
+ walker = this.tail;
353
+ }
354
+
355
+ if (walker !== this.head && walker !== this.tail) {
356
+ walker = walker.prev;
357
+ }
358
+
359
+ for (var i = 0; i < nodes.length; i++) {
360
+ walker = insert(this, walker, nodes[i]);
361
+ }
362
+ return ret;
363
+ };
364
+
365
+ Yallist.prototype.reverse = function () {
366
+ var head = this.head;
367
+ var tail = this.tail;
368
+ for (var walker = head; walker !== null; walker = walker.prev) {
369
+ var p = walker.prev;
370
+ walker.prev = walker.next;
371
+ walker.next = p;
372
+ }
373
+ this.head = tail;
374
+ this.tail = head;
375
+ return this
376
+ };
377
+
378
+ function insert (self, node, value) {
379
+ var inserted = node === self.head ?
380
+ new Node(value, null, node, self) :
381
+ new Node(value, node, node.next, self);
382
+
383
+ if (inserted.next === null) {
384
+ self.tail = inserted;
385
+ }
386
+ if (inserted.prev === null) {
387
+ self.head = inserted;
388
+ }
389
+
390
+ self.length++;
391
+
392
+ return inserted
393
+ }
394
+
395
+ function push (self, item) {
396
+ self.tail = new Node(item, self.tail, null, self);
397
+ if (!self.head) {
398
+ self.head = self.tail;
399
+ }
400
+ self.length++;
401
+ }
402
+
403
+ function unshift (self, item) {
404
+ self.head = new Node(item, null, self.head, self);
405
+ if (!self.tail) {
406
+ self.tail = self.head;
407
+ }
408
+ self.length++;
409
+ }
410
+
411
+ function Node (value, prev, next, list) {
412
+ if (!(this instanceof Node)) {
413
+ return new Node(value, prev, next, list)
414
+ }
415
+
416
+ this.list = list;
417
+ this.value = value;
418
+
419
+ if (prev) {
420
+ prev.next = this;
421
+ this.prev = prev;
422
+ } else {
423
+ this.prev = null;
424
+ }
425
+
426
+ if (next) {
427
+ next.prev = this;
428
+ this.next = next;
429
+ } else {
430
+ this.next = null;
431
+ }
432
+ }
433
+
434
+ try {
435
+ // add if support for Symbol.iterator is present
436
+ iterator.__require()(Yallist);
437
+ } catch (er) {}
438
+ return yallist;
424
439
  }
425
440
 
426
- try {
427
- // add if support for Symbol.iterator is present
428
- iterator.__require()(Yallist);
429
- } catch (er) {}
430
-
431
- module.exports = yallist;
441
+ exports.__require = requireYallist;
432
442
  //# sourceMappingURL=yallist.cjs.map