jest-diff
Advanced tools
Comparing version 20.1.0-delta.4 to 20.1.0-delta.5
@@ -18,11 +18,11 @@ 'use strict'; | ||
var _constants = require('./constants.js');function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} | ||
const DIFF_CONTEXT = 5; /** | ||
* Copyright (c) 2014, Facebook, Inc. All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* | ||
*/ | ||
const DIFF_CONTEXT_DEFAULT = 5; /** | ||
* Copyright (c) 2014, Facebook, Inc. All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* | ||
*/ | ||
@@ -37,2 +37,3 @@ | ||
const getColor = (added, removed) => | ||
@@ -99,4 +100,9 @@ added ? _chalk2.default.red : removed ? _chalk2.default.green : _chalk2.default.dim; | ||
const structuredPatch = (a, b) => { | ||
const options = { context: DIFF_CONTEXT }; | ||
const structuredPatch = (a, b, contextLines) => { | ||
const options = { | ||
context: | ||
typeof contextLines === 'number' && contextLines >= 0 ? | ||
contextLines : | ||
DIFF_CONTEXT_DEFAULT }; | ||
let isDifferent = false; | ||
@@ -147,3 +153,3 @@ // Make sure the strings end with a newline. | ||
options && options.expand === false ? | ||
structuredPatch(a, b) : | ||
structuredPatch(a, b, options && options.contextLines) : | ||
diffLines(a, b); | ||
@@ -150,0 +156,0 @@ |
{ | ||
"name": "jest-diff", | ||
"version": "20.1.0-delta.4", | ||
"version": "20.1.0-delta.5", | ||
"repository": { | ||
@@ -13,6 +13,6 @@ "type": "git", | ||
"diff": "^3.2.0", | ||
"jest-get-type": "20.1.0-delta.4", | ||
"jest-matcher-utils": "20.1.0-delta.4", | ||
"pretty-format": "20.1.0-delta.4" | ||
"jest-get-type": "20.1.0-delta.5", | ||
"jest-matcher-utils": "20.1.0-delta.5", | ||
"pretty-format": "20.1.0-delta.5" | ||
} | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
11433
232
1
+ Addedjest-get-type@20.1.0-delta.5(transitive)
+ Addedjest-matcher-utils@20.1.0-delta.5(transitive)
+ Addedpretty-format@20.1.0-delta.5(transitive)
- Removedjest-get-type@20.1.0-delta.4(transitive)
- Removedjest-matcher-utils@20.1.0-delta.4(transitive)
- Removedpretty-format@20.1.0-delta.4(transitive)
Updatedjest-get-type@20.1.0-delta.5
Updatedpretty-format@20.1.0-delta.5