decidim 0.27.4 → 0.27.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Rakefile +7 -16
- data/decidim-core/lib/decidim/webpacker/webpack/.modernizrrc +9 -0
- data/decidim.gemspec +65 -0
- data/docs/modules/develop/pages/releases.adoc +4 -0
- data/docs/modules/install/assets/attachments/.gitkeep +0 -0
- data/docs/modules/install/assets/images/.gitkeep +0 -0
- data/docs/modules/install/pages/manual.adoc +5 -1
- data/docs/modules/install/pages/update.adoc +5 -0
- data/docs/modules/install/partials/version_matrix.adoc +13 -0
- data/docs/modules/services/pages/maps.adoc +8 -0
- data/lib/decidim/gem_manager.rb +38 -0
- data/lib/decidim/version.rb +1 -1
- data/package-lock.json +32 -26
- data/packages/browserslist-config/package.json +1 -1
- data/packages/core/package.json +4 -4
- data/packages/dev/package.json +1 -1
- data/packages/elections/package.json +1 -1
- data/packages/eslint-config/package.json +1 -1
- data/packages/stylelint-config/package.json +1 -1
- data/packages/webpacker/package.json +1 -1
- metadata +52 -239
- data/lib/decidim/release_manager.rb.new +0 -43
- data/packages/core/node_modules/diff/CONTRIBUTING.md +0 -39
- data/packages/core/node_modules/diff/LICENSE +0 -31
- data/packages/core/node_modules/diff/README.md +0 -211
- data/packages/core/node_modules/diff/dist/diff.js +0 -1627
- data/packages/core/node_modules/diff/dist/diff.min.js +0 -38
- data/packages/core/node_modules/diff/lib/convert/dmp.js +0 -32
- data/packages/core/node_modules/diff/lib/convert/xml.js +0 -42
- data/packages/core/node_modules/diff/lib/diff/array.js +0 -45
- data/packages/core/node_modules/diff/lib/diff/base.js +0 -307
- data/packages/core/node_modules/diff/lib/diff/character.js +0 -37
- data/packages/core/node_modules/diff/lib/diff/css.js +0 -41
- data/packages/core/node_modules/diff/lib/diff/json.js +0 -163
- data/packages/core/node_modules/diff/lib/diff/line.js +0 -89
- data/packages/core/node_modules/diff/lib/diff/sentence.js +0 -41
- data/packages/core/node_modules/diff/lib/diff/word.js +0 -108
- data/packages/core/node_modules/diff/lib/index.es6.js +0 -1561
- data/packages/core/node_modules/diff/lib/index.js +0 -216
- data/packages/core/node_modules/diff/lib/index.mjs +0 -1561
- data/packages/core/node_modules/diff/lib/patch/apply.js +0 -238
- data/packages/core/node_modules/diff/lib/patch/create.js +0 -272
- data/packages/core/node_modules/diff/lib/patch/merge.js +0 -613
- data/packages/core/node_modules/diff/lib/patch/parse.js +0 -167
- data/packages/core/node_modules/diff/lib/util/array.js +0 -32
- data/packages/core/node_modules/diff/lib/util/distance-iterator.js +0 -57
- data/packages/core/node_modules/diff/lib/util/params.js +0 -24
- data/packages/core/node_modules/diff/package.json +0 -87
- data/packages/core/node_modules/diff/release-notes.md +0 -309
- data/packages/core/node_modules/diff/runtime.js +0 -3
- data/packages/core/package-lock.json +0 -4889
- data/packages/webpacker/node_modules/argparse/CHANGELOG.md +0 -216
- data/packages/webpacker/node_modules/argparse/LICENSE +0 -254
- data/packages/webpacker/node_modules/argparse/README.md +0 -84
- data/packages/webpacker/node_modules/argparse/argparse.js +0 -3707
- data/packages/webpacker/node_modules/argparse/lib/sub.js +0 -67
- data/packages/webpacker/node_modules/argparse/lib/textwrap.js +0 -440
- data/packages/webpacker/node_modules/argparse/package.json +0 -31
- data/packages/webpacker/node_modules/brace-expansion/LICENSE +0 -21
- data/packages/webpacker/node_modules/brace-expansion/README.md +0 -135
- data/packages/webpacker/node_modules/brace-expansion/index.js +0 -203
- data/packages/webpacker/node_modules/brace-expansion/package.json +0 -46
- data/packages/webpacker/node_modules/glob/LICENSE +0 -15
- data/packages/webpacker/node_modules/glob/README.md +0 -1214
- data/packages/webpacker/node_modules/glob/dist/cjs/package.json +0 -4
- data/packages/webpacker/node_modules/glob/dist/cjs/src/bin.d.ts +0 -3
- data/packages/webpacker/node_modules/glob/dist/cjs/src/bin.d.ts.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/cjs/src/bin.js +0 -270
- data/packages/webpacker/node_modules/glob/dist/cjs/src/bin.js.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/cjs/src/glob.d.ts +0 -344
- data/packages/webpacker/node_modules/glob/dist/cjs/src/glob.d.ts.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/cjs/src/glob.js +0 -238
- data/packages/webpacker/node_modules/glob/dist/cjs/src/glob.js.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.d.ts +0 -14
- data/packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.d.ts.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.js +0 -27
- data/packages/webpacker/node_modules/glob/dist/cjs/src/has-magic.js.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/cjs/src/ignore.d.ts +0 -20
- data/packages/webpacker/node_modules/glob/dist/cjs/src/ignore.d.ts.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/cjs/src/ignore.js +0 -103
- data/packages/webpacker/node_modules/glob/dist/cjs/src/ignore.js.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/cjs/src/index.d.ts +0 -95
- data/packages/webpacker/node_modules/glob/dist/cjs/src/index.d.ts.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/cjs/src/index.js +0 -68
- data/packages/webpacker/node_modules/glob/dist/cjs/src/index.js.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/cjs/src/pattern.d.ts +0 -77
- data/packages/webpacker/node_modules/glob/dist/cjs/src/pattern.d.ts.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/cjs/src/pattern.js +0 -219
- data/packages/webpacker/node_modules/glob/dist/cjs/src/pattern.js.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/cjs/src/processor.d.ts +0 -59
- data/packages/webpacker/node_modules/glob/dist/cjs/src/processor.d.ts.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/cjs/src/processor.js +0 -309
- data/packages/webpacker/node_modules/glob/dist/cjs/src/processor.js.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/cjs/src/walker.d.ts +0 -96
- data/packages/webpacker/node_modules/glob/dist/cjs/src/walker.d.ts.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/cjs/src/walker.js +0 -358
- data/packages/webpacker/node_modules/glob/dist/cjs/src/walker.js.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/mjs/glob.d.ts +0 -344
- data/packages/webpacker/node_modules/glob/dist/mjs/glob.d.ts.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/mjs/glob.js +0 -234
- data/packages/webpacker/node_modules/glob/dist/mjs/glob.js.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/mjs/has-magic.d.ts +0 -14
- data/packages/webpacker/node_modules/glob/dist/mjs/has-magic.d.ts.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/mjs/has-magic.js +0 -23
- data/packages/webpacker/node_modules/glob/dist/mjs/has-magic.js.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/mjs/ignore.d.ts +0 -20
- data/packages/webpacker/node_modules/glob/dist/mjs/ignore.d.ts.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/mjs/ignore.js +0 -99
- data/packages/webpacker/node_modules/glob/dist/mjs/ignore.js.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/mjs/index.d.ts +0 -95
- data/packages/webpacker/node_modules/glob/dist/mjs/index.d.ts.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/mjs/index.js +0 -56
- data/packages/webpacker/node_modules/glob/dist/mjs/index.js.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/mjs/package.json +0 -4
- data/packages/webpacker/node_modules/glob/dist/mjs/pattern.d.ts +0 -77
- data/packages/webpacker/node_modules/glob/dist/mjs/pattern.d.ts.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/mjs/pattern.js +0 -215
- data/packages/webpacker/node_modules/glob/dist/mjs/pattern.js.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/mjs/processor.d.ts +0 -59
- data/packages/webpacker/node_modules/glob/dist/mjs/processor.d.ts.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/mjs/processor.js +0 -302
- data/packages/webpacker/node_modules/glob/dist/mjs/processor.js.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/mjs/walker.d.ts +0 -96
- data/packages/webpacker/node_modules/glob/dist/mjs/walker.d.ts.map +0 -1
- data/packages/webpacker/node_modules/glob/dist/mjs/walker.js +0 -352
- data/packages/webpacker/node_modules/glob/dist/mjs/walker.js.map +0 -1
- data/packages/webpacker/node_modules/glob/package.json +0 -98
- data/packages/webpacker/node_modules/js-yaml/CHANGELOG.md +0 -616
- data/packages/webpacker/node_modules/js-yaml/LICENSE +0 -21
- data/packages/webpacker/node_modules/js-yaml/README.md +0 -246
- data/packages/webpacker/node_modules/js-yaml/bin/js-yaml.js +0 -126
- data/packages/webpacker/node_modules/js-yaml/dist/js-yaml.js +0 -3874
- data/packages/webpacker/node_modules/js-yaml/dist/js-yaml.min.js +0 -2
- data/packages/webpacker/node_modules/js-yaml/dist/js-yaml.mjs +0 -3851
- data/packages/webpacker/node_modules/js-yaml/index.js +0 -47
- data/packages/webpacker/node_modules/js-yaml/lib/common.js +0 -59
- data/packages/webpacker/node_modules/js-yaml/lib/dumper.js +0 -965
- data/packages/webpacker/node_modules/js-yaml/lib/exception.js +0 -55
- data/packages/webpacker/node_modules/js-yaml/lib/loader.js +0 -1727
- data/packages/webpacker/node_modules/js-yaml/lib/schema/core.js +0 -11
- data/packages/webpacker/node_modules/js-yaml/lib/schema/default.js +0 -22
- data/packages/webpacker/node_modules/js-yaml/lib/schema/failsafe.js +0 -17
- data/packages/webpacker/node_modules/js-yaml/lib/schema/json.js +0 -19
- data/packages/webpacker/node_modules/js-yaml/lib/schema.js +0 -121
- data/packages/webpacker/node_modules/js-yaml/lib/snippet.js +0 -101
- data/packages/webpacker/node_modules/js-yaml/lib/type/binary.js +0 -125
- data/packages/webpacker/node_modules/js-yaml/lib/type/bool.js +0 -35
- data/packages/webpacker/node_modules/js-yaml/lib/type/float.js +0 -97
- data/packages/webpacker/node_modules/js-yaml/lib/type/int.js +0 -156
- data/packages/webpacker/node_modules/js-yaml/lib/type/map.js +0 -8
- data/packages/webpacker/node_modules/js-yaml/lib/type/merge.js +0 -12
- data/packages/webpacker/node_modules/js-yaml/lib/type/null.js +0 -35
- data/packages/webpacker/node_modules/js-yaml/lib/type/omap.js +0 -44
- data/packages/webpacker/node_modules/js-yaml/lib/type/pairs.js +0 -53
- data/packages/webpacker/node_modules/js-yaml/lib/type/seq.js +0 -8
- data/packages/webpacker/node_modules/js-yaml/lib/type/set.js +0 -29
- data/packages/webpacker/node_modules/js-yaml/lib/type/str.js +0 -8
- data/packages/webpacker/node_modules/js-yaml/lib/type/timestamp.js +0 -88
- data/packages/webpacker/node_modules/js-yaml/lib/type.js +0 -66
- data/packages/webpacker/node_modules/js-yaml/package.json +0 -66
- data/packages/webpacker/node_modules/minimatch/LICENSE +0 -15
- data/packages/webpacker/node_modules/minimatch/README.md +0 -454
- data/packages/webpacker/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts +0 -2
- data/packages/webpacker/node_modules/minimatch/dist/cjs/assert-valid-pattern.d.ts.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/cjs/assert-valid-pattern.js +0 -14
- data/packages/webpacker/node_modules/minimatch/dist/cjs/assert-valid-pattern.js.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/cjs/ast.d.ts +0 -19
- data/packages/webpacker/node_modules/minimatch/dist/cjs/ast.d.ts.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/cjs/ast.js +0 -589
- data/packages/webpacker/node_modules/minimatch/dist/cjs/ast.js.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/cjs/brace-expressions.d.ts +0 -8
- data/packages/webpacker/node_modules/minimatch/dist/cjs/brace-expressions.d.ts.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/cjs/brace-expressions.js +0 -152
- data/packages/webpacker/node_modules/minimatch/dist/cjs/brace-expressions.js.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/cjs/escape.d.ts +0 -12
- data/packages/webpacker/node_modules/minimatch/dist/cjs/escape.d.ts.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/cjs/escape.js +0 -22
- data/packages/webpacker/node_modules/minimatch/dist/cjs/escape.js.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/cjs/index.d.ts +0 -94
- data/packages/webpacker/node_modules/minimatch/dist/cjs/index.d.ts.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/cjs/index.js +0 -1011
- data/packages/webpacker/node_modules/minimatch/dist/cjs/index.js.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/cjs/package.json +0 -3
- data/packages/webpacker/node_modules/minimatch/dist/cjs/unescape.d.ts +0 -17
- data/packages/webpacker/node_modules/minimatch/dist/cjs/unescape.d.ts.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/cjs/unescape.js +0 -24
- data/packages/webpacker/node_modules/minimatch/dist/cjs/unescape.js.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/mjs/assert-valid-pattern.d.ts +0 -2
- data/packages/webpacker/node_modules/minimatch/dist/mjs/assert-valid-pattern.d.ts.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/mjs/assert-valid-pattern.js +0 -10
- data/packages/webpacker/node_modules/minimatch/dist/mjs/assert-valid-pattern.js.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/mjs/ast.d.ts +0 -19
- data/packages/webpacker/node_modules/minimatch/dist/mjs/ast.d.ts.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/mjs/ast.js +0 -585
- data/packages/webpacker/node_modules/minimatch/dist/mjs/ast.js.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/mjs/brace-expressions.d.ts +0 -8
- data/packages/webpacker/node_modules/minimatch/dist/mjs/brace-expressions.d.ts.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/mjs/brace-expressions.js +0 -148
- data/packages/webpacker/node_modules/minimatch/dist/mjs/brace-expressions.js.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/mjs/escape.d.ts +0 -12
- data/packages/webpacker/node_modules/minimatch/dist/mjs/escape.d.ts.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/mjs/escape.js +0 -18
- data/packages/webpacker/node_modules/minimatch/dist/mjs/escape.js.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/mjs/index.d.ts +0 -94
- data/packages/webpacker/node_modules/minimatch/dist/mjs/index.d.ts.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/mjs/index.js +0 -995
- data/packages/webpacker/node_modules/minimatch/dist/mjs/index.js.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/mjs/package.json +0 -3
- data/packages/webpacker/node_modules/minimatch/dist/mjs/unescape.d.ts +0 -17
- data/packages/webpacker/node_modules/minimatch/dist/mjs/unescape.d.ts.map +0 -1
- data/packages/webpacker/node_modules/minimatch/dist/mjs/unescape.js +0 -20
- data/packages/webpacker/node_modules/minimatch/dist/mjs/unescape.js.map +0 -1
- 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
|
-
[](http://travis-ci.org/kpdecker/jsdiff)
|
4
|
-
[](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
|
-
[](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).
|