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,67 +0,0 @@
1
- // Limited implementation of python % string operator, supports only %s and %r for now
2
- // (other formats are not used here, but may appear in custom templates)
3
-
4
- 'use strict'
5
-
6
- const { inspect } = require('util')
7
-
8
-
9
- module.exports = function sub(pattern, ...values) {
10
- let regex = /%(?:(%)|(-)?(\*)?(?:\((\w+)\))?([A-Za-z]))/g
11
-
12
- let result = pattern.replace(regex, function (_, is_literal, is_left_align, is_padded, name, format) {
13
- if (is_literal) return '%'
14
-
15
- let padded_count = 0
16
- if (is_padded) {
17
- if (values.length === 0) throw new TypeError('not enough arguments for format string')
18
- padded_count = values.shift()
19
- if (!Number.isInteger(padded_count)) throw new TypeError('* wants int')
20
- }
21
-
22
- let str
23
- if (name !== undefined) {
24
- let dict = values[0]
25
- if (typeof dict !== 'object' || dict === null) throw new TypeError('format requires a mapping')
26
- if (!(name in dict)) throw new TypeError(`no such key: '${name}'`)
27
- str = dict[name]
28
- } else {
29
- if (values.length === 0) throw new TypeError('not enough arguments for format string')
30
- str = values.shift()
31
- }
32
-
33
- switch (format) {
34
- case 's':
35
- str = String(str)
36
- break
37
- case 'r':
38
- str = inspect(str)
39
- break
40
- case 'd':
41
- case 'i':
42
- if (typeof str !== 'number') {
43
- throw new TypeError(`%${format} format: a number is required, not ${typeof str}`)
44
- }
45
- str = String(str.toFixed(0))
46
- break
47
- default:
48
- throw new TypeError(`unsupported format character '${format}'`)
49
- }
50
-
51
- if (padded_count > 0) {
52
- return is_left_align ? str.padEnd(padded_count) : str.padStart(padded_count)
53
- } else {
54
- return str
55
- }
56
- })
57
-
58
- if (values.length) {
59
- if (values.length === 1 && typeof values[0] === 'object' && values[0] !== null) {
60
- // mapping
61
- } else {
62
- throw new TypeError('not all arguments converted during string formatting')
63
- }
64
- }
65
-
66
- return result
67
- }
@@ -1,440 +0,0 @@
1
- // Partial port of python's argparse module, version 3.9.0 (only wrap and fill functions):
2
- // https://github.com/python/cpython/blob/v3.9.0b4/Lib/textwrap.py
3
-
4
- 'use strict'
5
-
6
- /*
7
- * Text wrapping and filling.
8
- */
9
-
10
- // Copyright (C) 1999-2001 Gregory P. Ward.
11
- // Copyright (C) 2002, 2003 Python Software Foundation.
12
- // Copyright (C) 2020 argparse.js authors
13
- // Originally written by Greg Ward <gward@python.net>
14
-
15
- // Hardcode the recognized whitespace characters to the US-ASCII
16
- // whitespace characters. The main reason for doing this is that
17
- // some Unicode spaces (like \u00a0) are non-breaking whitespaces.
18
- //
19
- // This less funky little regex just split on recognized spaces. E.g.
20
- // "Hello there -- you goof-ball, use the -b option!"
21
- // splits into
22
- // Hello/ /there/ /--/ /you/ /goof-ball,/ /use/ /the/ /-b/ /option!/
23
- const wordsep_simple_re = /([\t\n\x0b\x0c\r ]+)/
24
-
25
- class TextWrapper {
26
- /*
27
- * Object for wrapping/filling text. The public interface consists of
28
- * the wrap() and fill() methods; the other methods are just there for
29
- * subclasses to override in order to tweak the default behaviour.
30
- * If you want to completely replace the main wrapping algorithm,
31
- * you'll probably have to override _wrap_chunks().
32
- *
33
- * Several instance attributes control various aspects of wrapping:
34
- * width (default: 70)
35
- * the maximum width of wrapped lines (unless break_long_words
36
- * is false)
37
- * initial_indent (default: "")
38
- * string that will be prepended to the first line of wrapped
39
- * output. Counts towards the line's width.
40
- * subsequent_indent (default: "")
41
- * string that will be prepended to all lines save the first
42
- * of wrapped output; also counts towards each line's width.
43
- * expand_tabs (default: true)
44
- * Expand tabs in input text to spaces before further processing.
45
- * Each tab will become 0 .. 'tabsize' spaces, depending on its position
46
- * in its line. If false, each tab is treated as a single character.
47
- * tabsize (default: 8)
48
- * Expand tabs in input text to 0 .. 'tabsize' spaces, unless
49
- * 'expand_tabs' is false.
50
- * replace_whitespace (default: true)
51
- * Replace all whitespace characters in the input text by spaces
52
- * after tab expansion. Note that if expand_tabs is false and
53
- * replace_whitespace is true, every tab will be converted to a
54
- * single space!
55
- * fix_sentence_endings (default: false)
56
- * Ensure that sentence-ending punctuation is always followed
57
- * by two spaces. Off by default because the algorithm is
58
- * (unavoidably) imperfect.
59
- * break_long_words (default: true)
60
- * Break words longer than 'width'. If false, those words will not
61
- * be broken, and some lines might be longer than 'width'.
62
- * break_on_hyphens (default: true)
63
- * Allow breaking hyphenated words. If true, wrapping will occur
64
- * preferably on whitespaces and right after hyphens part of
65
- * compound words.
66
- * drop_whitespace (default: true)
67
- * Drop leading and trailing whitespace from lines.
68
- * max_lines (default: None)
69
- * Truncate wrapped lines.
70
- * placeholder (default: ' [...]')
71
- * Append to the last line of truncated text.
72
- */
73
-
74
- constructor(options = {}) {
75
- let {
76
- width = 70,
77
- initial_indent = '',
78
- subsequent_indent = '',
79
- expand_tabs = true,
80
- replace_whitespace = true,
81
- fix_sentence_endings = false,
82
- break_long_words = true,
83
- drop_whitespace = true,
84
- break_on_hyphens = true,
85
- tabsize = 8,
86
- max_lines = undefined,
87
- placeholder=' [...]'
88
- } = options
89
-
90
- this.width = width
91
- this.initial_indent = initial_indent
92
- this.subsequent_indent = subsequent_indent
93
- this.expand_tabs = expand_tabs
94
- this.replace_whitespace = replace_whitespace
95
- this.fix_sentence_endings = fix_sentence_endings
96
- this.break_long_words = break_long_words
97
- this.drop_whitespace = drop_whitespace
98
- this.break_on_hyphens = break_on_hyphens
99
- this.tabsize = tabsize
100
- this.max_lines = max_lines
101
- this.placeholder = placeholder
102
- }
103
-
104
-
105
- // -- Private methods -----------------------------------------------
106
- // (possibly useful for subclasses to override)
107
-
108
- _munge_whitespace(text) {
109
- /*
110
- * _munge_whitespace(text : string) -> string
111
- *
112
- * Munge whitespace in text: expand tabs and convert all other
113
- * whitespace characters to spaces. Eg. " foo\\tbar\\n\\nbaz"
114
- * becomes " foo bar baz".
115
- */
116
- if (this.expand_tabs) {
117
- text = text.replace(/\t/g, ' '.repeat(this.tabsize)) // not strictly correct in js
118
- }
119
- if (this.replace_whitespace) {
120
- text = text.replace(/[\t\n\x0b\x0c\r]/g, ' ')
121
- }
122
- return text
123
- }
124
-
125
- _split(text) {
126
- /*
127
- * _split(text : string) -> [string]
128
- *
129
- * Split the text to wrap into indivisible chunks. Chunks are
130
- * not quite the same as words; see _wrap_chunks() for full
131
- * details. As an example, the text
132
- * Look, goof-ball -- use the -b option!
133
- * breaks into the following chunks:
134
- * 'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ',
135
- * 'use', ' ', 'the', ' ', '-b', ' ', 'option!'
136
- * if break_on_hyphens is True, or in:
137
- * 'Look,', ' ', 'goof-ball', ' ', '--', ' ',
138
- * 'use', ' ', 'the', ' ', '-b', ' ', option!'
139
- * otherwise.
140
- */
141
- let chunks = text.split(wordsep_simple_re)
142
- chunks = chunks.filter(Boolean)
143
- return chunks
144
- }
145
-
146
- _handle_long_word(reversed_chunks, cur_line, cur_len, width) {
147
- /*
148
- * _handle_long_word(chunks : [string],
149
- * cur_line : [string],
150
- * cur_len : int, width : int)
151
- *
152
- * Handle a chunk of text (most likely a word, not whitespace) that
153
- * is too long to fit in any line.
154
- */
155
- // Figure out when indent is larger than the specified width, and make
156
- // sure at least one character is stripped off on every pass
157
- let space_left
158
- if (width < 1) {
159
- space_left = 1
160
- } else {
161
- space_left = width - cur_len
162
- }
163
-
164
- // If we're allowed to break long words, then do so: put as much
165
- // of the next chunk onto the current line as will fit.
166
- if (this.break_long_words) {
167
- cur_line.push(reversed_chunks[reversed_chunks.length - 1].slice(0, space_left))
168
- reversed_chunks[reversed_chunks.length - 1] = reversed_chunks[reversed_chunks.length - 1].slice(space_left)
169
-
170
- // Otherwise, we have to preserve the long word intact. Only add
171
- // it to the current line if there's nothing already there --
172
- // that minimizes how much we violate the width constraint.
173
- } else if (!cur_line) {
174
- cur_line.push(...reversed_chunks.pop())
175
- }
176
-
177
- // If we're not allowed to break long words, and there's already
178
- // text on the current line, do nothing. Next time through the
179
- // main loop of _wrap_chunks(), we'll wind up here again, but
180
- // cur_len will be zero, so the next line will be entirely
181
- // devoted to the long word that we can't handle right now.
182
- }
183
-
184
- _wrap_chunks(chunks) {
185
- /*
186
- * _wrap_chunks(chunks : [string]) -> [string]
187
- *
188
- * Wrap a sequence of text chunks and return a list of lines of
189
- * length 'self.width' or less. (If 'break_long_words' is false,
190
- * some lines may be longer than this.) Chunks correspond roughly
191
- * to words and the whitespace between them: each chunk is
192
- * indivisible (modulo 'break_long_words'), but a line break can
193
- * come between any two chunks. Chunks should not have internal
194
- * whitespace; ie. a chunk is either all whitespace or a "word".
195
- * Whitespace chunks will be removed from the beginning and end of
196
- * lines, but apart from that whitespace is preserved.
197
- */
198
- let lines = []
199
- let indent
200
- if (this.width <= 0) {
201
- throw Error(`invalid width ${this.width} (must be > 0)`)
202
- }
203
- if (this.max_lines !== undefined) {
204
- if (this.max_lines > 1) {
205
- indent = this.subsequent_indent
206
- } else {
207
- indent = this.initial_indent
208
- }
209
- if (indent.length + this.placeholder.trimStart().length > this.width) {
210
- throw Error('placeholder too large for max width')
211
- }
212
- }
213
-
214
- // Arrange in reverse order so items can be efficiently popped
215
- // from a stack of chucks.
216
- chunks = chunks.reverse()
217
-
218
- while (chunks.length > 0) {
219
-
220
- // Start the list of chunks that will make up the current line.
221
- // cur_len is just the length of all the chunks in cur_line.
222
- let cur_line = []
223
- let cur_len = 0
224
-
225
- // Figure out which static string will prefix this line.
226
- let indent
227
- if (lines) {
228
- indent = this.subsequent_indent
229
- } else {
230
- indent = this.initial_indent
231
- }
232
-
233
- // Maximum width for this line.
234
- let width = this.width - indent.length
235
-
236
- // First chunk on line is whitespace -- drop it, unless this
237
- // is the very beginning of the text (ie. no lines started yet).
238
- if (this.drop_whitespace && chunks[chunks.length - 1].trim() === '' && lines.length > 0) {
239
- chunks.pop()
240
- }
241
-
242
- while (chunks.length > 0) {
243
- let l = chunks[chunks.length - 1].length
244
-
245
- // Can at least squeeze this chunk onto the current line.
246
- if (cur_len + l <= width) {
247
- cur_line.push(chunks.pop())
248
- cur_len += l
249
-
250
- // Nope, this line is full.
251
- } else {
252
- break
253
- }
254
- }
255
-
256
- // The current line is full, and the next chunk is too big to
257
- // fit on *any* line (not just this one).
258
- if (chunks.length && chunks[chunks.length - 1].length > width) {
259
- this._handle_long_word(chunks, cur_line, cur_len, width)
260
- cur_len = cur_line.map(l => l.length).reduce((a, b) => a + b, 0)
261
- }
262
-
263
- // If the last chunk on this line is all whitespace, drop it.
264
- if (this.drop_whitespace && cur_line.length > 0 && cur_line[cur_line.length - 1].trim() === '') {
265
- cur_len -= cur_line[cur_line.length - 1].length
266
- cur_line.pop()
267
- }
268
-
269
- if (cur_line) {
270
- if (this.max_lines === undefined ||
271
- lines.length + 1 < this.max_lines ||
272
- (chunks.length === 0 ||
273
- this.drop_whitespace &&
274
- chunks.length === 1 &&
275
- !chunks[0].trim()) && cur_len <= width) {
276
- // Convert current line back to a string and store it in
277
- // list of all lines (return value).
278
- lines.push(indent + cur_line.join(''))
279
- } else {
280
- let had_break = false
281
- while (cur_line) {
282
- if (cur_line[cur_line.length - 1].trim() &&
283
- cur_len + this.placeholder.length <= width) {
284
- cur_line.push(this.placeholder)
285
- lines.push(indent + cur_line.join(''))
286
- had_break = true
287
- break
288
- }
289
- cur_len -= cur_line[-1].length
290
- cur_line.pop()
291
- }
292
- if (!had_break) {
293
- if (lines) {
294
- let prev_line = lines[lines.length - 1].trimEnd()
295
- if (prev_line.length + this.placeholder.length <=
296
- this.width) {
297
- lines[lines.length - 1] = prev_line + this.placeholder
298
- break
299
- }
300
- }
301
- lines.push(indent + this.placeholder.lstrip())
302
- }
303
- break
304
- }
305
- }
306
- }
307
-
308
- return lines
309
- }
310
-
311
- _split_chunks(text) {
312
- text = this._munge_whitespace(text)
313
- return this._split(text)
314
- }
315
-
316
- // -- Public interface ----------------------------------------------
317
-
318
- wrap(text) {
319
- /*
320
- * wrap(text : string) -> [string]
321
- *
322
- * Reformat the single paragraph in 'text' so it fits in lines of
323
- * no more than 'self.width' columns, and return a list of wrapped
324
- * lines. Tabs in 'text' are expanded with string.expandtabs(),
325
- * and all other whitespace characters (including newline) are
326
- * converted to space.
327
- */
328
- let chunks = this._split_chunks(text)
329
- // not implemented in js
330
- //if (this.fix_sentence_endings) {
331
- // this._fix_sentence_endings(chunks)
332
- //}
333
- return this._wrap_chunks(chunks)
334
- }
335
-
336
- fill(text) {
337
- /*
338
- * fill(text : string) -> string
339
- *
340
- * Reformat the single paragraph in 'text' to fit in lines of no
341
- * more than 'self.width' columns, and return a new string
342
- * containing the entire wrapped paragraph.
343
- */
344
- return this.wrap(text).join('\n')
345
- }
346
- }
347
-
348
-
349
- // -- Convenience interface ---------------------------------------------
350
-
351
- function wrap(text, options = {}) {
352
- /*
353
- * Wrap a single paragraph of text, returning a list of wrapped lines.
354
- *
355
- * Reformat the single paragraph in 'text' so it fits in lines of no
356
- * more than 'width' columns, and return a list of wrapped lines. By
357
- * default, tabs in 'text' are expanded with string.expandtabs(), and
358
- * all other whitespace characters (including newline) are converted to
359
- * space. See TextWrapper class for available keyword args to customize
360
- * wrapping behaviour.
361
- */
362
- let { width = 70, ...kwargs } = options
363
- let w = new TextWrapper(Object.assign({ width }, kwargs))
364
- return w.wrap(text)
365
- }
366
-
367
- function fill(text, options = {}) {
368
- /*
369
- * Fill a single paragraph of text, returning a new string.
370
- *
371
- * Reformat the single paragraph in 'text' to fit in lines of no more
372
- * than 'width' columns, and return a new string containing the entire
373
- * wrapped paragraph. As with wrap(), tabs are expanded and other
374
- * whitespace characters converted to space. See TextWrapper class for
375
- * available keyword args to customize wrapping behaviour.
376
- */
377
- let { width = 70, ...kwargs } = options
378
- let w = new TextWrapper(Object.assign({ width }, kwargs))
379
- return w.fill(text)
380
- }
381
-
382
- // -- Loosely related functionality -------------------------------------
383
-
384
- let _whitespace_only_re = /^[ \t]+$/mg
385
- let _leading_whitespace_re = /(^[ \t]*)(?:[^ \t\n])/mg
386
-
387
- function dedent(text) {
388
- /*
389
- * Remove any common leading whitespace from every line in `text`.
390
- *
391
- * This can be used to make triple-quoted strings line up with the left
392
- * edge of the display, while still presenting them in the source code
393
- * in indented form.
394
- *
395
- * Note that tabs and spaces are both treated as whitespace, but they
396
- * are not equal: the lines " hello" and "\\thello" are
397
- * considered to have no common leading whitespace.
398
- *
399
- * Entirely blank lines are normalized to a newline character.
400
- */
401
- // Look for the longest leading string of spaces and tabs common to
402
- // all lines.
403
- let margin = undefined
404
- text = text.replace(_whitespace_only_re, '')
405
- let indents = text.match(_leading_whitespace_re) || []
406
- for (let indent of indents) {
407
- indent = indent.slice(0, -1)
408
-
409
- if (margin === undefined) {
410
- margin = indent
411
-
412
- // Current line more deeply indented than previous winner:
413
- // no change (previous winner is still on top).
414
- } else if (indent.startsWith(margin)) {
415
- // pass
416
-
417
- // Current line consistent with and no deeper than previous winner:
418
- // it's the new winner.
419
- } else if (margin.startsWith(indent)) {
420
- margin = indent
421
-
422
- // Find the largest common whitespace between current line and previous
423
- // winner.
424
- } else {
425
- for (let i = 0; i < margin.length && i < indent.length; i++) {
426
- if (margin[i] !== indent[i]) {
427
- margin = margin.slice(0, i)
428
- break
429
- }
430
- }
431
- }
432
- }
433
-
434
- if (margin) {
435
- text = text.replace(new RegExp('^' + margin, 'mg'), '')
436
- }
437
- return text
438
- }
439
-
440
- module.exports = { wrap, fill, dedent }
@@ -1,31 +0,0 @@
1
- {
2
- "name": "argparse",
3
- "description": "CLI arguments parser. Native port of python's argparse.",
4
- "version": "2.0.1",
5
- "keywords": [
6
- "cli",
7
- "parser",
8
- "argparse",
9
- "option",
10
- "args"
11
- ],
12
- "main": "argparse.js",
13
- "files": [
14
- "argparse.js",
15
- "lib/"
16
- ],
17
- "license": "Python-2.0",
18
- "repository": "nodeca/argparse",
19
- "scripts": {
20
- "lint": "eslint .",
21
- "test": "npm run lint && nyc mocha",
22
- "coverage": "npm run test && nyc report --reporter html"
23
- },
24
- "devDependencies": {
25
- "@babel/eslint-parser": "^7.11.0",
26
- "@babel/plugin-syntax-class-properties": "^7.10.4",
27
- "eslint": "^7.5.0",
28
- "mocha": "^8.0.1",
29
- "nyc": "^15.1.0"
30
- }
31
- }
@@ -1,135 +0,0 @@
1
- # brace-expansion
2
-
3
- [Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html),
4
- as known from sh/bash, in JavaScript.
5
-
6
- [![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion)
7
- [![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion)
8
- [![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/)
9
-
10
- [![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion)
11
-
12
- ## Example
13
-
14
- ```js
15
- var expand = require('brace-expansion');
16
-
17
- expand('file-{a,b,c}.jpg')
18
- // => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
19
-
20
- expand('-v{,,}')
21
- // => ['-v', '-v', '-v']
22
-
23
- expand('file{0..2}.jpg')
24
- // => ['file0.jpg', 'file1.jpg', 'file2.jpg']
25
-
26
- expand('file-{a..c}.jpg')
27
- // => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
28
-
29
- expand('file{2..0}.jpg')
30
- // => ['file2.jpg', 'file1.jpg', 'file0.jpg']
31
-
32
- expand('file{0..4..2}.jpg')
33
- // => ['file0.jpg', 'file2.jpg', 'file4.jpg']
34
-
35
- expand('file-{a..e..2}.jpg')
36
- // => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']
37
-
38
- expand('file{00..10..5}.jpg')
39
- // => ['file00.jpg', 'file05.jpg', 'file10.jpg']
40
-
41
- expand('{{A..C},{a..c}}')
42
- // => ['A', 'B', 'C', 'a', 'b', 'c']
43
-
44
- expand('ppp{,config,oe{,conf}}')
45
- // => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']
46
- ```
47
-
48
- ## API
49
-
50
- ```js
51
- var expand = require('brace-expansion');
52
- ```
53
-
54
- ### var expanded = expand(str)
55
-
56
- Return an array of all possible and valid expansions of `str`. If none are
57
- found, `[str]` is returned.
58
-
59
- Valid expansions are:
60
-
61
- ```js
62
- /^(.*,)+(.+)?$/
63
- // {a,b,...}
64
- ```
65
-
66
- A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.
67
-
68
- ```js
69
- /^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
70
- // {x..y[..incr]}
71
- ```
72
-
73
- A numeric sequence from `x` to `y` inclusive, with optional increment.
74
- If `x` or `y` start with a leading `0`, all the numbers will be padded
75
- to have equal length. Negative numbers and backwards iteration work too.
76
-
77
- ```js
78
- /^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
79
- // {x..y[..incr]}
80
- ```
81
-
82
- An alphabetic sequence from `x` to `y` inclusive, with optional increment.
83
- `x` and `y` must be exactly one character, and if given, `incr` must be a
84
- number.
85
-
86
- For compatibility reasons, the string `${` is not eligible for brace expansion.
87
-
88
- ## Installation
89
-
90
- With [npm](https://npmjs.org) do:
91
-
92
- ```bash
93
- npm install brace-expansion
94
- ```
95
-
96
- ## Contributors
97
-
98
- - [Julian Gruber](https://github.com/juliangruber)
99
- - [Isaac Z. Schlueter](https://github.com/isaacs)
100
-
101
- ## Sponsors
102
-
103
- This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)!
104
-
105
- Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)!
106
-
107
- ## Security contact information
108
-
109
- To report a security vulnerability, please use the
110
- [Tidelift security contact](https://tidelift.com/security).
111
- Tidelift will coordinate the fix and disclosure.
112
-
113
- ## License
114
-
115
- (MIT)
116
-
117
- Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
118
-
119
- Permission is hereby granted, free of charge, to any person obtaining a copy of
120
- this software and associated documentation files (the "Software"), to deal in
121
- the Software without restriction, including without limitation the rights to
122
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
123
- of the Software, and to permit persons to whom the Software is furnished to do
124
- so, subject to the following conditions:
125
-
126
- The above copyright notice and this permission notice shall be included in all
127
- copies or substantial portions of the Software.
128
-
129
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
130
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
131
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
132
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
133
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
134
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
135
- SOFTWARE.