Update checked-in dependencies
This commit is contained in:
parent
3ba511a8f1
commit
1c4c64199f
175 changed files with 13227 additions and 15136 deletions
59
node_modules/diff/README.md
generated
vendored
59
node_modules/diff/README.md
generated
vendored
|
|
@ -15,25 +15,25 @@ npm install diff --save
|
|||
|
||||
## API
|
||||
|
||||
* `JsDiff.diffChars(oldStr, newStr[, options])` - diffs two blocks of text, comparing character by character.
|
||||
* `Diff.diffChars(oldStr, newStr[, options])` - diffs two blocks of text, comparing character by character.
|
||||
|
||||
Returns a list of change objects (See below).
|
||||
|
||||
Options
|
||||
* `ignoreCase`: `true` to ignore casing difference. Defaults to `false`.
|
||||
|
||||
* `JsDiff.diffWords(oldStr, newStr[, options])` - diffs two blocks of text, comparing word by word, ignoring whitespace.
|
||||
* `Diff.diffWords(oldStr, newStr[, options])` - diffs two blocks of text, comparing word by word, ignoring whitespace.
|
||||
|
||||
Returns a list of change objects (See below).
|
||||
|
||||
Options
|
||||
* `ignoreCase`: Same as in `diffChars`.
|
||||
|
||||
* `JsDiff.diffWordsWithSpace(oldStr, newStr[, options])` - diffs two blocks of text, comparing word by word, treating whitespace as significant.
|
||||
* `Diff.diffWordsWithSpace(oldStr, newStr[, options])` - diffs two blocks of text, comparing word by word, treating whitespace as significant.
|
||||
|
||||
Returns a list of change objects (See below).
|
||||
|
||||
* `JsDiff.diffLines(oldStr, newStr[, options])` - diffs two blocks of text, comparing line by line.
|
||||
* `Diff.diffLines(oldStr, newStr[, options])` - diffs two blocks of text, comparing line by line.
|
||||
|
||||
Options
|
||||
* `ignoreWhitespace`: `true` to ignore leading and trailing whitespace. This is the same as `diffTrimmedLines`
|
||||
|
|
@ -41,30 +41,30 @@ npm install diff --save
|
|||
|
||||
Returns a list of change objects (See below).
|
||||
|
||||
* `JsDiff.diffTrimmedLines(oldStr, newStr[, options])` - diffs two blocks of text, comparing line by line, ignoring leading and trailing whitespace.
|
||||
* `Diff.diffTrimmedLines(oldStr, newStr[, options])` - diffs two blocks of text, comparing line by line, ignoring leading and trailing whitespace.
|
||||
|
||||
Returns a list of change objects (See below).
|
||||
|
||||
* `JsDiff.diffSentences(oldStr, newStr[, options])` - diffs two blocks of text, comparing sentence by sentence.
|
||||
* `Diff.diffSentences(oldStr, newStr[, options])` - diffs two blocks of text, comparing sentence by sentence.
|
||||
|
||||
Returns a list of change objects (See below).
|
||||
|
||||
* `JsDiff.diffCss(oldStr, newStr[, options])` - diffs two blocks of text, comparing CSS tokens.
|
||||
* `Diff.diffCss(oldStr, newStr[, options])` - diffs two blocks of text, comparing CSS tokens.
|
||||
|
||||
Returns a list of change objects (See below).
|
||||
|
||||
* `JsDiff.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.
|
||||
* `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.
|
||||
|
||||
Returns a list of change objects (See below).
|
||||
|
||||
* `JsDiff.diffArrays(oldArr, newArr[, options])` - diffs two arrays, comparing each item for strict equality (===).
|
||||
* `Diff.diffArrays(oldArr, newArr[, options])` - diffs two arrays, comparing each item for strict equality (===).
|
||||
|
||||
Options
|
||||
* `comparator`: `function(left, right)` for custom equality checks
|
||||
|
||||
Returns a list of change objects (See below).
|
||||
|
||||
* `JsDiff.createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader)` - creates a unified diff patch.
|
||||
* `Diff.createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader)` - creates a unified diff patch.
|
||||
|
||||
Parameters:
|
||||
* `oldFileName` : String to be output in the filename section of the patch for the removals
|
||||
|
|
@ -75,12 +75,12 @@ npm install diff --save
|
|||
* `newHeader` : Additional information to include in the new file header
|
||||
* `options` : An object with options. Currently, only `context` is supported and describes how many lines of context should be included.
|
||||
|
||||
* `JsDiff.createPatch(fileName, oldStr, newStr, oldHeader, newHeader)` - creates a unified diff patch.
|
||||
* `Diff.createPatch(fileName, oldStr, newStr, oldHeader, newHeader)` - creates a unified diff patch.
|
||||
|
||||
Just like JsDiff.createTwoFilesPatch, but with oldFileName being equal to newFileName.
|
||||
Just like Diff.createTwoFilesPatch, but with oldFileName being equal to newFileName.
|
||||
|
||||
|
||||
* `JsDiff.structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options)` - returns an object with an array of hunk objects.
|
||||
* `Diff.structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options)` - returns an object with an array of hunk objects.
|
||||
|
||||
This method is similar to createTwoFilesPatch, but returns a data structure
|
||||
suitable for further processing. Parameters are the same as createTwoFilesPatch. The data structure returned may look like this:
|
||||
|
|
@ -96,7 +96,7 @@ npm install diff --save
|
|||
}
|
||||
```
|
||||
|
||||
* `JsDiff.applyPatch(source, patch[, options])` - applies a unified diff patch.
|
||||
* `Diff.applyPatch(source, patch[, options])` - applies a unified diff patch.
|
||||
|
||||
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,7 +105,7 @@ npm install diff --save
|
|||
- `fuzzFactor`: Number of lines that are allowed to differ before rejecting a patch. Defaults to 0.
|
||||
- `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.
|
||||
|
||||
* `JsDiff.applyPatches(patch, options)` - applies one or more patches.
|
||||
* `Diff.applyPatches(patch, options)` - applies one or more patches.
|
||||
|
||||
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,9 +114,9 @@ npm install diff --save
|
|||
|
||||
Once all patches have been applied or an error occurs, the `options.complete(err)` callback is made.
|
||||
|
||||
* `JsDiff.parsePatch(diffStr)` - Parses a patch into structured data
|
||||
* `Diff.parsePatch(diffStr)` - Parses a patch into structured data
|
||||
|
||||
Return a JSON object representation of the a patch, suitable for use with the `applyPatch` method. This parses to the same structure returned by `JsDiff.structuredPatch`.
|
||||
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`.
|
||||
|
||||
* `convertChangesToXML(changes)` - converts a list of changes to a serialized XML format
|
||||
|
||||
|
|
@ -138,17 +138,17 @@ Basic example in Node
|
|||
|
||||
```js
|
||||
require('colors');
|
||||
var jsdiff = require('diff');
|
||||
const Diff = require('diff');
|
||||
|
||||
var one = 'beep boop';
|
||||
var other = 'beep boob blah';
|
||||
const one = 'beep boop';
|
||||
const other = 'beep boob blah';
|
||||
|
||||
var diff = jsdiff.diffChars(one, other);
|
||||
const diff = Diff.diffChars(one, other);
|
||||
|
||||
diff.forEach(function(part){
|
||||
diff.forEach((part) => {
|
||||
// green for additions, red for deletions
|
||||
// grey for common parts
|
||||
var color = part.added ? 'green' :
|
||||
const color = part.added ? 'green' :
|
||||
part.removed ? 'red' : 'grey';
|
||||
process.stderr.write(part.value[color]);
|
||||
});
|
||||
|
|
@ -165,19 +165,20 @@ Basic example in a web page
|
|||
<pre id="display"></pre>
|
||||
<script src="diff.js"></script>
|
||||
<script>
|
||||
var one = 'beep boop',
|
||||
const one = 'beep boop',
|
||||
other = 'beep boob blah',
|
||||
color = '',
|
||||
span = null;
|
||||
color = '';
|
||||
|
||||
let span = null;
|
||||
|
||||
var diff = JsDiff.diffChars(one, other),
|
||||
const diff = Diff.diffChars(one, other),
|
||||
display = document.getElementById('display'),
|
||||
fragment = document.createDocumentFragment();
|
||||
|
||||
diff.forEach(function(part){
|
||||
diff.forEach((part) => {
|
||||
// green for additions, red for deletions
|
||||
// grey for common parts
|
||||
color = part.added ? 'green' :
|
||||
const color = part.added ? 'green' :
|
||||
part.removed ? 'red' : 'grey';
|
||||
span = document.createElement('span');
|
||||
span.style.color = color;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue