decidim 0.27.4 → 0.27.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (225) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +2 -16
  3. data/docs/modules/install/pages/manual.adoc +1 -1
  4. data/docs/modules/services/pages/maps.adoc +8 -0
  5. data/lib/decidim/version.rb +1 -1
  6. data/package-lock.json +7 -7
  7. data/packages/browserslist-config/package.json +1 -1
  8. data/packages/core/node_modules/uuid/AUTHORS +5 -0
  9. data/packages/core/node_modules/uuid/CHANGELOG.md +119 -0
  10. data/packages/{webpacker/node_modules/brace-expansion/LICENSE → core/node_modules/uuid/LICENSE.md} +2 -2
  11. data/packages/core/node_modules/uuid/README.md +276 -0
  12. data/packages/core/node_modules/uuid/bin/uuid +65 -0
  13. data/packages/core/node_modules/uuid/index.js +8 -0
  14. data/packages/core/node_modules/uuid/lib/bytesToUuid.js +26 -0
  15. data/packages/core/node_modules/uuid/lib/md5-browser.js +216 -0
  16. data/packages/core/node_modules/uuid/lib/md5.js +25 -0
  17. data/packages/core/node_modules/uuid/lib/rng-browser.js +34 -0
  18. data/packages/core/node_modules/uuid/lib/rng.js +8 -0
  19. data/packages/core/node_modules/uuid/lib/sha1-browser.js +89 -0
  20. data/packages/core/node_modules/uuid/lib/sha1.js +25 -0
  21. data/packages/core/node_modules/uuid/lib/v35.js +57 -0
  22. data/packages/core/node_modules/uuid/package.json +49 -0
  23. data/packages/core/node_modules/uuid/v1.js +109 -0
  24. data/packages/core/node_modules/uuid/v3.js +4 -0
  25. data/packages/core/node_modules/uuid/v4.js +29 -0
  26. data/packages/core/node_modules/uuid/v5.js +3 -0
  27. data/packages/core/package-lock.json +347 -3079
  28. data/packages/core/package.json +1 -1
  29. data/packages/dev/package.json +1 -1
  30. data/packages/elections/package.json +1 -1
  31. data/packages/eslint-config/package-lock.json +4797 -0
  32. data/packages/eslint-config/package.json +1 -1
  33. data/packages/stylelint-config/package.json +1 -1
  34. data/packages/webpacker/package.json +1 -1
  35. metadata +63 -234
  36. data/lib/decidim/release_manager.rb.new +0 -43
  37. data/packages/core/node_modules/diff/CONTRIBUTING.md +0 -39
  38. data/packages/core/node_modules/diff/LICENSE +0 -31
  39. data/packages/core/node_modules/diff/README.md +0 -211
  40. data/packages/core/node_modules/diff/dist/diff.js +0 -1627
  41. data/packages/core/node_modules/diff/dist/diff.min.js +0 -38
  42. data/packages/core/node_modules/diff/lib/convert/dmp.js +0 -32
  43. data/packages/core/node_modules/diff/lib/convert/xml.js +0 -42
  44. data/packages/core/node_modules/diff/lib/diff/array.js +0 -45
  45. data/packages/core/node_modules/diff/lib/diff/base.js +0 -307
  46. data/packages/core/node_modules/diff/lib/diff/character.js +0 -37
  47. data/packages/core/node_modules/diff/lib/diff/css.js +0 -41
  48. data/packages/core/node_modules/diff/lib/diff/json.js +0 -163
  49. data/packages/core/node_modules/diff/lib/diff/line.js +0 -89
  50. data/packages/core/node_modules/diff/lib/diff/sentence.js +0 -41
  51. data/packages/core/node_modules/diff/lib/diff/word.js +0 -108
  52. data/packages/core/node_modules/diff/lib/index.es6.js +0 -1561
  53. data/packages/core/node_modules/diff/lib/index.js +0 -216
  54. data/packages/core/node_modules/diff/lib/index.mjs +0 -1561
  55. data/packages/core/node_modules/diff/lib/patch/apply.js +0 -238
  56. data/packages/core/node_modules/diff/lib/patch/create.js +0 -272
  57. data/packages/core/node_modules/diff/lib/patch/merge.js +0 -613
  58. data/packages/core/node_modules/diff/lib/patch/parse.js +0 -167
  59. data/packages/core/node_modules/diff/lib/util/array.js +0 -32
  60. data/packages/core/node_modules/diff/lib/util/distance-iterator.js +0 -57
  61. data/packages/core/node_modules/diff/lib/util/params.js +0 -24
  62. data/packages/core/node_modules/diff/package.json +0 -87
  63. data/packages/core/node_modules/diff/release-notes.md +0 -309
  64. data/packages/core/node_modules/diff/runtime.js +0 -3
  65. data/packages/webpacker/node_modules/argparse/CHANGELOG.md +0 -216
  66. data/packages/webpacker/node_modules/argparse/LICENSE +0 -254
  67. data/packages/webpacker/node_modules/argparse/README.md +0 -84
  68. data/packages/webpacker/node_modules/argparse/argparse.js +0 -3707
  69. data/packages/webpacker/node_modules/argparse/lib/sub.js +0 -67
  70. data/packages/webpacker/node_modules/argparse/lib/textwrap.js +0 -440
  71. data/packages/webpacker/node_modules/argparse/package.json +0 -31
  72. data/packages/webpacker/node_modules/brace-expansion/README.md +0 -135
  73. data/packages/webpacker/node_modules/brace-expansion/index.js +0 -203
  74. data/packages/webpacker/node_modules/brace-expansion/package.json +0 -46
  75. data/packages/webpacker/node_modules/glob/LICENSE +0 -15
  76. data/packages/webpacker/node_modules/glob/README.md +0 -1214
  77. data/packages/webpacker/node_modules/glob/dist/cjs/package.json +0 -4
  78. data/packages/webpacker/node_modules/glob/dist/cjs/src/bin.d.ts +0 -3
  79. data/packages/webpacker/node_modules/glob/dist/cjs/src/bin.d.ts.map +0 -1
  80. data/packages/webpacker/node_modules/glob/dist/cjs/src/bin.js +0 -270
  81. data/packages/webpacker/node_modules/glob/dist/cjs/src/bin.js.map +0 -1
  82. data/packages/webpacker/node_modules/glob/dist/cjs/src/glob.d.ts +0 -344
  83. data/packages/webpacker/node_modules/glob/dist/cjs/src/glob.d.ts.map +0 -1
  84. data/packages/webpacker/node_modules/glob/dist/cjs/src/glob.js +0 -238
  85. data/packages/webpacker/node_modules/glob/dist/cjs/src/glob.js.map +0 -1
  86. data/packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.d.ts +0 -14
  87. data/packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.d.ts.map +0 -1
  88. data/packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.js +0 -27
  89. data/packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.js.map +0 -1
  90. data/packages/webpacker/node_modules/glob/dist/cjs/src/ignore.d.ts +0 -20
  91. data/packages/webpacker/node_modules/glob/dist/cjs/src/ignore.d.ts.map +0 -1
  92. data/packages/webpacker/node_modules/glob/dist/cjs/src/ignore.js +0 -103
  93. data/packages/webpacker/node_modules/glob/dist/cjs/src/ignore.js.map +0 -1
  94. data/packages/webpacker/node_modules/glob/dist/cjs/src/index.d.ts +0 -95
  95. data/packages/webpacker/node_modules/glob/dist/cjs/src/index.d.ts.map +0 -1
  96. data/packages/webpacker/node_modules/glob/dist/cjs/src/index.js +0 -68
  97. data/packages/webpacker/node_modules/glob/dist/cjs/src/index.js.map +0 -1
  98. data/packages/webpacker/node_modules/glob/dist/cjs/src/pattern.d.ts +0 -77
  99. data/packages/webpacker/node_modules/glob/dist/cjs/src/pattern.d.ts.map +0 -1
  100. data/packages/webpacker/node_modules/glob/dist/cjs/src/pattern.js +0 -219
  101. data/packages/webpacker/node_modules/glob/dist/cjs/src/pattern.js.map +0 -1
  102. data/packages/webpacker/node_modules/glob/dist/cjs/src/processor.d.ts +0 -59
  103. data/packages/webpacker/node_modules/glob/dist/cjs/src/processor.d.ts.map +0 -1
  104. data/packages/webpacker/node_modules/glob/dist/cjs/src/processor.js +0 -309
  105. data/packages/webpacker/node_modules/glob/dist/cjs/src/processor.js.map +0 -1
  106. data/packages/webpacker/node_modules/glob/dist/cjs/src/walker.d.ts +0 -96
  107. data/packages/webpacker/node_modules/glob/dist/cjs/src/walker.d.ts.map +0 -1
  108. data/packages/webpacker/node_modules/glob/dist/cjs/src/walker.js +0 -358
  109. data/packages/webpacker/node_modules/glob/dist/cjs/src/walker.js.map +0 -1
  110. data/packages/webpacker/node_modules/glob/dist/mjs/glob.d.ts +0 -344
  111. data/packages/webpacker/node_modules/glob/dist/mjs/glob.d.ts.map +0 -1
  112. data/packages/webpacker/node_modules/glob/dist/mjs/glob.js +0 -234
  113. data/packages/webpacker/node_modules/glob/dist/mjs/glob.js.map +0 -1
  114. data/packages/webpacker/node_modules/glob/dist/mjs/has-magic.d.ts +0 -14
  115. data/packages/webpacker/node_modules/glob/dist/mjs/has-magic.d.ts.map +0 -1
  116. data/packages/webpacker/node_modules/glob/dist/mjs/has-magic.js +0 -23
  117. data/packages/webpacker/node_modules/glob/dist/mjs/has-magic.js.map +0 -1
  118. data/packages/webpacker/node_modules/glob/dist/mjs/ignore.d.ts +0 -20
  119. data/packages/webpacker/node_modules/glob/dist/mjs/ignore.d.ts.map +0 -1
  120. data/packages/webpacker/node_modules/glob/dist/mjs/ignore.js +0 -99
  121. data/packages/webpacker/node_modules/glob/dist/mjs/ignore.js.map +0 -1
  122. data/packages/webpacker/node_modules/glob/dist/mjs/index.d.ts +0 -95
  123. data/packages/webpacker/node_modules/glob/dist/mjs/index.d.ts.map +0 -1
  124. data/packages/webpacker/node_modules/glob/dist/mjs/index.js +0 -56
  125. data/packages/webpacker/node_modules/glob/dist/mjs/index.js.map +0 -1
  126. data/packages/webpacker/node_modules/glob/dist/mjs/package.json +0 -4
  127. data/packages/webpacker/node_modules/glob/dist/mjs/pattern.d.ts +0 -77
  128. data/packages/webpacker/node_modules/glob/dist/mjs/pattern.d.ts.map +0 -1
  129. data/packages/webpacker/node_modules/glob/dist/mjs/pattern.js +0 -215
  130. data/packages/webpacker/node_modules/glob/dist/mjs/pattern.js.map +0 -1
  131. data/packages/webpacker/node_modules/glob/dist/mjs/processor.d.ts +0 -59
  132. data/packages/webpacker/node_modules/glob/dist/mjs/processor.d.ts.map +0 -1
  133. data/packages/webpacker/node_modules/glob/dist/mjs/processor.js +0 -302
  134. data/packages/webpacker/node_modules/glob/dist/mjs/processor.js.map +0 -1
  135. data/packages/webpacker/node_modules/glob/dist/mjs/walker.d.ts +0 -96
  136. data/packages/webpacker/node_modules/glob/dist/mjs/walker.d.ts.map +0 -1
  137. data/packages/webpacker/node_modules/glob/dist/mjs/walker.js +0 -352
  138. data/packages/webpacker/node_modules/glob/dist/mjs/walker.js.map +0 -1
  139. data/packages/webpacker/node_modules/glob/package.json +0 -98
  140. data/packages/webpacker/node_modules/js-yaml/CHANGELOG.md +0 -616
  141. data/packages/webpacker/node_modules/js-yaml/LICENSE +0 -21
  142. data/packages/webpacker/node_modules/js-yaml/README.md +0 -246
  143. data/packages/webpacker/node_modules/js-yaml/bin/js-yaml.js +0 -126
  144. data/packages/webpacker/node_modules/js-yaml/dist/js-yaml.js +0 -3874
  145. data/packages/webpacker/node_modules/js-yaml/dist/js-yaml.min.js +0 -2
  146. data/packages/webpacker/node_modules/js-yaml/dist/js-yaml.mjs +0 -3851
  147. data/packages/webpacker/node_modules/js-yaml/index.js +0 -47
  148. data/packages/webpacker/node_modules/js-yaml/lib/common.js +0 -59
  149. data/packages/webpacker/node_modules/js-yaml/lib/dumper.js +0 -965
  150. data/packages/webpacker/node_modules/js-yaml/lib/exception.js +0 -55
  151. data/packages/webpacker/node_modules/js-yaml/lib/loader.js +0 -1727
  152. data/packages/webpacker/node_modules/js-yaml/lib/schema/core.js +0 -11
  153. data/packages/webpacker/node_modules/js-yaml/lib/schema/default.js +0 -22
  154. data/packages/webpacker/node_modules/js-yaml/lib/schema/failsafe.js +0 -17
  155. data/packages/webpacker/node_modules/js-yaml/lib/schema/json.js +0 -19
  156. data/packages/webpacker/node_modules/js-yaml/lib/schema.js +0 -121
  157. data/packages/webpacker/node_modules/js-yaml/lib/snippet.js +0 -101
  158. data/packages/webpacker/node_modules/js-yaml/lib/type/binary.js +0 -125
  159. data/packages/webpacker/node_modules/js-yaml/lib/type/bool.js +0 -35
  160. data/packages/webpacker/node_modules/js-yaml/lib/type/float.js +0 -97
  161. data/packages/webpacker/node_modules/js-yaml/lib/type/int.js +0 -156
  162. data/packages/webpacker/node_modules/js-yaml/lib/type/map.js +0 -8
  163. data/packages/webpacker/node_modules/js-yaml/lib/type/merge.js +0 -12
  164. data/packages/webpacker/node_modules/js-yaml/lib/type/null.js +0 -35
  165. data/packages/webpacker/node_modules/js-yaml/lib/type/omap.js +0 -44
  166. data/packages/webpacker/node_modules/js-yaml/lib/type/pairs.js +0 -53
  167. data/packages/webpacker/node_modules/js-yaml/lib/type/seq.js +0 -8
  168. data/packages/webpacker/node_modules/js-yaml/lib/type/set.js +0 -29
  169. data/packages/webpacker/node_modules/js-yaml/lib/type/str.js +0 -8
  170. data/packages/webpacker/node_modules/js-yaml/lib/type/timestamp.js +0 -88
  171. data/packages/webpacker/node_modules/js-yaml/lib/type.js +0 -66
  172. data/packages/webpacker/node_modules/js-yaml/package.json +0 -66
  173. data/packages/webpacker/node_modules/minimatch/LICENSE +0 -15
  174. data/packages/webpacker/node_modules/minimatch/README.md +0 -454
  175. data/packages/webpacker/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts +0 -2
  176. data/packages/webpacker/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts.map +0 -1
  177. data/packages/webpacker/node_modules/minimatch/dist/cjs/assert-valid-pattern.js +0 -14
  178. data/packages/webpacker/node_modules/minimatch/dist/cjs/assert-valid-pattern.js.map +0 -1
  179. data/packages/webpacker/node_modules/minimatch/dist/cjs/ast.d.ts +0 -19
  180. data/packages/webpacker/node_modules/minimatch/dist/cjs/ast.d.ts.map +0 -1
  181. data/packages/webpacker/node_modules/minimatch/dist/cjs/ast.js +0 -589
  182. data/packages/webpacker/node_modules/minimatch/dist/cjs/ast.js.map +0 -1
  183. data/packages/webpacker/node_modules/minimatch/dist/cjs/brace-expressions.d.ts +0 -8
  184. data/packages/webpacker/node_modules/minimatch/dist/cjs/brace-expressions.d.ts.map +0 -1
  185. data/packages/webpacker/node_modules/minimatch/dist/cjs/brace-expressions.js +0 -152
  186. data/packages/webpacker/node_modules/minimatch/dist/cjs/brace-expressions.js.map +0 -1
  187. data/packages/webpacker/node_modules/minimatch/dist/cjs/escape.d.ts +0 -12
  188. data/packages/webpacker/node_modules/minimatch/dist/cjs/escape.d.ts.map +0 -1
  189. data/packages/webpacker/node_modules/minimatch/dist/cjs/escape.js +0 -22
  190. data/packages/webpacker/node_modules/minimatch/dist/cjs/escape.js.map +0 -1
  191. data/packages/webpacker/node_modules/minimatch/dist/cjs/index.d.ts +0 -94
  192. data/packages/webpacker/node_modules/minimatch/dist/cjs/index.d.ts.map +0 -1
  193. data/packages/webpacker/node_modules/minimatch/dist/cjs/index.js +0 -1011
  194. data/packages/webpacker/node_modules/minimatch/dist/cjs/index.js.map +0 -1
  195. data/packages/webpacker/node_modules/minimatch/dist/cjs/package.json +0 -3
  196. data/packages/webpacker/node_modules/minimatch/dist/cjs/unescape.d.ts +0 -17
  197. data/packages/webpacker/node_modules/minimatch/dist/cjs/unescape.d.ts.map +0 -1
  198. data/packages/webpacker/node_modules/minimatch/dist/cjs/unescape.js +0 -24
  199. data/packages/webpacker/node_modules/minimatch/dist/cjs/unescape.js.map +0 -1
  200. data/packages/webpacker/node_modules/minimatch/dist/mjs/assert-valid-pattern.d.ts +0 -2
  201. data/packages/webpacker/node_modules/minimatch/dist/mjs/assert-valid-pattern.d.ts.map +0 -1
  202. data/packages/webpacker/node_modules/minimatch/dist/mjs/assert-valid-pattern.js +0 -10
  203. data/packages/webpacker/node_modules/minimatch/dist/mjs/assert-valid-pattern.js.map +0 -1
  204. data/packages/webpacker/node_modules/minimatch/dist/mjs/ast.d.ts +0 -19
  205. data/packages/webpacker/node_modules/minimatch/dist/mjs/ast.d.ts.map +0 -1
  206. data/packages/webpacker/node_modules/minimatch/dist/mjs/ast.js +0 -585
  207. data/packages/webpacker/node_modules/minimatch/dist/mjs/ast.js.map +0 -1
  208. data/packages/webpacker/node_modules/minimatch/dist/mjs/brace-expressions.d.ts +0 -8
  209. data/packages/webpacker/node_modules/minimatch/dist/mjs/brace-expressions.d.ts.map +0 -1
  210. data/packages/webpacker/node_modules/minimatch/dist/mjs/brace-expressions.js +0 -148
  211. data/packages/webpacker/node_modules/minimatch/dist/mjs/brace-expressions.js.map +0 -1
  212. data/packages/webpacker/node_modules/minimatch/dist/mjs/escape.d.ts +0 -12
  213. data/packages/webpacker/node_modules/minimatch/dist/mjs/escape.d.ts.map +0 -1
  214. data/packages/webpacker/node_modules/minimatch/dist/mjs/escape.js +0 -18
  215. data/packages/webpacker/node_modules/minimatch/dist/mjs/escape.js.map +0 -1
  216. data/packages/webpacker/node_modules/minimatch/dist/mjs/index.d.ts +0 -94
  217. data/packages/webpacker/node_modules/minimatch/dist/mjs/index.d.ts.map +0 -1
  218. data/packages/webpacker/node_modules/minimatch/dist/mjs/index.js +0 -995
  219. data/packages/webpacker/node_modules/minimatch/dist/mjs/index.js.map +0 -1
  220. data/packages/webpacker/node_modules/minimatch/dist/mjs/package.json +0 -3
  221. data/packages/webpacker/node_modules/minimatch/dist/mjs/unescape.d.ts +0 -17
  222. data/packages/webpacker/node_modules/minimatch/dist/mjs/unescape.d.ts.map +0 -1
  223. data/packages/webpacker/node_modules/minimatch/dist/mjs/unescape.js +0 -20
  224. data/packages/webpacker/node_modules/minimatch/dist/mjs/unescape.js.map +0 -1
  225. data/packages/webpacker/node_modules/minimatch/package.json +0 -86
@@ -1,39 +0,0 @@
1
- # How to Contribute
2
-
3
- ## Pull Requests
4
-
5
- We also accept [pull requests][pull-request]!
6
-
7
- Generally we like to see pull requests that
8
-
9
- - Maintain the existing code style
10
- - Are focused on a single change (i.e. avoid large refactoring or style adjustments in untouched code if not the primary goal of the pull request)
11
- - Have [good commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
12
- - Have tests
13
- - Don't decrease the current code coverage (see coverage/lcov-report/index.html)
14
-
15
- ## Building
16
-
17
- ```
18
- npm install
19
- npm test
20
- ```
21
-
22
- The `npm test -- dev` implements watching for tests within Node and `karma start` may be used for manual testing in browsers.
23
-
24
- If you notice any problems, please report them to the GitHub issue tracker at
25
- [http://github.com/kpdecker/jsdiff/issues](http://github.com/kpdecker/jsdiff/issues).
26
-
27
- ## Releasing
28
-
29
- JsDiff utilizes the [release yeoman generator][generator-release] to perform most release tasks.
30
-
31
- A full release may be completed with the following:
32
-
33
- ```
34
- yo release
35
- npm publish
36
- ```
37
-
38
- [generator-release]: https://github.com/walmartlabs/generator-release
39
- [pull-request]: https://github.com/kpdecker/jsdiff/pull/new/master
@@ -1,31 +0,0 @@
1
- Software License Agreement (BSD License)
2
-
3
- Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com>
4
-
5
- All rights reserved.
6
-
7
- Redistribution and use of this software in source and binary forms, with or without modification,
8
- are permitted provided that the following conditions are met:
9
-
10
- * Redistributions of source code must retain the above
11
- copyright notice, this list of conditions and the
12
- following disclaimer.
13
-
14
- * Redistributions in binary form must reproduce the above
15
- copyright notice, this list of conditions and the
16
- following disclaimer in the documentation and/or other
17
- materials provided with the distribution.
18
-
19
- * Neither the name of Kevin Decker nor the names of its
20
- contributors may be used to endorse or promote products
21
- derived from this software without specific prior
22
- written permission.
23
-
24
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
25
- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
26
- FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
27
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
30
- IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31
- OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,211 +0,0 @@
1
- # jsdiff
2
-
3
- [![Build Status](https://secure.travis-ci.org/kpdecker/jsdiff.svg)](http://travis-ci.org/kpdecker/jsdiff)
4
- [![Sauce Test Status](https://saucelabs.com/buildstatus/jsdiff)](https://saucelabs.com/u/jsdiff)
5
-
6
- A javascript text differencing implementation.
7
-
8
- Based on the algorithm proposed in
9
- ["An O(ND) Difference Algorithm and its Variations" (Myers, 1986)](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927).
10
-
11
- ## Installation
12
- ```bash
13
- npm install diff --save
14
- ```
15
-
16
- ## API
17
-
18
- * `Diff.diffChars(oldStr, newStr[, options])` - diffs two blocks of text, comparing character by character.
19
-
20
- Returns a list of change objects (See below).
21
-
22
- Options
23
- * `ignoreCase`: `true` to ignore casing difference. Defaults to `false`.
24
-
25
- * `Diff.diffWords(oldStr, newStr[, options])` - diffs two blocks of text, comparing word by word, ignoring whitespace.
26
-
27
- Returns a list of change objects (See below).
28
-
29
- Options
30
- * `ignoreCase`: Same as in `diffChars`.
31
-
32
- * `Diff.diffWordsWithSpace(oldStr, newStr[, options])` - diffs two blocks of text, comparing word by word, treating whitespace as significant.
33
-
34
- Returns a list of change objects (See below).
35
-
36
- * `Diff.diffLines(oldStr, newStr[, options])` - diffs two blocks of text, comparing line by line.
37
-
38
- Options
39
- * `ignoreWhitespace`: `true` to ignore leading and trailing whitespace. This is the same as `diffTrimmedLines`
40
- * `newlineIsToken`: `true` to treat newline characters as separate tokens. This allows for changes to the newline structure to occur independently of the line content and to be treated as such. In general this is the more human friendly form of `diffLines` and `diffLines` is better suited for patches and other computer friendly output.
41
-
42
- Returns a list of change objects (See below).
43
-
44
- * `Diff.diffTrimmedLines(oldStr, newStr[, options])` - diffs two blocks of text, comparing line by line, ignoring leading and trailing whitespace.
45
-
46
- Returns a list of change objects (See below).
47
-
48
- * `Diff.diffSentences(oldStr, newStr[, options])` - diffs two blocks of text, comparing sentence by sentence.
49
-
50
- Returns a list of change objects (See below).
51
-
52
- * `Diff.diffCss(oldStr, newStr[, options])` - diffs two blocks of text, comparing CSS tokens.
53
-
54
- Returns a list of change objects (See below).
55
-
56
- * `Diff.diffJson(oldObj, newObj[, options])` - diffs two JSON objects, comparing the fields defined on each. The order of fields, etc does not matter in this comparison.
57
-
58
- Returns a list of change objects (See below).
59
-
60
- * `Diff.diffArrays(oldArr, newArr[, options])` - diffs two arrays, comparing each item for strict equality (===).
61
-
62
- Options
63
- * `comparator`: `function(left, right)` for custom equality checks
64
-
65
- Returns a list of change objects (See below).
66
-
67
- * `Diff.createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader)` - creates a unified diff patch.
68
-
69
- Parameters:
70
- * `oldFileName` : String to be output in the filename section of the patch for the removals
71
- * `newFileName` : String to be output in the filename section of the patch for the additions
72
- * `oldStr` : Original string value
73
- * `newStr` : New string value
74
- * `oldHeader` : Additional information to include in the old file header
75
- * `newHeader` : Additional information to include in the new file header
76
- * `options` : An object with options.
77
- - `context` describes how many lines of context should be included.
78
- - `ignoreWhitespace`: `true` to ignore leading and trailing whitespace.
79
- - `newlineIsToken`: `true` to treat newline characters as separate tokens. This allows for changes to the newline structure to occur independently of the line content and to be treated as such. In general this is the more human friendly form of `diffLines` and `diffLines` is better suited for patches and other computer friendly output.
80
-
81
- * `Diff.createPatch(fileName, oldStr, newStr, oldHeader, newHeader)` - creates a unified diff patch.
82
-
83
- Just like Diff.createTwoFilesPatch, but with oldFileName being equal to newFileName.
84
-
85
-
86
- * `Diff.structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options)` - returns an object with an array of hunk objects.
87
-
88
- This method is similar to createTwoFilesPatch, but returns a data structure
89
- suitable for further processing. Parameters are the same as createTwoFilesPatch. The data structure returned may look like this:
90
-
91
- ```js
92
- {
93
- oldFileName: 'oldfile', newFileName: 'newfile',
94
- oldHeader: 'header1', newHeader: 'header2',
95
- hunks: [{
96
- oldStart: 1, oldLines: 3, newStart: 1, newLines: 3,
97
- lines: [' line2', ' line3', '-line4', '+line5', '\'],
98
- }]
99
- }
100
- ```
101
-
102
- * `Diff.applyPatch(source, patch[, options])` - applies a unified diff patch.
103
-
104
- Return a string containing new version of provided data. `patch` may be a string diff or the output from the `parsePatch` or `structuredPatch` methods.
105
-
106
- The optional `options` object may have the following keys:
107
-
108
- - `fuzzFactor`: Number of lines that are allowed to differ before rejecting a patch. Defaults to 0.
109
- - `compareLine(lineNumber, line, operation, patchContent)`: Callback used to compare to given lines to determine if they should be considered equal when patching. Defaults to strict equality but may be overridden to provide fuzzier comparison. Should return false if the lines should be rejected.
110
-
111
- * `Diff.applyPatches(patch, options)` - applies one or more patches.
112
-
113
- This method will iterate over the contents of the patch and apply to data provided through callbacks. The general flow for each patch index is:
114
-
115
- - `options.loadFile(index, callback)` is called. The caller should then load the contents of the file and then pass that to the `callback(err, data)` callback. Passing an `err` will terminate further patch execution.
116
- - `options.patched(index, content, callback)` is called once the patch has been applied. `content` will be the return value from `applyPatch`. When it's ready, the caller should call `callback(err)` callback. Passing an `err` will terminate further patch execution.
117
-
118
- Once all patches have been applied or an error occurs, the `options.complete(err)` callback is made.
119
-
120
- * `Diff.parsePatch(diffStr)` - Parses a patch into structured data
121
-
122
- Return a JSON object representation of the a patch, suitable for use with the `applyPatch` method. This parses to the same structure returned by `Diff.structuredPatch`.
123
-
124
- * `convertChangesToXML(changes)` - converts a list of changes to a serialized XML format
125
-
126
-
127
- All methods above which accept the optional `callback` method will run in sync mode when that parameter is omitted and in async mode when supplied. This allows for larger diffs without blocking the event loop. This may be passed either directly as the final parameter or as the `callback` field in the `options` object.
128
-
129
- ### Change Objects
130
- Many of the methods above return change objects. These objects consist of the following fields:
131
-
132
- * `value`: Text content
133
- * `added`: True if the value was inserted into the new string
134
- * `removed`: True if the value was removed from the old string
135
-
136
- Note that some cases may omit a particular flag field. Comparison on the flag fields should always be done in a truthy or falsy manner.
137
-
138
- ## Examples
139
-
140
- Basic example in Node
141
-
142
- ```js
143
- require('colors');
144
- const Diff = require('diff');
145
-
146
- const one = 'beep boop';
147
- const other = 'beep boob blah';
148
-
149
- const diff = Diff.diffChars(one, other);
150
-
151
- diff.forEach((part) => {
152
- // green for additions, red for deletions
153
- // grey for common parts
154
- const color = part.added ? 'green' :
155
- part.removed ? 'red' : 'grey';
156
- process.stderr.write(part.value[color]);
157
- });
158
-
159
- console.log();
160
- ```
161
- Running the above program should yield
162
-
163
- <img src="images/node_example.png" alt="Node Example">
164
-
165
- Basic example in a web page
166
-
167
- ```html
168
- <pre id="display"></pre>
169
- <script src="diff.js"></script>
170
- <script>
171
- const one = 'beep boop',
172
- other = 'beep boob blah',
173
- color = '';
174
-
175
- let span = null;
176
-
177
- const diff = Diff.diffChars(one, other),
178
- display = document.getElementById('display'),
179
- fragment = document.createDocumentFragment();
180
-
181
- diff.forEach((part) => {
182
- // green for additions, red for deletions
183
- // grey for common parts
184
- const color = part.added ? 'green' :
185
- part.removed ? 'red' : 'grey';
186
- span = document.createElement('span');
187
- span.style.color = color;
188
- span.appendChild(document
189
- .createTextNode(part.value));
190
- fragment.appendChild(span);
191
- });
192
-
193
- display.appendChild(fragment);
194
- </script>
195
- ```
196
-
197
- Open the above .html file in a browser and you should see
198
-
199
- <img src="images/web_example.png" alt="Node Example">
200
-
201
- **[Full online demo](https://kpdecker.github.io/jsdiff)**
202
-
203
- ## Compatibility
204
-
205
- [![Sauce Test Status](https://saucelabs.com/browser-matrix/jsdiff.svg)](https://saucelabs.com/u/jsdiff)
206
-
207
- jsdiff supports all ES3 environments with some known issues on IE8 and below. Under these browsers some diff algorithms such as word diff and others may fail due to lack of support for capturing groups in the `split` operation.
208
-
209
- ## License
210
-
211
- See [LICENSE](https://github.com/kpdecker/jsdiff/blob/master/LICENSE).