Deployed the page to Github Pages.
This commit is contained in:
parent
1d79754e93
commit
2c89899458
62797 changed files with 6551425 additions and 15279 deletions
194
node_modules/istanbul-lib-source-maps/CHANGELOG.md
generated
vendored
Normal file
194
node_modules/istanbul-lib-source-maps/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,194 @@
|
|||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [3.0.6](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-source-maps@3.0.5...istanbul-lib-source-maps@3.0.6) (2019-04-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* if LEAST_UPPER_BOUND returns null, try GREATEST_LOWER_BOUND ([#375](https://github.com/istanbuljs/istanbuljs/issues/375)) ([72b0f05](https://github.com/istanbuljs/istanbuljs/commit/72b0f05))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.0.5](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-source-maps@3.0.4...istanbul-lib-source-maps@3.0.5) (2019-04-09)
|
||||
|
||||
**Note:** Version bump only for package istanbul-lib-source-maps
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.0.4](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-source-maps@3.0.3...istanbul-lib-source-maps@3.0.4) (2019-04-03)
|
||||
|
||||
**Note:** Version bump only for package istanbul-lib-source-maps
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.0.3](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-source-maps@3.0.2...istanbul-lib-source-maps@3.0.3) (2019-03-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Map unique files once, regardless of path separator ([#287](https://github.com/istanbuljs/istanbuljs/issues/287)) ([39a1e56](https://github.com/istanbuljs/istanbuljs/commit/39a1e56))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.0.2](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-source-maps@3.0.1...istanbul-lib-source-maps@3.0.2) (2019-01-26)
|
||||
|
||||
**Note:** Version bump only for package istanbul-lib-source-maps
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="3.0.1"></a>
|
||||
## [3.0.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-source-maps@3.0.0...istanbul-lib-source-maps@3.0.1) (2018-12-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* correct variable name in source-map transform ([#257](https://github.com/istanbuljs/istanbuljs/issues/257)) ([de9c921](https://github.com/istanbuljs/istanbuljs/commit/de9c921))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="3.0.0"></a>
|
||||
# [3.0.0](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-source-maps@2.0.1...istanbul-lib-source-maps@3.0.0) (2018-12-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* correctly calculate end position of sourcemap statement ([f97ffc7](https://github.com/istanbuljs/istanbuljs/commit/f97ffc7))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* coverage output can now contain Infinity, when a range extends past the source in a file.
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="2.0.1"></a>
|
||||
## [2.0.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-source-maps@2.0.0...istanbul-lib-source-maps@2.0.1) (2018-07-07)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package istanbul-lib-source-maps
|
||||
|
||||
<a name="2.0.0"></a>
|
||||
# [2.0.0](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-source-maps@1.2.5...istanbul-lib-source-maps@2.0.0) (2018-06-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* use null prototype for map objects ([#177](https://github.com/istanbuljs/istanbuljs/issues/177)) ([9a5a30c](https://github.com/istanbuljs/istanbuljs/commit/9a5a30c))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* a null prototype is now used in several places rather than the default `{}` assignment.
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="1.2.5"></a>
|
||||
## [1.2.5](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-source-maps@1.2.4...istanbul-lib-source-maps@1.2.5) (2018-05-31)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* process.cwd is a function not a string ([#163](https://github.com/istanbuljs/istanbuljs/issues/163)). ([#171](https://github.com/istanbuljs/istanbuljs/issues/171)) ([9c7802c](https://github.com/istanbuljs/istanbuljs/commit/9c7802c))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="1.2.4"></a>
|
||||
## [1.2.4](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-source-maps@1.2.3...istanbul-lib-source-maps@1.2.4) (2018-03-04)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package istanbul-lib-source-maps
|
||||
|
||||
<a name="1.2.3"></a>
|
||||
## [1.2.3](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-source-maps@1.2.2...istanbul-lib-source-maps@1.2.3) (2018-02-13)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package istanbul-lib-source-maps
|
||||
|
||||
<a name="1.2.2"></a>
|
||||
## [1.2.2](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-source-maps@1.2.1...istanbul-lib-source-maps@1.2.2) (2017-10-21)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package istanbul-lib-source-maps
|
||||
|
||||
<a name="1.2.1"></a>
|
||||
## [1.2.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-source-maps@1.2.0...istanbul-lib-source-maps@1.2.1) (2017-05-27)
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="1.2.0"></a>
|
||||
# [1.2.0](https://github.com/istanbuljs/istanbul-lib-source-maps/compare/istanbul-lib-source-maps@1.1.1...istanbul-lib-source-maps@1.2.0) (2017-04-29)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* pull in debug module, to make debug messages optional ([#36](https://github.com/istanbuljs/istanbuljs/issues/36)) ([189519d](https://github.com/istanbuljs/istanbul-lib-source-maps/commit/189519d))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="1.1.1"></a>
|
||||
## [1.1.1](https://github.com/istanbuljs/istanbul-lib-source-maps/compare/istanbul-lib-source-maps@1.1.0...istanbul-lib-source-maps@1.1.1) (2017-03-27)
|
||||
|
||||
<a name="1.1.0"></a>
|
||||
# [1.1.0](https://github.com/istanbuljs/istanbul-lib-source-maps/compare/v1.0.2...v1.1.0) (2016-11-10)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* read and apply any input source maps stored with coverage data ([#4](https://github.com/istanbuljs/istanbul-lib-source-maps/issues/4)) ([aea405b](https://github.com/istanbuljs/istanbul-lib-source-maps/commit/aea405b))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.2"></a>
|
||||
## [1.0.2](https://github.com/istanbuljs/istanbul-lib-source-maps/compare/v1.0.1...v1.0.2) (2016-10-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* broken mapped coverage report ([#6](https://github.com/istanbuljs/istanbul-lib-source-maps/issues/6)) ([d9dd738](https://github.com/istanbuljs/istanbul-lib-source-maps/commit/d9dd738))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.1"></a>
|
||||
## [1.0.1](https://github.com/istanbuljs/istanbul-lib-source-maps/compare/v1.0.0...v1.0.1) (2016-09-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* position validation shouldn't throw away locations with 0 ([#5](https://github.com/istanbuljs/istanbul-lib-source-maps/issues/5)) ([ac4b72c](https://github.com/istanbuljs/istanbul-lib-source-maps/commit/ac4b72c))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://github.com/istanbuljs/istanbul-lib-source-maps/compare/v1.0.0-alpha.9...v1.0.0) (2016-08-31)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* discard more bad source map positions ([#3](https://github.com/istanbuljs/istanbul-lib-source-maps/issues/3)) ([ed7b27f](https://github.com/istanbuljs/istanbul-lib-source-maps/commit/ed7b27f))
|
24
node_modules/istanbul-lib-source-maps/LICENSE
generated
vendored
Normal file
24
node_modules/istanbul-lib-source-maps/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
Copyright 2015 Yahoo! Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the Yahoo! Inc. nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
11
node_modules/istanbul-lib-source-maps/README.md
generated
vendored
Normal file
11
node_modules/istanbul-lib-source-maps/README.md
generated
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
# istanbul-lib-source-maps
|
||||
|
||||
[](https://travis-ci.org/istanbuljs/istanbuljs)
|
||||
|
||||
Source map support for istanbuljs.
|
||||
|
||||
## Debugging
|
||||
|
||||
_istanbul-lib-source-maps_ uses the [debug](https://www.npmjs.com/package/debug) module.
|
||||
Run your application with the environment variable `DEBUG=istanbuljs`, to receive debug
|
||||
output.
|
15
node_modules/istanbul-lib-source-maps/index.js
generated
vendored
Normal file
15
node_modules/istanbul-lib-source-maps/index.js
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
Copyright 2012-2015, Yahoo Inc.
|
||||
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const { MapStore } = require('./lib/map-store');
|
||||
/**
|
||||
* @module Exports
|
||||
*/
|
||||
module.exports = {
|
||||
createSourceMapStore(opts) {
|
||||
return new MapStore(opts);
|
||||
}
|
||||
};
|
182
node_modules/istanbul-lib-source-maps/lib/get-mapping.js
generated
vendored
Normal file
182
node_modules/istanbul-lib-source-maps/lib/get-mapping.js
generated
vendored
Normal file
|
@ -0,0 +1,182 @@
|
|||
/*
|
||||
Copyright 2015, Yahoo Inc.
|
||||
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const pathutils = require('./pathutils');
|
||||
const {
|
||||
GREATEST_LOWER_BOUND,
|
||||
LEAST_UPPER_BOUND
|
||||
} = require('source-map').SourceMapConsumer;
|
||||
|
||||
/**
|
||||
* AST ranges are inclusive for start positions and exclusive for end positions.
|
||||
* Source maps are also logically ranges over text, though interacting with
|
||||
* them is generally achieved by working with explicit positions.
|
||||
*
|
||||
* When finding the _end_ location of an AST item, the range behavior is
|
||||
* important because what we're asking for is the _end_ of whatever range
|
||||
* corresponds to the end location we seek.
|
||||
*
|
||||
* This boils down to the following steps, conceptually, though the source-map
|
||||
* library doesn't expose primitives to do this nicely:
|
||||
*
|
||||
* 1. Find the range on the generated file that ends at, or exclusively
|
||||
* contains the end position of the AST node.
|
||||
* 2. Find the range on the original file that corresponds to
|
||||
* that generated range.
|
||||
* 3. Find the _end_ location of that original range.
|
||||
*/
|
||||
function originalEndPositionFor(sourceMap, generatedEnd) {
|
||||
// Given the generated location, find the original location of the mapping
|
||||
// that corresponds to a range on the generated file that overlaps the
|
||||
// generated file end location. Note however that this position on its
|
||||
// own is not useful because it is the position of the _start_ of the range
|
||||
// on the original file, and we want the _end_ of the range.
|
||||
const beforeEndMapping = originalPositionTryBoth(
|
||||
sourceMap,
|
||||
generatedEnd.line,
|
||||
generatedEnd.column - 1
|
||||
);
|
||||
if (beforeEndMapping.source === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Convert that original position back to a generated one, with a bump
|
||||
// to the right, and a rightward bias. Since 'generatedPositionFor' searches
|
||||
// for mappings in the original-order sorted list, this will find the
|
||||
// mapping that corresponds to the one immediately after the
|
||||
// beforeEndMapping mapping.
|
||||
const afterEndMapping = sourceMap.generatedPositionFor({
|
||||
source: beforeEndMapping.source,
|
||||
line: beforeEndMapping.line,
|
||||
column: beforeEndMapping.column + 1,
|
||||
bias: LEAST_UPPER_BOUND
|
||||
});
|
||||
if (
|
||||
// If this is null, it means that we've hit the end of the file,
|
||||
// so we can use Infinity as the end column.
|
||||
afterEndMapping.line === null ||
|
||||
// If these don't match, it means that the call to
|
||||
// 'generatedPositionFor' didn't find any other original mappings on
|
||||
// the line we gave, so consider the binding to extend to infinity.
|
||||
sourceMap.originalPositionFor(afterEndMapping).line !==
|
||||
beforeEndMapping.line
|
||||
) {
|
||||
return {
|
||||
source: beforeEndMapping.source,
|
||||
line: beforeEndMapping.line,
|
||||
column: Infinity
|
||||
};
|
||||
}
|
||||
|
||||
// Convert the end mapping into the real original position.
|
||||
return sourceMap.originalPositionFor(afterEndMapping);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to determine the original source position, first
|
||||
* returning the closest element to the left (GREATEST_LOWER_BOUND),
|
||||
* and next returning the closest element to the right (LEAST_UPPER_BOUND).
|
||||
*/
|
||||
function originalPositionTryBoth(sourceMap, line, column) {
|
||||
const mapping = sourceMap.originalPositionFor({
|
||||
line,
|
||||
column,
|
||||
bias: GREATEST_LOWER_BOUND
|
||||
});
|
||||
if (mapping.source === null) {
|
||||
return sourceMap.originalPositionFor({
|
||||
line,
|
||||
column,
|
||||
bias: LEAST_UPPER_BOUND
|
||||
});
|
||||
} else {
|
||||
return mapping;
|
||||
}
|
||||
}
|
||||
|
||||
function isInvalidPosition(pos) {
|
||||
return (
|
||||
!pos ||
|
||||
typeof pos.line !== 'number' ||
|
||||
typeof pos.column !== 'number' ||
|
||||
pos.line < 0 ||
|
||||
pos.column < 0
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* determines the original position for a given location
|
||||
* @param {SourceMapConsumer} sourceMap the source map
|
||||
* @param {Object} generatedLocation the original location Object
|
||||
* @returns {Object} the remapped location Object
|
||||
*/
|
||||
function getMapping(sourceMap, generatedLocation, origFile) {
|
||||
if (!generatedLocation) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (
|
||||
isInvalidPosition(generatedLocation.start) ||
|
||||
isInvalidPosition(generatedLocation.end)
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const start = originalPositionTryBoth(
|
||||
sourceMap,
|
||||
generatedLocation.start.line,
|
||||
generatedLocation.start.column
|
||||
);
|
||||
let end = originalEndPositionFor(sourceMap, generatedLocation.end);
|
||||
|
||||
/* istanbul ignore if: edge case too hard to test for */
|
||||
if (!(start && end)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!(start.source && end.source)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (start.source !== end.source) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* istanbul ignore if: edge case too hard to test for */
|
||||
if (start.line === null || start.column === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* istanbul ignore if: edge case too hard to test for */
|
||||
if (end.line === null || end.column === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (start.line === end.line && start.column === end.column) {
|
||||
end = sourceMap.originalPositionFor({
|
||||
line: generatedLocation.end.line,
|
||||
column: generatedLocation.end.column,
|
||||
bias: LEAST_UPPER_BOUND
|
||||
});
|
||||
end.column -= 1;
|
||||
}
|
||||
|
||||
return {
|
||||
source: pathutils.relativeTo(start.source, origFile),
|
||||
loc: {
|
||||
start: {
|
||||
line: start.line,
|
||||
column: start.column
|
||||
},
|
||||
end: {
|
||||
line: end.line,
|
||||
column: end.column
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = getMapping;
|
189
node_modules/istanbul-lib-source-maps/lib/map-store.js
generated
vendored
Normal file
189
node_modules/istanbul-lib-source-maps/lib/map-store.js
generated
vendored
Normal file
|
@ -0,0 +1,189 @@
|
|||
/*
|
||||
Copyright 2015, Yahoo Inc.
|
||||
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const debug = require('debug')('istanbuljs');
|
||||
const SMC = require('source-map').SourceMapConsumer;
|
||||
const pathutils = require('./pathutils');
|
||||
const sourceStore = require('./source-store');
|
||||
const transformer = require('./transformer');
|
||||
|
||||
/**
|
||||
* Tracks source maps for registered files
|
||||
*/
|
||||
class MapStore {
|
||||
/**
|
||||
* @param {Object} opts [opts=undefined] options.
|
||||
* @param {Boolean} opts.verbose [opts.verbose=false] verbose mode
|
||||
* @param {String} opts.baseDir [opts.baseDir=null] alternate base directory
|
||||
* to resolve sourcemap files
|
||||
* @param {String} opts.sourceStore [opts.sourceStore='memory'] - store that tracks
|
||||
* embedded sources found in source maps, one of 'memory' or 'file'
|
||||
* @param {String} opts.tmpdir [opts.tmpdir=undefined] - temporary directory
|
||||
* to use for storing files.
|
||||
* @constructor
|
||||
*/
|
||||
constructor(opts = {}) {
|
||||
this.baseDir = opts.baseDir || null;
|
||||
this.verbose = opts.verbose || false;
|
||||
this.sourceStore = sourceStore.create(opts.sourceStore, {
|
||||
tmpdir: opts.tmpdir
|
||||
});
|
||||
this.data = Object.create(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a source map URL with this store. It makes some input sanity checks
|
||||
* and silently fails on malformed input.
|
||||
* @param transformedFilePath - the file path for which the source map is valid.
|
||||
* This must *exactly* match the path stashed for the coverage object to be
|
||||
* useful.
|
||||
* @param sourceMapUrl - the source map URL, **not** a comment
|
||||
*/
|
||||
registerURL(transformedFilePath, sourceMapUrl) {
|
||||
const d = 'data:';
|
||||
|
||||
if (
|
||||
sourceMapUrl.length > d.length &&
|
||||
sourceMapUrl.substring(0, d.length) === d
|
||||
) {
|
||||
const b64 = 'base64,';
|
||||
const pos = sourceMapUrl.indexOf(b64);
|
||||
if (pos > 0) {
|
||||
this.data[transformedFilePath] = {
|
||||
type: 'encoded',
|
||||
data: sourceMapUrl.substring(pos + b64.length)
|
||||
};
|
||||
} else {
|
||||
debug(`Unable to interpret source map URL: ${sourceMapUrl}`);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const dir = path.dirname(path.resolve(transformedFilePath));
|
||||
const file = path.resolve(dir, sourceMapUrl);
|
||||
this.data[transformedFilePath] = { type: 'file', data: file };
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a source map object with this store. Makes some basic sanity checks
|
||||
* and silently fails on malformed input.
|
||||
* @param transformedFilePath - the file path for which the source map is valid
|
||||
* @param sourceMap - the source map object
|
||||
*/
|
||||
registerMap(transformedFilePath, sourceMap) {
|
||||
if (sourceMap && sourceMap.version) {
|
||||
this.data[transformedFilePath] = {
|
||||
type: 'object',
|
||||
data: sourceMap
|
||||
};
|
||||
} else {
|
||||
debug(
|
||||
'Invalid source map object: ' +
|
||||
JSON.stringify(sourceMap, null, 2)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms the coverage map provided into one that refers to original
|
||||
* sources when valid mappings have been registered with this store.
|
||||
* @param {CoverageMap} coverageMap - the coverage map to transform
|
||||
* @returns {Object} an object with 2 properties. `map` for the transformed
|
||||
* coverage map and `sourceFinder` which is a function to return the source
|
||||
* text for a file.
|
||||
*/
|
||||
transformCoverage(coverageMap) {
|
||||
const sourceFinder = filePath => {
|
||||
const content = this.sourceStore.getSource(filePath);
|
||||
if (content !== null) {
|
||||
return content;
|
||||
}
|
||||
|
||||
if (path.isAbsolute(filePath)) {
|
||||
return fs.readFileSync(filePath, 'utf8');
|
||||
}
|
||||
|
||||
return fs.readFileSync(
|
||||
pathutils.asAbsolute(filePath, this.baseDir)
|
||||
);
|
||||
};
|
||||
|
||||
coverageMap.files().forEach(file => {
|
||||
const coverage = coverageMap.fileCoverageFor(file);
|
||||
if (coverage.data.inputSourceMap && !this.data[file]) {
|
||||
this.registerMap(file, coverage.data.inputSourceMap);
|
||||
}
|
||||
});
|
||||
|
||||
if (Object.keys(this.data).length === 0) {
|
||||
return {
|
||||
map: coverageMap,
|
||||
sourceFinder
|
||||
};
|
||||
}
|
||||
|
||||
const mappedCoverage = transformer
|
||||
.create(filePath => {
|
||||
try {
|
||||
if (!this.data[filePath]) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const d = this.data[filePath];
|
||||
let obj;
|
||||
if (d.type === 'file') {
|
||||
obj = JSON.parse(fs.readFileSync(d.data, 'utf8'));
|
||||
} else if (d.type === 'encoded') {
|
||||
obj = JSON.parse(
|
||||
Buffer.from(d.data, 'base64').toString()
|
||||
);
|
||||
} else {
|
||||
obj = d.data;
|
||||
}
|
||||
|
||||
const smc = new SMC(obj);
|
||||
smc.sources.forEach(s => {
|
||||
const content = smc.sourceContentFor(s);
|
||||
if (content) {
|
||||
const sourceFilePath = pathutils.relativeTo(
|
||||
s,
|
||||
filePath
|
||||
);
|
||||
this.sourceStore.registerSource(
|
||||
sourceFilePath,
|
||||
content
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
return smc;
|
||||
} catch (error) {
|
||||
debug('Error returning source map for ' + filePath);
|
||||
debug(error.stack);
|
||||
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.transform(coverageMap);
|
||||
|
||||
return {
|
||||
map: mappedCoverage,
|
||||
sourceFinder
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Disposes temporary resources allocated by this map store
|
||||
*/
|
||||
dispose() {
|
||||
this.sourceStore.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { MapStore };
|
113
node_modules/istanbul-lib-source-maps/lib/mapped.js
generated
vendored
Normal file
113
node_modules/istanbul-lib-source-maps/lib/mapped.js
generated
vendored
Normal file
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
Copyright 2015, Yahoo Inc.
|
||||
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const { FileCoverage } = require('istanbul-lib-coverage').classes;
|
||||
|
||||
function locString(loc) {
|
||||
return [
|
||||
loc.start.line,
|
||||
loc.start.column,
|
||||
loc.end.line,
|
||||
loc.end.column
|
||||
].join(':');
|
||||
}
|
||||
|
||||
class MappedCoverage extends FileCoverage {
|
||||
constructor(pathOrObj) {
|
||||
super(pathOrObj);
|
||||
|
||||
this.meta = {
|
||||
last: {
|
||||
s: 0,
|
||||
f: 0,
|
||||
b: 0
|
||||
},
|
||||
seen: {}
|
||||
};
|
||||
}
|
||||
|
||||
addStatement(loc, hits) {
|
||||
const key = 's:' + locString(loc);
|
||||
const { meta } = this;
|
||||
let index = meta.seen[key];
|
||||
|
||||
if (index === undefined) {
|
||||
index = meta.last.s;
|
||||
meta.last.s += 1;
|
||||
meta.seen[key] = index;
|
||||
this.statementMap[index] = this.cloneLocation(loc);
|
||||
}
|
||||
|
||||
this.s[index] = this.s[index] || 0;
|
||||
this.s[index] += hits;
|
||||
return index;
|
||||
}
|
||||
|
||||
addFunction(name, decl, loc, hits) {
|
||||
const key = 'f:' + locString(decl);
|
||||
const { meta } = this;
|
||||
let index = meta.seen[key];
|
||||
|
||||
if (index === undefined) {
|
||||
index = meta.last.f;
|
||||
meta.last.f += 1;
|
||||
meta.seen[key] = index;
|
||||
name = name || `(unknown_${index})`;
|
||||
this.fnMap[index] = {
|
||||
name,
|
||||
decl: this.cloneLocation(decl),
|
||||
loc: this.cloneLocation(loc)
|
||||
};
|
||||
}
|
||||
|
||||
this.f[index] = this.f[index] || 0;
|
||||
this.f[index] += hits;
|
||||
return index;
|
||||
}
|
||||
|
||||
addBranch(type, loc, branchLocations, hits) {
|
||||
const key = ['b', ...branchLocations.map(l => locString(l))].join(':');
|
||||
const { meta } = this;
|
||||
let index = meta.seen[key];
|
||||
if (index === undefined) {
|
||||
index = meta.last.b;
|
||||
meta.last.b += 1;
|
||||
meta.seen[key] = index;
|
||||
this.branchMap[index] = {
|
||||
loc,
|
||||
type,
|
||||
locations: branchLocations.map(l => this.cloneLocation(l))
|
||||
};
|
||||
}
|
||||
|
||||
if (!this.b[index]) {
|
||||
this.b[index] = branchLocations.map(() => 0);
|
||||
}
|
||||
|
||||
hits.forEach((hit, i) => {
|
||||
this.b[index][i] += hit;
|
||||
});
|
||||
return index;
|
||||
}
|
||||
|
||||
/* Returns a clone of the location object with only the attributes of interest */
|
||||
cloneLocation(loc) {
|
||||
return {
|
||||
start: {
|
||||
line: loc.start.line,
|
||||
column: loc.start.column
|
||||
},
|
||||
end: {
|
||||
line: loc.end.line,
|
||||
column: loc.end.column
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
MappedCoverage
|
||||
};
|
21
node_modules/istanbul-lib-source-maps/lib/pathutils.js
generated
vendored
Normal file
21
node_modules/istanbul-lib-source-maps/lib/pathutils.js
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
Copyright 2015, Yahoo Inc.
|
||||
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
isAbsolute: path.isAbsolute,
|
||||
asAbsolute(file, baseDir) {
|
||||
return path.isAbsolute(file)
|
||||
? file
|
||||
: path.resolve(baseDir || process.cwd(), file);
|
||||
},
|
||||
relativeTo(file, origFile) {
|
||||
return path.isAbsolute(file)
|
||||
? file
|
||||
: path.resolve(path.dirname(origFile), file);
|
||||
}
|
||||
};
|
80
node_modules/istanbul-lib-source-maps/lib/source-store.js
generated
vendored
Normal file
80
node_modules/istanbul-lib-source-maps/lib/source-store.js
generated
vendored
Normal file
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
Copyright 2015, Yahoo Inc.
|
||||
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const mkdirp = require('make-dir');
|
||||
const rimraf = require('rimraf');
|
||||
|
||||
/* This exists for compatibility only to avoid changing the
|
||||
* prototype chain. */
|
||||
class SourceStore {}
|
||||
|
||||
class MemoryStore extends SourceStore {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.data = {};
|
||||
}
|
||||
|
||||
registerSource(filePath, sourceText) {
|
||||
this.data[filePath] = sourceText;
|
||||
}
|
||||
|
||||
getSource(filePath) {
|
||||
return this.data[filePath] || null;
|
||||
}
|
||||
|
||||
dispose() {}
|
||||
}
|
||||
|
||||
class FileStore extends SourceStore {
|
||||
constructor(opts = {}) {
|
||||
super();
|
||||
|
||||
const tmpDir = opts.tmpdir || os.tmpdir();
|
||||
this.counter = 0;
|
||||
this.mappings = [];
|
||||
this.basePath = path.resolve(tmpDir, '.istanbul', 'cache_');
|
||||
mkdirp.sync(path.dirname(this.basePath));
|
||||
}
|
||||
|
||||
registerSource(filePath, sourceText) {
|
||||
if (this.mappings[filePath]) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.counter += 1;
|
||||
const mapFile = this.basePath + this.counter;
|
||||
this.mappings[filePath] = mapFile;
|
||||
fs.writeFileSync(mapFile, sourceText, 'utf8');
|
||||
}
|
||||
|
||||
getSource(filePath) {
|
||||
const mapFile = this.mappings[filePath];
|
||||
if (!mapFile) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return fs.readFileSync(mapFile, 'utf8');
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this.mappings = [];
|
||||
rimraf.sync(path.dirname(this.basePath));
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
create(type = 'memory', opts = {}) {
|
||||
if (type.toLowerCase() === 'file') {
|
||||
return new FileStore(opts);
|
||||
}
|
||||
|
||||
return new MemoryStore(opts);
|
||||
}
|
||||
};
|
20
node_modules/istanbul-lib-source-maps/lib/transform-utils.js
generated
vendored
Normal file
20
node_modules/istanbul-lib-source-maps/lib/transform-utils.js
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
Copyright 2015, Yahoo Inc.
|
||||
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
function getUniqueKey(pathname) {
|
||||
return pathname.replace(/[\\/]/g, '_');
|
||||
}
|
||||
|
||||
function getOutput(cache) {
|
||||
return Object.keys(cache).reduce((output, key) => {
|
||||
const item = cache[key];
|
||||
return Object.assign(output, {
|
||||
[item.file]: item.mappedCoverage
|
||||
});
|
||||
}, {});
|
||||
}
|
||||
|
||||
module.exports = { getUniqueKey, getOutput };
|
134
node_modules/istanbul-lib-source-maps/lib/transformer.js
generated
vendored
Normal file
134
node_modules/istanbul-lib-source-maps/lib/transformer.js
generated
vendored
Normal file
|
@ -0,0 +1,134 @@
|
|||
/*
|
||||
Copyright 2015, Yahoo Inc.
|
||||
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const debug = require('debug')('istanbuljs');
|
||||
const libCoverage = require('istanbul-lib-coverage');
|
||||
const { MappedCoverage } = require('./mapped');
|
||||
const getMapping = require('./get-mapping');
|
||||
const { getUniqueKey, getOutput } = require('./transform-utils');
|
||||
|
||||
class SourceMapTransformer {
|
||||
constructor(finder, opts = {}) {
|
||||
this.finder = finder;
|
||||
this.baseDir = opts.baseDir || process.cwd();
|
||||
}
|
||||
|
||||
processFile(fc, sourceMap, coverageMapper) {
|
||||
let changes = 0;
|
||||
|
||||
Object.keys(fc.statementMap).forEach(s => {
|
||||
const loc = fc.statementMap[s];
|
||||
const hits = fc.s[s];
|
||||
const mapping = getMapping(sourceMap, loc, fc.path);
|
||||
|
||||
if (mapping) {
|
||||
changes += 1;
|
||||
const mappedCoverage = coverageMapper(mapping.source);
|
||||
mappedCoverage.addStatement(mapping.loc, hits);
|
||||
}
|
||||
});
|
||||
|
||||
Object.keys(fc.fnMap).forEach(f => {
|
||||
const fnMeta = fc.fnMap[f];
|
||||
const hits = fc.f[f];
|
||||
const mapping = getMapping(sourceMap, fnMeta.decl, fc.path);
|
||||
const spanMapping = getMapping(sourceMap, fnMeta.loc, fc.path);
|
||||
|
||||
if (
|
||||
mapping &&
|
||||
spanMapping &&
|
||||
mapping.source === spanMapping.source
|
||||
) {
|
||||
changes += 1;
|
||||
const mappedCoverage = coverageMapper(mapping.source);
|
||||
mappedCoverage.addFunction(
|
||||
fnMeta.name,
|
||||
mapping.loc,
|
||||
spanMapping.loc,
|
||||
hits
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Object.keys(fc.branchMap).forEach(b => {
|
||||
const branchMeta = fc.branchMap[b];
|
||||
const hits = fc.b[b];
|
||||
const locs = [];
|
||||
const mappedHits = [];
|
||||
let source;
|
||||
let skip;
|
||||
|
||||
branchMeta.locations.forEach((loc, i) => {
|
||||
const mapping = getMapping(sourceMap, loc, fc.path);
|
||||
if (mapping) {
|
||||
if (!source) {
|
||||
source = mapping.source;
|
||||
}
|
||||
|
||||
if (mapping.source !== source) {
|
||||
skip = true;
|
||||
}
|
||||
|
||||
locs.push(mapping.loc);
|
||||
mappedHits.push(hits[i]);
|
||||
}
|
||||
});
|
||||
|
||||
if (!skip && locs.length > 0) {
|
||||
changes += 1;
|
||||
const mappedCoverage = coverageMapper(source);
|
||||
mappedCoverage.addBranch(
|
||||
branchMeta.type,
|
||||
locs[0] /* XXX */,
|
||||
locs,
|
||||
mappedHits
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
return changes > 0;
|
||||
}
|
||||
|
||||
transform(coverageMap) {
|
||||
const uniqueFiles = {};
|
||||
const getMappedCoverage = file => {
|
||||
const key = getUniqueKey(file);
|
||||
if (!uniqueFiles[key]) {
|
||||
uniqueFiles[key] = {
|
||||
file,
|
||||
mappedCoverage: new MappedCoverage(file)
|
||||
};
|
||||
}
|
||||
|
||||
return uniqueFiles[key].mappedCoverage;
|
||||
};
|
||||
|
||||
coverageMap.files().forEach(file => {
|
||||
const fc = coverageMap.fileCoverageFor(file);
|
||||
const sourceMap = this.finder(file);
|
||||
if (!sourceMap) {
|
||||
uniqueFiles[getUniqueKey(file)] = {
|
||||
file,
|
||||
mappedCoverage: fc
|
||||
};
|
||||
return;
|
||||
}
|
||||
|
||||
const changed = this.processFile(fc, sourceMap, getMappedCoverage);
|
||||
if (!changed) {
|
||||
debug(`File [${file}] ignored, nothing could be mapped`);
|
||||
}
|
||||
});
|
||||
|
||||
return libCoverage.createCoverageMap(getOutput(uniqueFiles));
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
create(finder, opts) {
|
||||
return new SourceMapTransformer(finder, opts);
|
||||
}
|
||||
};
|
1
node_modules/istanbul-lib-source-maps/node_modules/.bin/rimraf
generated
vendored
Symbolic link
1
node_modules/istanbul-lib-source-maps/node_modules/.bin/rimraf
generated
vendored
Symbolic link
|
@ -0,0 +1 @@
|
|||
../rimraf/bin.js
|
1
node_modules/istanbul-lib-source-maps/node_modules/.bin/semver
generated
vendored
Symbolic link
1
node_modules/istanbul-lib-source-maps/node_modules/.bin/semver
generated
vendored
Symbolic link
|
@ -0,0 +1 @@
|
|||
../semver/bin/semver
|
122
node_modules/istanbul-lib-source-maps/node_modules/istanbul-lib-coverage/CHANGELOG.md
generated
vendored
Normal file
122
node_modules/istanbul-lib-source-maps/node_modules/istanbul-lib-coverage/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,122 @@
|
|||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [2.0.5](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-coverage@2.0.4...istanbul-lib-coverage@2.0.5) (2019-04-24)
|
||||
|
||||
**Note:** Version bump only for package istanbul-lib-coverage
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.0.4](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-coverage@2.0.3...istanbul-lib-coverage@2.0.4) (2019-03-12)
|
||||
|
||||
**Note:** Version bump only for package istanbul-lib-coverage
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.0.3](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-coverage@2.0.2...istanbul-lib-coverage@2.0.3) (2019-01-26)
|
||||
|
||||
**Note:** Version bump only for package istanbul-lib-coverage
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="2.0.2"></a>
|
||||
## [2.0.2](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-coverage@2.0.1...istanbul-lib-coverage@2.0.2) (2018-12-25)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package istanbul-lib-coverage
|
||||
|
||||
<a name="2.0.1"></a>
|
||||
## [2.0.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-coverage@2.0.0...istanbul-lib-coverage@2.0.1) (2018-07-07)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package istanbul-lib-coverage
|
||||
|
||||
<a name="2.0.0"></a>
|
||||
# [2.0.0](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-coverage@1.2.0...istanbul-lib-coverage@2.0.0) (2018-06-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* use null prototype for map objects ([#177](https://github.com/istanbuljs/istanbuljs/issues/177)) ([9a5a30c](https://github.com/istanbuljs/istanbuljs/commit/9a5a30c))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* a null prototype is now used in several places rather than the default `{}` assignment.
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="1.2.0"></a>
|
||||
# [1.2.0](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-coverage@1.1.2...istanbul-lib-coverage@1.2.0) (2018-03-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add skip-empty option for html & text reports ([#140](https://github.com/istanbuljs/istanbuljs/issues/140)) ([d2a4262](https://github.com/istanbuljs/istanbuljs/commit/d2a4262))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="1.1.2"></a>
|
||||
## [1.1.2](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-coverage@1.1.1...istanbul-lib-coverage@1.1.2) (2018-02-13)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package istanbul-lib-coverage
|
||||
|
||||
<a name="1.1.1"></a>
|
||||
## [1.1.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-lib-coverage@1.1.0...istanbul-lib-coverage@1.1.1) (2017-05-27)
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="1.1.0"></a>
|
||||
# [1.1.0](https://github.com/istanbuljs/istanbul-lib-coverage/compare/istanbul-lib-coverage@1.0.2...istanbul-lib-coverage@1.1.0) (2017-04-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* getBranchCoverageByLine() was looking for line coverage using wrong object structure ([bf36658](https://github.com/istanbuljs/istanbul-lib-coverage/commit/bf36658))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add possibility to filter coverage maps when running reports post-hoc ([#24](https://github.com/istanbuljs/istanbuljs/issues/24)) ([e1c99d6](https://github.com/istanbuljs/istanbul-lib-coverage/commit/e1c99d6))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="1.0.2"></a>
|
||||
## [1.0.2](https://github.com/istanbuljs/istanbul-lib-coverage/compare/istanbul-lib-coverage@1.0.1...istanbul-lib-coverage@1.0.2) (2017-03-27)
|
||||
|
||||
<a name="1.0.1"></a>
|
||||
## [1.0.1](https://github.com/istanbuljs/istanbul-lib-coverage/compare/v1.0.0...v1.0.1) (2017-01-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* handle edge-case surrounding merging two file coverage reports ([22e154c](https://github.com/istanbuljs/istanbul-lib-coverage/commit/22e154c))
|
||||
|
||||
|
||||
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://github.com/istanbuljs/istanbul-lib-coverage/compare/v1.0.0-alpha.3...v1.0.0) (2016-08-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* guard against missing statement ([76aad99](https://github.com/istanbuljs/istanbul-lib-coverage/commit/76aad99))
|
24
node_modules/istanbul-lib-source-maps/node_modules/istanbul-lib-coverage/LICENSE
generated
vendored
Normal file
24
node_modules/istanbul-lib-source-maps/node_modules/istanbul-lib-coverage/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
Copyright 2012-2015 Yahoo! Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the Yahoo! Inc. nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
node_modules/istanbul-lib-source-maps/node_modules/istanbul-lib-coverage/README.md
generated
vendored
Normal file
29
node_modules/istanbul-lib-source-maps/node_modules/istanbul-lib-coverage/README.md
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
## istanbul-lib-coverage
|
||||
|
||||
[](https://greenkeeper.io/)
|
||||
[](https://travis-ci.org/istanbuljs/istanbul-lib-coverage)
|
||||
|
||||
An API that provides a read-only view of coverage information with the ability
|
||||
to merge and summarize coverage info.
|
||||
|
||||
Supersedes `object-utils` and `collector` from the v0 istanbul API.
|
||||
|
||||
See the docs for the full API.
|
||||
|
||||
```js
|
||||
var libCoverage = require('istanbul-lib-coverage');
|
||||
var map = libCoverage.createCoverageMap(globalCoverageVar);
|
||||
var summary = libCoverage.createCoverageSummary();
|
||||
|
||||
// merge another coverage map into the one we created
|
||||
map.merge(otherCoverageMap);
|
||||
|
||||
// inspect and summarize all file coverage objects in the map
|
||||
map.files().forEach(function(f) {
|
||||
var fc = map.fileCoverageFor(f),
|
||||
s = fc.toSummary();
|
||||
summary.merge(s);
|
||||
});
|
||||
|
||||
console.log('Global summary', summary);
|
||||
```
|
64
node_modules/istanbul-lib-source-maps/node_modules/istanbul-lib-coverage/index.js
generated
vendored
Normal file
64
node_modules/istanbul-lib-source-maps/node_modules/istanbul-lib-coverage/index.js
generated
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
Copyright 2012-2015, Yahoo Inc.
|
||||
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* istanbul-lib-coverage exports an API that allows you to create and manipulate
|
||||
* file coverage, coverage maps (a set of file coverage objects) and summary
|
||||
* coverage objects. File coverage for the same file can be merged as can
|
||||
* entire coverage maps.
|
||||
*
|
||||
* @module Exports
|
||||
*/
|
||||
const CoverageSummary = require('./lib/file').CoverageSummary;
|
||||
const FileCoverage = require('./lib/file').FileCoverage;
|
||||
const CoverageMap = require('./lib/coverage-map').CoverageMap;
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* creates a coverage summary object
|
||||
* @param {Object} obj an argument with the same semantics
|
||||
* as the one passed to the `CoverageSummary` constructor
|
||||
* @returns {CoverageSummary}
|
||||
*/
|
||||
createCoverageSummary(obj) {
|
||||
if (obj && obj instanceof CoverageSummary) {
|
||||
return obj;
|
||||
}
|
||||
return new CoverageSummary(obj);
|
||||
},
|
||||
/**
|
||||
* creates a CoverageMap object
|
||||
* @param {Object} obj optional - an argument with the same semantics
|
||||
* as the one passed to the CoverageMap constructor.
|
||||
* @returns {CoverageMap}
|
||||
*/
|
||||
createCoverageMap(obj) {
|
||||
if (obj && obj instanceof CoverageMap) {
|
||||
return obj;
|
||||
}
|
||||
return new CoverageMap(obj);
|
||||
},
|
||||
/**
|
||||
* creates a FileCoverage object
|
||||
* @param {Object} obj optional - an argument with the same semantics
|
||||
* as the one passed to the FileCoverage constructor.
|
||||
* @returns {FileCoverage}
|
||||
*/
|
||||
createFileCoverage(obj) {
|
||||
if (obj && obj instanceof FileCoverage) {
|
||||
return obj;
|
||||
}
|
||||
return new FileCoverage(obj);
|
||||
}
|
||||
};
|
||||
|
||||
/** classes exported for reuse */
|
||||
module.exports.classes = {
|
||||
/**
|
||||
* the file coverage constructor
|
||||
*/
|
||||
FileCoverage
|
||||
};
|
127
node_modules/istanbul-lib-source-maps/node_modules/istanbul-lib-coverage/lib/coverage-map.js
generated
vendored
Normal file
127
node_modules/istanbul-lib-source-maps/node_modules/istanbul-lib-coverage/lib/coverage-map.js
generated
vendored
Normal file
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
Copyright 2012-2015, Yahoo Inc.
|
||||
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const FileCoverage = require('./file').FileCoverage;
|
||||
const CoverageSummary = require('./file').CoverageSummary;
|
||||
|
||||
function loadMap(source) {
|
||||
const data = Object.create(null);
|
||||
Object.keys(source).forEach(k => {
|
||||
const cov = source[k];
|
||||
if (cov instanceof FileCoverage) {
|
||||
data[k] = cov;
|
||||
} else {
|
||||
data[k] = new FileCoverage(cov);
|
||||
}
|
||||
});
|
||||
return data;
|
||||
}
|
||||
/**
|
||||
* CoverageMap is a map of `FileCoverage` objects keyed by file paths.
|
||||
* @param {Object} [obj=undefined] obj A coverage map from which to initialize this
|
||||
* map's contents. This can be the raw global coverage object.
|
||||
* @constructor
|
||||
*/
|
||||
function CoverageMap(obj) {
|
||||
if (!obj) {
|
||||
this.data = Object.create(null);
|
||||
} else if (obj instanceof CoverageMap) {
|
||||
this.data = obj.data;
|
||||
} else {
|
||||
this.data = loadMap(obj);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* merges a second coverage map into this one
|
||||
* @param {CoverageMap} obj - a CoverageMap or its raw data. Coverage is merged
|
||||
* correctly for the same files and additional file coverage keys are created
|
||||
* as needed.
|
||||
*/
|
||||
CoverageMap.prototype.merge = function(obj) {
|
||||
let other;
|
||||
if (obj instanceof CoverageMap) {
|
||||
other = obj;
|
||||
} else {
|
||||
other = new CoverageMap(obj);
|
||||
}
|
||||
Object.keys(other.data).forEach(k => {
|
||||
const fc = other.data[k];
|
||||
if (this.data[k]) {
|
||||
this.data[k].merge(fc);
|
||||
} else {
|
||||
this.data[k] = fc;
|
||||
}
|
||||
});
|
||||
};
|
||||
/**
|
||||
* filter the coveragemap based on the callback provided
|
||||
* @param {Function (filename)} callback - Returns true if the path
|
||||
* should be included in the coveragemap. False if it should be
|
||||
* removed.
|
||||
*/
|
||||
CoverageMap.prototype.filter = function(callback) {
|
||||
Object.keys(this.data).forEach(k => {
|
||||
if (!callback(k)) {
|
||||
delete this.data[k];
|
||||
}
|
||||
});
|
||||
};
|
||||
/**
|
||||
* returns a JSON-serializable POJO for this coverage map
|
||||
* @returns {Object}
|
||||
*/
|
||||
CoverageMap.prototype.toJSON = function() {
|
||||
return this.data;
|
||||
};
|
||||
/**
|
||||
* returns an array for file paths for which this map has coverage
|
||||
* @returns {Array{string}} - array of files
|
||||
*/
|
||||
CoverageMap.prototype.files = function() {
|
||||
return Object.keys(this.data);
|
||||
};
|
||||
/**
|
||||
* returns the file coverage for the specified file.
|
||||
* @param {String} file
|
||||
* @returns {FileCoverage}
|
||||
*/
|
||||
CoverageMap.prototype.fileCoverageFor = function(file) {
|
||||
const fc = this.data[file];
|
||||
if (!fc) {
|
||||
throw new Error('No file coverage available for: ' + file);
|
||||
}
|
||||
return fc;
|
||||
};
|
||||
/**
|
||||
* adds a file coverage object to this map. If the path for the object,
|
||||
* already exists in the map, it is merged with the existing coverage
|
||||
* otherwise a new key is added to the map.
|
||||
* @param {FileCoverage} fc the file coverage to add
|
||||
*/
|
||||
CoverageMap.prototype.addFileCoverage = function(fc) {
|
||||
const cov = new FileCoverage(fc);
|
||||
const path = cov.path;
|
||||
if (this.data[path]) {
|
||||
this.data[path].merge(cov);
|
||||
} else {
|
||||
this.data[path] = cov;
|
||||
}
|
||||
};
|
||||
/**
|
||||
* returns the coverage summary for all the file coverage objects in this map.
|
||||
* @returns {CoverageSummary}
|
||||
*/
|
||||
CoverageMap.prototype.getCoverageSummary = function() {
|
||||
const ret = new CoverageSummary();
|
||||
this.files().forEach(key => {
|
||||
ret.merge(this.fileCoverageFor(key).toSummary());
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
CoverageMap
|
||||
};
|
348
node_modules/istanbul-lib-source-maps/node_modules/istanbul-lib-coverage/lib/file.js
generated
vendored
Normal file
348
node_modules/istanbul-lib-source-maps/node_modules/istanbul-lib-coverage/lib/file.js
generated
vendored
Normal file
|
@ -0,0 +1,348 @@
|
|||
/*
|
||||
Copyright 2012-2015, Yahoo Inc.
|
||||
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
function percent(covered, total) {
|
||||
let tmp;
|
||||
if (total > 0) {
|
||||
tmp = (1000 * 100 * covered) / total + 5;
|
||||
return Math.floor(tmp / 10) / 100;
|
||||
} else {
|
||||
return 100.0;
|
||||
}
|
||||
}
|
||||
|
||||
function blankSummary() {
|
||||
const empty = function() {
|
||||
return {
|
||||
total: 0,
|
||||
covered: 0,
|
||||
skipped: 0,
|
||||
pct: 'Unknown'
|
||||
};
|
||||
};
|
||||
return {
|
||||
lines: empty(),
|
||||
statements: empty(),
|
||||
functions: empty(),
|
||||
branches: empty()
|
||||
};
|
||||
}
|
||||
|
||||
// asserts that a data object "looks like" a summary coverage object
|
||||
function assertValidSummary(obj) {
|
||||
const valid =
|
||||
obj && obj.lines && obj.statements && obj.functions && obj.branches;
|
||||
if (!valid) {
|
||||
throw new Error(
|
||||
'Invalid summary coverage object, missing keys, found:' +
|
||||
Object.keys(obj).join(',')
|
||||
);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* CoverageSummary provides a summary of code coverage . It exposes 4 properties,
|
||||
* `lines`, `statements`, `branches`, and `functions`. Each of these properties
|
||||
* is an object that has 4 keys `total`, `covered`, `skipped` and `pct`.
|
||||
* `pct` is a percentage number (0-100).
|
||||
* @param {Object|CoverageSummary} [obj=undefined] an optional data object or
|
||||
* another coverage summary to initialize this object with.
|
||||
* @constructor
|
||||
*/
|
||||
function CoverageSummary(obj) {
|
||||
if (!obj) {
|
||||
this.data = blankSummary();
|
||||
} else if (obj instanceof CoverageSummary) {
|
||||
this.data = obj.data;
|
||||
} else {
|
||||
this.data = obj;
|
||||
}
|
||||
assertValidSummary(this.data);
|
||||
}
|
||||
|
||||
['lines', 'statements', 'functions', 'branches'].forEach(p => {
|
||||
Object.defineProperty(CoverageSummary.prototype, p, {
|
||||
enumerable: true,
|
||||
get() {
|
||||
return this.data[p];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* merges a second summary coverage object into this one
|
||||
* @param {CoverageSummary} obj - another coverage summary object
|
||||
*/
|
||||
CoverageSummary.prototype.merge = function(obj) {
|
||||
const keys = ['lines', 'statements', 'branches', 'functions'];
|
||||
keys.forEach(key => {
|
||||
this[key].total += obj[key].total;
|
||||
this[key].covered += obj[key].covered;
|
||||
this[key].skipped += obj[key].skipped;
|
||||
this[key].pct = percent(this[key].covered, this[key].total);
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* returns a POJO that is JSON serializable. May be used to get the raw
|
||||
* summary object.
|
||||
*/
|
||||
CoverageSummary.prototype.toJSON = function() {
|
||||
return this.data;
|
||||
};
|
||||
|
||||
/**
|
||||
* return true if summary has no lines of code
|
||||
*/
|
||||
CoverageSummary.prototype.isEmpty = function() {
|
||||
return this.lines.total === 0;
|
||||
};
|
||||
|
||||
// returns a data object that represents empty coverage
|
||||
function emptyCoverage(filePath) {
|
||||
return {
|
||||
path: filePath,
|
||||
statementMap: {},
|
||||
fnMap: {},
|
||||
branchMap: {},
|
||||
s: {},
|
||||
f: {},
|
||||
b: {}
|
||||
};
|
||||
}
|
||||
// asserts that a data object "looks like" a coverage object
|
||||
function assertValidObject(obj) {
|
||||
const valid =
|
||||
obj &&
|
||||
obj.path &&
|
||||
obj.statementMap &&
|
||||
obj.fnMap &&
|
||||
obj.branchMap &&
|
||||
obj.s &&
|
||||
obj.f &&
|
||||
obj.b;
|
||||
if (!valid) {
|
||||
throw new Error(
|
||||
'Invalid file coverage object, missing keys, found:' +
|
||||
Object.keys(obj).join(',')
|
||||
);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* provides a read-only view of coverage for a single file.
|
||||
* The deep structure of this object is documented elsewhere. It has the following
|
||||
* properties:
|
||||
*
|
||||
* * `path` - the file path for which coverage is being tracked
|
||||
* * `statementMap` - map of statement locations keyed by statement index
|
||||
* * `fnMap` - map of function metadata keyed by function index
|
||||
* * `branchMap` - map of branch metadata keyed by branch index
|
||||
* * `s` - hit counts for statements
|
||||
* * `f` - hit count for functions
|
||||
* * `b` - hit count for branches
|
||||
*
|
||||
* @param {Object|FileCoverage|String} pathOrObj is a string that initializes
|
||||
* and empty coverage object with the specified file path or a data object that
|
||||
* has all the required properties for a file coverage object.
|
||||
* @constructor
|
||||
*/
|
||||
function FileCoverage(pathOrObj) {
|
||||
if (!pathOrObj) {
|
||||
throw new Error(
|
||||
'Coverage must be initialized with a path or an object'
|
||||
);
|
||||
}
|
||||
if (typeof pathOrObj === 'string') {
|
||||
this.data = emptyCoverage(pathOrObj);
|
||||
} else if (pathOrObj instanceof FileCoverage) {
|
||||
this.data = pathOrObj.data;
|
||||
} else if (typeof pathOrObj === 'object') {
|
||||
this.data = pathOrObj;
|
||||
} else {
|
||||
throw new Error('Invalid argument to coverage constructor');
|
||||
}
|
||||
assertValidObject(this.data);
|
||||
}
|
||||
/**
|
||||
* returns computed line coverage from statement coverage.
|
||||
* This is a map of hits keyed by line number in the source.
|
||||
*/
|
||||
FileCoverage.prototype.getLineCoverage = function() {
|
||||
const statementMap = this.data.statementMap;
|
||||
const statements = this.data.s;
|
||||
const lineMap = Object.create(null);
|
||||
|
||||
Object.keys(statements).forEach(st => {
|
||||
if (!statementMap[st]) {
|
||||
return;
|
||||
}
|
||||
const line = statementMap[st].start.line;
|
||||
const count = statements[st];
|
||||
const prevVal = lineMap[line];
|
||||
if (prevVal === undefined || prevVal < count) {
|
||||
lineMap[line] = count;
|
||||
}
|
||||
});
|
||||
return lineMap;
|
||||
};
|
||||
/**
|
||||
* returns an array of uncovered line numbers.
|
||||
* @returns {Array} an array of line numbers for which no hits have been
|
||||
* collected.
|
||||
*/
|
||||
FileCoverage.prototype.getUncoveredLines = function() {
|
||||
const lc = this.getLineCoverage();
|
||||
const ret = [];
|
||||
Object.keys(lc).forEach(l => {
|
||||
const hits = lc[l];
|
||||
if (hits === 0) {
|
||||
ret.push(l);
|
||||
}
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
/**
|
||||
* returns a map of branch coverage by source line number.
|
||||
* @returns {Object} an object keyed by line number. Each object
|
||||
* has a `covered`, `total` and `coverage` (percentage) property.
|
||||
*/
|
||||
FileCoverage.prototype.getBranchCoverageByLine = function() {
|
||||
const branchMap = this.branchMap;
|
||||
const branches = this.b;
|
||||
const ret = {};
|
||||
Object.keys(branchMap).forEach(k => {
|
||||
const line = branchMap[k].line || branchMap[k].loc.start.line;
|
||||
const branchData = branches[k];
|
||||
ret[line] = ret[line] || [];
|
||||
ret[line].push(...branchData);
|
||||
});
|
||||
Object.keys(ret).forEach(k => {
|
||||
const dataArray = ret[k];
|
||||
const covered = dataArray.filter(item => item > 0);
|
||||
const coverage = (covered.length / dataArray.length) * 100;
|
||||
ret[k] = {
|
||||
covered: covered.length,
|
||||
total: dataArray.length,
|
||||
coverage
|
||||
};
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
|
||||
// expose coverage data attributes
|
||||
['path', 'statementMap', 'fnMap', 'branchMap', 's', 'f', 'b'].forEach(p => {
|
||||
Object.defineProperty(FileCoverage.prototype, p, {
|
||||
enumerable: true,
|
||||
get() {
|
||||
return this.data[p];
|
||||
}
|
||||
});
|
||||
});
|
||||
/**
|
||||
* return a JSON-serializable POJO for this file coverage object
|
||||
*/
|
||||
FileCoverage.prototype.toJSON = function() {
|
||||
return this.data;
|
||||
};
|
||||
/**
|
||||
* merges a second coverage object into this one, updating hit counts
|
||||
* @param {FileCoverage} other - the coverage object to be merged into this one.
|
||||
* Note that the other object should have the same structure as this one (same file).
|
||||
*/
|
||||
FileCoverage.prototype.merge = function(other) {
|
||||
Object.keys(other.s).forEach(k => {
|
||||
this.data.s[k] += other.s[k];
|
||||
});
|
||||
Object.keys(other.f).forEach(k => {
|
||||
this.data.f[k] += other.f[k];
|
||||
});
|
||||
Object.keys(other.b).forEach(k => {
|
||||
let i;
|
||||
const retArray = this.data.b[k];
|
||||
const secondArray = other.b[k];
|
||||
if (!retArray) {
|
||||
this.data.b[k] = secondArray;
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < retArray.length; i += 1) {
|
||||
retArray[i] += secondArray[i];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
FileCoverage.prototype.computeSimpleTotals = function(property) {
|
||||
let stats = this[property];
|
||||
const ret = { total: 0, covered: 0, skipped: 0 };
|
||||
|
||||
if (typeof stats === 'function') {
|
||||
stats = stats.call(this);
|
||||
}
|
||||
Object.keys(stats).forEach(key => {
|
||||
const covered = !!stats[key];
|
||||
ret.total += 1;
|
||||
if (covered) {
|
||||
ret.covered += 1;
|
||||
}
|
||||
});
|
||||
ret.pct = percent(ret.covered, ret.total);
|
||||
return ret;
|
||||
};
|
||||
|
||||
FileCoverage.prototype.computeBranchTotals = function() {
|
||||
const stats = this.b;
|
||||
const ret = { total: 0, covered: 0, skipped: 0 };
|
||||
|
||||
Object.keys(stats).forEach(key => {
|
||||
const branches = stats[key];
|
||||
let covered;
|
||||
branches.forEach(branchHits => {
|
||||
covered = branchHits > 0;
|
||||
if (covered) {
|
||||
ret.covered += 1;
|
||||
}
|
||||
});
|
||||
ret.total += branches.length;
|
||||
});
|
||||
ret.pct = percent(ret.covered, ret.total);
|
||||
return ret;
|
||||
};
|
||||
/**
|
||||
* resets hit counts for all statements, functions and branches
|
||||
* in this coverage object resulting in zero coverage.
|
||||
*/
|
||||
FileCoverage.prototype.resetHits = function() {
|
||||
const statements = this.s;
|
||||
const functions = this.f;
|
||||
const branches = this.b;
|
||||
Object.keys(statements).forEach(s => {
|
||||
statements[s] = 0;
|
||||
});
|
||||
Object.keys(functions).forEach(f => {
|
||||
functions[f] = 0;
|
||||
});
|
||||
Object.keys(branches).forEach(b => {
|
||||
const hits = branches[b];
|
||||
branches[b] = hits.map(() => 0);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* returns a CoverageSummary for this file coverage object
|
||||
* @returns {CoverageSummary}
|
||||
*/
|
||||
FileCoverage.prototype.toSummary = function() {
|
||||
const ret = {};
|
||||
ret.lines = this.computeSimpleTotals('getLineCoverage');
|
||||
ret.functions = this.computeSimpleTotals('f', 'fnMap');
|
||||
ret.statements = this.computeSimpleTotals('s', 'statementMap');
|
||||
ret.branches = this.computeBranchTotals();
|
||||
return new CoverageSummary(ret);
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
CoverageSummary,
|
||||
FileCoverage
|
||||
};
|
42
node_modules/istanbul-lib-source-maps/node_modules/istanbul-lib-coverage/package.json
generated
vendored
Normal file
42
node_modules/istanbul-lib-source-maps/node_modules/istanbul-lib-coverage/package.json
generated
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"name": "istanbul-lib-coverage",
|
||||
"version": "2.0.5",
|
||||
"description": "Data library for istanbul coverage objects",
|
||||
"author": "Krishnan Anantheswaran <kananthmail-github@yahoo.com>",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"lib",
|
||||
"index.js"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"karmaDeps": {
|
||||
"browserify-istanbul": "^0.2.1",
|
||||
"karma": "^0.13.10",
|
||||
"karma-browserify": "^4.2.1",
|
||||
"karma-chrome-launcher": "^0.2.0",
|
||||
"karma-coverage": "^0.4.2",
|
||||
"karma-mocha": "^0.2.0",
|
||||
"karma-phantomjs-launcher": "^0.2.0",
|
||||
"phantomjs": "^1.9.17"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@github.com:istanbuljs/istanbuljs.git"
|
||||
},
|
||||
"keywords": [
|
||||
"istanbul",
|
||||
"coverage",
|
||||
"data"
|
||||
],
|
||||
"license": "BSD-3-Clause",
|
||||
"bugs": {
|
||||
"url": "https://github.com/istanbuljs/istanbuljs/issues"
|
||||
},
|
||||
"homepage": "https://istanbul.js.org/",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"gitHead": "90e60cc47833bb780680f916488ca24f0be36ca2"
|
||||
}
|
39
node_modules/istanbul-lib-source-maps/node_modules/make-dir/index.d.ts
generated
vendored
Normal file
39
node_modules/istanbul-lib-source-maps/node_modules/make-dir/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
/// <reference types="node"/>
|
||||
import * as fs from 'fs';
|
||||
|
||||
export interface Options {
|
||||
/**
|
||||
* Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/).
|
||||
*
|
||||
* @default 0o777 & (~process.umask())
|
||||
*/
|
||||
readonly mode?: number;
|
||||
|
||||
/**
|
||||
* Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs).
|
||||
*
|
||||
* Using a custom `fs` implementation will block the use of the native `recursive` option if `fs.mkdir` or `fs.mkdirSync` is not the native function.
|
||||
*
|
||||
* @default require('fs')
|
||||
*/
|
||||
readonly fs?: typeof fs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a directory and its parents if needed - Think `mkdir -p`.
|
||||
*
|
||||
* @param path - Directory to create.
|
||||
* @returns A `Promise` for the path to the created directory.
|
||||
*/
|
||||
export default function makeDir(
|
||||
path: string,
|
||||
options?: Options
|
||||
): Promise<string>;
|
||||
|
||||
/**
|
||||
* Synchronously make a directory and its parents if needed - Think `mkdir -p`.
|
||||
*
|
||||
* @param path - Directory to create.
|
||||
* @returns The path to the created directory.
|
||||
*/
|
||||
export function sync(path: string, options?: Options): string;
|
139
node_modules/istanbul-lib-source-maps/node_modules/make-dir/index.js
generated
vendored
Normal file
139
node_modules/istanbul-lib-source-maps/node_modules/make-dir/index.js
generated
vendored
Normal file
|
@ -0,0 +1,139 @@
|
|||
'use strict';
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const pify = require('pify');
|
||||
const semver = require('semver');
|
||||
|
||||
const defaults = {
|
||||
mode: 0o777 & (~process.umask()),
|
||||
fs
|
||||
};
|
||||
|
||||
const useNativeRecursiveOption = semver.satisfies(process.version, '>=10.12.0');
|
||||
|
||||
// https://github.com/nodejs/node/issues/8987
|
||||
// https://github.com/libuv/libuv/pull/1088
|
||||
const checkPath = pth => {
|
||||
if (process.platform === 'win32') {
|
||||
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ''));
|
||||
|
||||
if (pathHasInvalidWinCharacters) {
|
||||
const error = new Error(`Path contains invalid characters: ${pth}`);
|
||||
error.code = 'EINVAL';
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const permissionError = pth => {
|
||||
// This replicates the exception of `fs.mkdir` with native the
|
||||
// `recusive` option when run on an invalid drive under Windows.
|
||||
const error = new Error(`operation not permitted, mkdir '${pth}'`);
|
||||
error.code = 'EPERM';
|
||||
error.errno = -4048;
|
||||
error.path = pth;
|
||||
error.syscall = 'mkdir';
|
||||
return error;
|
||||
};
|
||||
|
||||
const makeDir = (input, options) => Promise.resolve().then(() => {
|
||||
checkPath(input);
|
||||
options = Object.assign({}, defaults, options);
|
||||
|
||||
// TODO: Use util.promisify when targeting Node.js 8
|
||||
const mkdir = pify(options.fs.mkdir);
|
||||
const stat = pify(options.fs.stat);
|
||||
|
||||
if (useNativeRecursiveOption && options.fs.mkdir === fs.mkdir) {
|
||||
const pth = path.resolve(input);
|
||||
|
||||
return mkdir(pth, {
|
||||
mode: options.mode,
|
||||
recursive: true
|
||||
}).then(() => pth);
|
||||
}
|
||||
|
||||
const make = pth => {
|
||||
return mkdir(pth, options.mode)
|
||||
.then(() => pth)
|
||||
.catch(error => {
|
||||
if (error.code === 'EPERM') {
|
||||
throw error;
|
||||
}
|
||||
|
||||
if (error.code === 'ENOENT') {
|
||||
if (path.dirname(pth) === pth) {
|
||||
throw permissionError(pth);
|
||||
}
|
||||
|
||||
if (error.message.includes('null bytes')) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return make(path.dirname(pth)).then(() => make(pth));
|
||||
}
|
||||
|
||||
return stat(pth)
|
||||
.then(stats => stats.isDirectory() ? pth : Promise.reject())
|
||||
.catch(() => {
|
||||
throw error;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
return make(path.resolve(input));
|
||||
});
|
||||
|
||||
module.exports = makeDir;
|
||||
module.exports.default = makeDir;
|
||||
|
||||
module.exports.sync = (input, options) => {
|
||||
checkPath(input);
|
||||
options = Object.assign({}, defaults, options);
|
||||
|
||||
if (useNativeRecursiveOption && options.fs.mkdirSync === fs.mkdirSync) {
|
||||
const pth = path.resolve(input);
|
||||
|
||||
fs.mkdirSync(pth, {
|
||||
mode: options.mode,
|
||||
recursive: true
|
||||
});
|
||||
|
||||
return pth;
|
||||
}
|
||||
|
||||
const make = pth => {
|
||||
try {
|
||||
options.fs.mkdirSync(pth, options.mode);
|
||||
} catch (error) {
|
||||
if (error.code === 'EPERM') {
|
||||
throw error;
|
||||
}
|
||||
|
||||
if (error.code === 'ENOENT') {
|
||||
if (path.dirname(pth) === pth) {
|
||||
throw permissionError(pth);
|
||||
}
|
||||
|
||||
if (error.message.includes('null bytes')) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
make(path.dirname(pth));
|
||||
return make(pth);
|
||||
}
|
||||
|
||||
try {
|
||||
if (!options.fs.statSync(pth).isDirectory()) {
|
||||
throw new Error('The path is not a directory');
|
||||
}
|
||||
} catch (_) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
return pth;
|
||||
};
|
||||
|
||||
return make(path.resolve(input));
|
||||
};
|
9
node_modules/istanbul-lib-source-maps/node_modules/make-dir/license
generated
vendored
Normal file
9
node_modules/istanbul-lib-source-maps/node_modules/make-dir/license
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
59
node_modules/istanbul-lib-source-maps/node_modules/make-dir/package.json
generated
vendored
Normal file
59
node_modules/istanbul-lib-source-maps/node_modules/make-dir/package.json
generated
vendored
Normal file
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
"name": "make-dir",
|
||||
"version": "2.1.0",
|
||||
"description": "Make a directory and its parents if needed - Think `mkdir -p`",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/make-dir",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && nyc ava && tsd-check"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"mkdir",
|
||||
"mkdirp",
|
||||
"make",
|
||||
"directories",
|
||||
"dir",
|
||||
"dirs",
|
||||
"folders",
|
||||
"directory",
|
||||
"folder",
|
||||
"path",
|
||||
"parent",
|
||||
"parents",
|
||||
"intermediate",
|
||||
"recursively",
|
||||
"recursive",
|
||||
"create",
|
||||
"fs",
|
||||
"filesystem",
|
||||
"file-system"
|
||||
],
|
||||
"dependencies": {
|
||||
"pify": "^4.0.1",
|
||||
"semver": "^5.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/graceful-fs": "^4.1.3",
|
||||
"@types/node": "^11.10.4",
|
||||
"ava": "^1.2.0",
|
||||
"codecov": "^3.0.0",
|
||||
"graceful-fs": "^4.1.11",
|
||||
"nyc": "^13.1.0",
|
||||
"path-type": "^3.0.0",
|
||||
"tempy": "^0.2.1",
|
||||
"tsd-check": "^0.3.0",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
123
node_modules/istanbul-lib-source-maps/node_modules/make-dir/readme.md
generated
vendored
Normal file
123
node_modules/istanbul-lib-source-maps/node_modules/make-dir/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,123 @@
|
|||
# make-dir [](https://travis-ci.org/sindresorhus/make-dir) [](https://codecov.io/gh/sindresorhus/make-dir)
|
||||
|
||||
> Make a directory and its parents if needed - Think `mkdir -p`
|
||||
|
||||
|
||||
## Advantages over [`mkdirp`](https://github.com/substack/node-mkdirp)
|
||||
|
||||
- Promise API *(Async/await ready!)*
|
||||
- Fixes many `mkdirp` issues: [#96](https://github.com/substack/node-mkdirp/pull/96) [#70](https://github.com/substack/node-mkdirp/issues/70) [#66](https://github.com/substack/node-mkdirp/issues/66)
|
||||
- 100% test coverage
|
||||
- CI-tested on macOS, Linux, and Windows
|
||||
- Actively maintained
|
||||
- Doesn't bundle a CLI
|
||||
- Uses native the `fs.mkdir/mkdirSync` [`recursive` option](https://nodejs.org/dist/latest/docs/api/fs.html#fs_fs_mkdir_path_options_callback) in Node.js >=10.12.0 unless [overridden](#fs)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install make-dir
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
$ pwd
|
||||
/Users/sindresorhus/fun
|
||||
$ tree
|
||||
.
|
||||
```
|
||||
|
||||
```js
|
||||
const makeDir = require('make-dir');
|
||||
|
||||
(async () => {
|
||||
const path = await makeDir('unicorn/rainbow/cake');
|
||||
|
||||
console.log(path);
|
||||
//=> '/Users/sindresorhus/fun/unicorn/rainbow/cake'
|
||||
})();
|
||||
```
|
||||
|
||||
```
|
||||
$ tree
|
||||
.
|
||||
└── unicorn
|
||||
└── rainbow
|
||||
└── cake
|
||||
```
|
||||
|
||||
Multiple directories:
|
||||
|
||||
```js
|
||||
const makeDir = require('make-dir');
|
||||
|
||||
(async () => {
|
||||
const paths = await Promise.all([
|
||||
makeDir('unicorn/rainbow'),
|
||||
makeDir('foo/bar')
|
||||
]);
|
||||
|
||||
console.log(paths);
|
||||
/*
|
||||
[
|
||||
'/Users/sindresorhus/fun/unicorn/rainbow',
|
||||
'/Users/sindresorhus/fun/foo/bar'
|
||||
]
|
||||
*/
|
||||
})();
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### makeDir(path, [options])
|
||||
|
||||
Returns a `Promise` for the path to the created directory.
|
||||
|
||||
### makeDir.sync(path, [options])
|
||||
|
||||
Returns the path to the created directory.
|
||||
|
||||
#### path
|
||||
|
||||
Type: `string`
|
||||
|
||||
Directory to create.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `Object`
|
||||
|
||||
##### mode
|
||||
|
||||
Type: `integer`<br>
|
||||
Default: `0o777 & (~process.umask())`
|
||||
|
||||
Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/).
|
||||
|
||||
##### fs
|
||||
|
||||
Type: `Object`<br>
|
||||
Default: `require('fs')`
|
||||
|
||||
Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs).
|
||||
|
||||
Using a custom `fs` implementation will block the use of the native `recursive` option if `fs.mkdir` or `fs.mkdirSync` is not the native function.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [make-dir-cli](https://github.com/sindresorhus/make-dir-cli) - CLI for this module
|
||||
- [del](https://github.com/sindresorhus/del) - Delete files and directories
|
||||
- [globby](https://github.com/sindresorhus/globby) - User-friendly glob matching
|
||||
- [cpy](https://github.com/sindresorhus/cpy) - Copy files
|
||||
- [cpy-cli](https://github.com/sindresorhus/cpy-cli) - Copy files on the command-line
|
||||
- [move-file](https://github.com/sindresorhus/move-file) - Move a file
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
15
node_modules/istanbul-lib-source-maps/node_modules/rimraf/LICENSE
generated
vendored
Normal file
15
node_modules/istanbul-lib-source-maps/node_modules/rimraf/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
101
node_modules/istanbul-lib-source-maps/node_modules/rimraf/README.md
generated
vendored
Normal file
101
node_modules/istanbul-lib-source-maps/node_modules/rimraf/README.md
generated
vendored
Normal file
|
@ -0,0 +1,101 @@
|
|||
[](https://travis-ci.org/isaacs/rimraf) [](https://david-dm.org/isaacs/rimraf) [](https://david-dm.org/isaacs/rimraf#info=devDependencies)
|
||||
|
||||
The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node.
|
||||
|
||||
Install with `npm install rimraf`, or just drop rimraf.js somewhere.
|
||||
|
||||
## API
|
||||
|
||||
`rimraf(f, [opts], callback)`
|
||||
|
||||
The first parameter will be interpreted as a globbing pattern for files. If you
|
||||
want to disable globbing you can do so with `opts.disableGlob` (defaults to
|
||||
`false`). This might be handy, for instance, if you have filenames that contain
|
||||
globbing wildcard characters.
|
||||
|
||||
The callback will be called with an error if there is one. Certain
|
||||
errors are handled for you:
|
||||
|
||||
* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of
|
||||
`opts.maxBusyTries` times before giving up, adding 100ms of wait
|
||||
between each attempt. The default `maxBusyTries` is 3.
|
||||
* `ENOENT` - If the file doesn't exist, rimraf will return
|
||||
successfully, since your desired outcome is already the case.
|
||||
* `EMFILE` - Since `readdir` requires opening a file descriptor, it's
|
||||
possible to hit `EMFILE` if too many file descriptors are in use.
|
||||
In the sync case, there's nothing to be done for this. But in the
|
||||
async case, rimraf will gradually back off with timeouts up to
|
||||
`opts.emfileWait` ms, which defaults to 1000.
|
||||
|
||||
## options
|
||||
|
||||
* unlink, chmod, stat, lstat, rmdir, readdir,
|
||||
unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync
|
||||
|
||||
In order to use a custom file system library, you can override
|
||||
specific fs functions on the options object.
|
||||
|
||||
If any of these functions are present on the options object, then
|
||||
the supplied function will be used instead of the default fs
|
||||
method.
|
||||
|
||||
Sync methods are only relevant for `rimraf.sync()`, of course.
|
||||
|
||||
For example:
|
||||
|
||||
```javascript
|
||||
var myCustomFS = require('some-custom-fs')
|
||||
|
||||
rimraf('some-thing', myCustomFS, callback)
|
||||
```
|
||||
|
||||
* maxBusyTries
|
||||
|
||||
If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered
|
||||
on Windows systems, then rimraf will retry with a linear backoff
|
||||
wait of 100ms longer on each try. The default maxBusyTries is 3.
|
||||
|
||||
Only relevant for async usage.
|
||||
|
||||
* emfileWait
|
||||
|
||||
If an `EMFILE` error is encountered, then rimraf will retry
|
||||
repeatedly with a linear backoff of 1ms longer on each try, until
|
||||
the timeout counter hits this max. The default limit is 1000.
|
||||
|
||||
If you repeatedly encounter `EMFILE` errors, then consider using
|
||||
[graceful-fs](http://npm.im/graceful-fs) in your program.
|
||||
|
||||
Only relevant for async usage.
|
||||
|
||||
* glob
|
||||
|
||||
Set to `false` to disable [glob](http://npm.im/glob) pattern
|
||||
matching.
|
||||
|
||||
Set to an object to pass options to the glob module. The default
|
||||
glob options are `{ nosort: true, silent: true }`.
|
||||
|
||||
Glob version 6 is used in this module.
|
||||
|
||||
Relevant for both sync and async usage.
|
||||
|
||||
* disableGlob
|
||||
|
||||
Set to any non-falsey value to disable globbing entirely.
|
||||
(Equivalent to setting `glob: false`.)
|
||||
|
||||
## rimraf.sync
|
||||
|
||||
It can remove stuff synchronously, too. But that's not so good. Use
|
||||
the async API. It's better.
|
||||
|
||||
## CLI
|
||||
|
||||
If installed with `npm install rimraf -g` it can be used as a global
|
||||
command `rimraf <path> [<path> ...]` which is useful for cross platform support.
|
||||
|
||||
## mkdirp
|
||||
|
||||
If you need to create a directory recursively, check out
|
||||
[mkdirp](https://github.com/substack/node-mkdirp).
|
50
node_modules/istanbul-lib-source-maps/node_modules/rimraf/bin.js
generated
vendored
Executable file
50
node_modules/istanbul-lib-source-maps/node_modules/rimraf/bin.js
generated
vendored
Executable file
|
@ -0,0 +1,50 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
var rimraf = require('./')
|
||||
|
||||
var help = false
|
||||
var dashdash = false
|
||||
var noglob = false
|
||||
var args = process.argv.slice(2).filter(function(arg) {
|
||||
if (dashdash)
|
||||
return !!arg
|
||||
else if (arg === '--')
|
||||
dashdash = true
|
||||
else if (arg === '--no-glob' || arg === '-G')
|
||||
noglob = true
|
||||
else if (arg === '--glob' || arg === '-g')
|
||||
noglob = false
|
||||
else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/))
|
||||
help = true
|
||||
else
|
||||
return !!arg
|
||||
})
|
||||
|
||||
if (help || args.length === 0) {
|
||||
// If they didn't ask for help, then this is not a "success"
|
||||
var log = help ? console.log : console.error
|
||||
log('Usage: rimraf <path> [<path> ...]')
|
||||
log('')
|
||||
log(' Deletes all files and folders at "path" recursively.')
|
||||
log('')
|
||||
log('Options:')
|
||||
log('')
|
||||
log(' -h, --help Display this usage info')
|
||||
log(' -G, --no-glob Do not expand glob patterns in arguments')
|
||||
log(' -g, --glob Expand glob patterns in arguments (default)')
|
||||
process.exit(help ? 0 : 1)
|
||||
} else
|
||||
go(0)
|
||||
|
||||
function go (n) {
|
||||
if (n >= args.length)
|
||||
return
|
||||
var options = {}
|
||||
if (noglob)
|
||||
options = { glob: false }
|
||||
rimraf(args[n], options, function (er) {
|
||||
if (er)
|
||||
throw er
|
||||
go(n+1)
|
||||
})
|
||||
}
|
29
node_modules/istanbul-lib-source-maps/node_modules/rimraf/package.json
generated
vendored
Normal file
29
node_modules/istanbul-lib-source-maps/node_modules/rimraf/package.json
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"name": "rimraf",
|
||||
"version": "2.7.1",
|
||||
"main": "rimraf.js",
|
||||
"description": "A deep deletion module for node (like `rm -rf`)",
|
||||
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
||||
"license": "ISC",
|
||||
"repository": "git://github.com/isaacs/rimraf.git",
|
||||
"scripts": {
|
||||
"preversion": "npm test",
|
||||
"postversion": "npm publish",
|
||||
"postpublish": "git push origin --all; git push origin --tags",
|
||||
"test": "tap test/*.js"
|
||||
},
|
||||
"bin": "./bin.js",
|
||||
"dependencies": {
|
||||
"glob": "^7.1.3"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"bin.js",
|
||||
"rimraf.js"
|
||||
],
|
||||
"devDependencies": {
|
||||
"mkdirp": "^0.5.1",
|
||||
"tap": "^12.1.1"
|
||||
}
|
||||
}
|
372
node_modules/istanbul-lib-source-maps/node_modules/rimraf/rimraf.js
generated
vendored
Normal file
372
node_modules/istanbul-lib-source-maps/node_modules/rimraf/rimraf.js
generated
vendored
Normal file
|
@ -0,0 +1,372 @@
|
|||
module.exports = rimraf
|
||||
rimraf.sync = rimrafSync
|
||||
|
||||
var assert = require("assert")
|
||||
var path = require("path")
|
||||
var fs = require("fs")
|
||||
var glob = undefined
|
||||
try {
|
||||
glob = require("glob")
|
||||
} catch (_err) {
|
||||
// treat glob as optional.
|
||||
}
|
||||
var _0666 = parseInt('666', 8)
|
||||
|
||||
var defaultGlobOpts = {
|
||||
nosort: true,
|
||||
silent: true
|
||||
}
|
||||
|
||||
// for EMFILE handling
|
||||
var timeout = 0
|
||||
|
||||
var isWindows = (process.platform === "win32")
|
||||
|
||||
function defaults (options) {
|
||||
var methods = [
|
||||
'unlink',
|
||||
'chmod',
|
||||
'stat',
|
||||
'lstat',
|
||||
'rmdir',
|
||||
'readdir'
|
||||
]
|
||||
methods.forEach(function(m) {
|
||||
options[m] = options[m] || fs[m]
|
||||
m = m + 'Sync'
|
||||
options[m] = options[m] || fs[m]
|
||||
})
|
||||
|
||||
options.maxBusyTries = options.maxBusyTries || 3
|
||||
options.emfileWait = options.emfileWait || 1000
|
||||
if (options.glob === false) {
|
||||
options.disableGlob = true
|
||||
}
|
||||
if (options.disableGlob !== true && glob === undefined) {
|
||||
throw Error('glob dependency not found, set `options.disableGlob = true` if intentional')
|
||||
}
|
||||
options.disableGlob = options.disableGlob || false
|
||||
options.glob = options.glob || defaultGlobOpts
|
||||
}
|
||||
|
||||
function rimraf (p, options, cb) {
|
||||
if (typeof options === 'function') {
|
||||
cb = options
|
||||
options = {}
|
||||
}
|
||||
|
||||
assert(p, 'rimraf: missing path')
|
||||
assert.equal(typeof p, 'string', 'rimraf: path should be a string')
|
||||
assert.equal(typeof cb, 'function', 'rimraf: callback function required')
|
||||
assert(options, 'rimraf: invalid options argument provided')
|
||||
assert.equal(typeof options, 'object', 'rimraf: options should be object')
|
||||
|
||||
defaults(options)
|
||||
|
||||
var busyTries = 0
|
||||
var errState = null
|
||||
var n = 0
|
||||
|
||||
if (options.disableGlob || !glob.hasMagic(p))
|
||||
return afterGlob(null, [p])
|
||||
|
||||
options.lstat(p, function (er, stat) {
|
||||
if (!er)
|
||||
return afterGlob(null, [p])
|
||||
|
||||
glob(p, options.glob, afterGlob)
|
||||
})
|
||||
|
||||
function next (er) {
|
||||
errState = errState || er
|
||||
if (--n === 0)
|
||||
cb(errState)
|
||||
}
|
||||
|
||||
function afterGlob (er, results) {
|
||||
if (er)
|
||||
return cb(er)
|
||||
|
||||
n = results.length
|
||||
if (n === 0)
|
||||
return cb()
|
||||
|
||||
results.forEach(function (p) {
|
||||
rimraf_(p, options, function CB (er) {
|
||||
if (er) {
|
||||
if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") &&
|
||||
busyTries < options.maxBusyTries) {
|
||||
busyTries ++
|
||||
var time = busyTries * 100
|
||||
// try again, with the same exact callback as this one.
|
||||
return setTimeout(function () {
|
||||
rimraf_(p, options, CB)
|
||||
}, time)
|
||||
}
|
||||
|
||||
// this one won't happen if graceful-fs is used.
|
||||
if (er.code === "EMFILE" && timeout < options.emfileWait) {
|
||||
return setTimeout(function () {
|
||||
rimraf_(p, options, CB)
|
||||
}, timeout ++)
|
||||
}
|
||||
|
||||
// already gone
|
||||
if (er.code === "ENOENT") er = null
|
||||
}
|
||||
|
||||
timeout = 0
|
||||
next(er)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Two possible strategies.
|
||||
// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR
|
||||
// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR
|
||||
//
|
||||
// Both result in an extra syscall when you guess wrong. However, there
|
||||
// are likely far more normal files in the world than directories. This
|
||||
// is based on the assumption that a the average number of files per
|
||||
// directory is >= 1.
|
||||
//
|
||||
// If anyone ever complains about this, then I guess the strategy could
|
||||
// be made configurable somehow. But until then, YAGNI.
|
||||
function rimraf_ (p, options, cb) {
|
||||
assert(p)
|
||||
assert(options)
|
||||
assert(typeof cb === 'function')
|
||||
|
||||
// sunos lets the root user unlink directories, which is... weird.
|
||||
// so we have to lstat here and make sure it's not a dir.
|
||||
options.lstat(p, function (er, st) {
|
||||
if (er && er.code === "ENOENT")
|
||||
return cb(null)
|
||||
|
||||
// Windows can EPERM on stat. Life is suffering.
|
||||
if (er && er.code === "EPERM" && isWindows)
|
||||
fixWinEPERM(p, options, er, cb)
|
||||
|
||||
if (st && st.isDirectory())
|
||||
return rmdir(p, options, er, cb)
|
||||
|
||||
options.unlink(p, function (er) {
|
||||
if (er) {
|
||||
if (er.code === "ENOENT")
|
||||
return cb(null)
|
||||
if (er.code === "EPERM")
|
||||
return (isWindows)
|
||||
? fixWinEPERM(p, options, er, cb)
|
||||
: rmdir(p, options, er, cb)
|
||||
if (er.code === "EISDIR")
|
||||
return rmdir(p, options, er, cb)
|
||||
}
|
||||
return cb(er)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function fixWinEPERM (p, options, er, cb) {
|
||||
assert(p)
|
||||
assert(options)
|
||||
assert(typeof cb === 'function')
|
||||
if (er)
|
||||
assert(er instanceof Error)
|
||||
|
||||
options.chmod(p, _0666, function (er2) {
|
||||
if (er2)
|
||||
cb(er2.code === "ENOENT" ? null : er)
|
||||
else
|
||||
options.stat(p, function(er3, stats) {
|
||||
if (er3)
|
||||
cb(er3.code === "ENOENT" ? null : er)
|
||||
else if (stats.isDirectory())
|
||||
rmdir(p, options, er, cb)
|
||||
else
|
||||
options.unlink(p, cb)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function fixWinEPERMSync (p, options, er) {
|
||||
assert(p)
|
||||
assert(options)
|
||||
if (er)
|
||||
assert(er instanceof Error)
|
||||
|
||||
try {
|
||||
options.chmodSync(p, _0666)
|
||||
} catch (er2) {
|
||||
if (er2.code === "ENOENT")
|
||||
return
|
||||
else
|
||||
throw er
|
||||
}
|
||||
|
||||
try {
|
||||
var stats = options.statSync(p)
|
||||
} catch (er3) {
|
||||
if (er3.code === "ENOENT")
|
||||
return
|
||||
else
|
||||
throw er
|
||||
}
|
||||
|
||||
if (stats.isDirectory())
|
||||
rmdirSync(p, options, er)
|
||||
else
|
||||
options.unlinkSync(p)
|
||||
}
|
||||
|
||||
function rmdir (p, options, originalEr, cb) {
|
||||
assert(p)
|
||||
assert(options)
|
||||
if (originalEr)
|
||||
assert(originalEr instanceof Error)
|
||||
assert(typeof cb === 'function')
|
||||
|
||||
// try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
|
||||
// if we guessed wrong, and it's not a directory, then
|
||||
// raise the original error.
|
||||
options.rmdir(p, function (er) {
|
||||
if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
|
||||
rmkids(p, options, cb)
|
||||
else if (er && er.code === "ENOTDIR")
|
||||
cb(originalEr)
|
||||
else
|
||||
cb(er)
|
||||
})
|
||||
}
|
||||
|
||||
function rmkids(p, options, cb) {
|
||||
assert(p)
|
||||
assert(options)
|
||||
assert(typeof cb === 'function')
|
||||
|
||||
options.readdir(p, function (er, files) {
|
||||
if (er)
|
||||
return cb(er)
|
||||
var n = files.length
|
||||
if (n === 0)
|
||||
return options.rmdir(p, cb)
|
||||
var errState
|
||||
files.forEach(function (f) {
|
||||
rimraf(path.join(p, f), options, function (er) {
|
||||
if (errState)
|
||||
return
|
||||
if (er)
|
||||
return cb(errState = er)
|
||||
if (--n === 0)
|
||||
options.rmdir(p, cb)
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// this looks simpler, and is strictly *faster*, but will
|
||||
// tie up the JavaScript thread and fail on excessively
|
||||
// deep directory trees.
|
||||
function rimrafSync (p, options) {
|
||||
options = options || {}
|
||||
defaults(options)
|
||||
|
||||
assert(p, 'rimraf: missing path')
|
||||
assert.equal(typeof p, 'string', 'rimraf: path should be a string')
|
||||
assert(options, 'rimraf: missing options')
|
||||
assert.equal(typeof options, 'object', 'rimraf: options should be object')
|
||||
|
||||
var results
|
||||
|
||||
if (options.disableGlob || !glob.hasMagic(p)) {
|
||||
results = [p]
|
||||
} else {
|
||||
try {
|
||||
options.lstatSync(p)
|
||||
results = [p]
|
||||
} catch (er) {
|
||||
results = glob.sync(p, options.glob)
|
||||
}
|
||||
}
|
||||
|
||||
if (!results.length)
|
||||
return
|
||||
|
||||
for (var i = 0; i < results.length; i++) {
|
||||
var p = results[i]
|
||||
|
||||
try {
|
||||
var st = options.lstatSync(p)
|
||||
} catch (er) {
|
||||
if (er.code === "ENOENT")
|
||||
return
|
||||
|
||||
// Windows can EPERM on stat. Life is suffering.
|
||||
if (er.code === "EPERM" && isWindows)
|
||||
fixWinEPERMSync(p, options, er)
|
||||
}
|
||||
|
||||
try {
|
||||
// sunos lets the root user unlink directories, which is... weird.
|
||||
if (st && st.isDirectory())
|
||||
rmdirSync(p, options, null)
|
||||
else
|
||||
options.unlinkSync(p)
|
||||
} catch (er) {
|
||||
if (er.code === "ENOENT")
|
||||
return
|
||||
if (er.code === "EPERM")
|
||||
return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)
|
||||
if (er.code !== "EISDIR")
|
||||
throw er
|
||||
|
||||
rmdirSync(p, options, er)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function rmdirSync (p, options, originalEr) {
|
||||
assert(p)
|
||||
assert(options)
|
||||
if (originalEr)
|
||||
assert(originalEr instanceof Error)
|
||||
|
||||
try {
|
||||
options.rmdirSync(p)
|
||||
} catch (er) {
|
||||
if (er.code === "ENOENT")
|
||||
return
|
||||
if (er.code === "ENOTDIR")
|
||||
throw originalEr
|
||||
if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
|
||||
rmkidsSync(p, options)
|
||||
}
|
||||
}
|
||||
|
||||
function rmkidsSync (p, options) {
|
||||
assert(p)
|
||||
assert(options)
|
||||
options.readdirSync(p).forEach(function (f) {
|
||||
rimrafSync(path.join(p, f), options)
|
||||
})
|
||||
|
||||
// We only end up here once we got ENOTEMPTY at least once, and
|
||||
// at this point, we are guaranteed to have removed all the kids.
|
||||
// So, we know that it won't be ENOENT or ENOTDIR or anything else.
|
||||
// try really hard to delete stuff on windows, because it has a
|
||||
// PROFOUNDLY annoying habit of not closing handles promptly when
|
||||
// files are deleted, resulting in spurious ENOTEMPTY errors.
|
||||
var retries = isWindows ? 100 : 1
|
||||
var i = 0
|
||||
do {
|
||||
var threw = true
|
||||
try {
|
||||
var ret = options.rmdirSync(p, options)
|
||||
threw = false
|
||||
return ret
|
||||
} finally {
|
||||
if (++i < retries && threw)
|
||||
continue
|
||||
}
|
||||
} while (true)
|
||||
}
|
15
node_modules/istanbul-lib-source-maps/node_modules/semver/LICENSE
generated
vendored
Normal file
15
node_modules/istanbul-lib-source-maps/node_modules/semver/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
412
node_modules/istanbul-lib-source-maps/node_modules/semver/README.md
generated
vendored
Normal file
412
node_modules/istanbul-lib-source-maps/node_modules/semver/README.md
generated
vendored
Normal file
|
@ -0,0 +1,412 @@
|
|||
semver(1) -- The semantic versioner for npm
|
||||
===========================================
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
npm install --save semver
|
||||
````
|
||||
|
||||
## Usage
|
||||
|
||||
As a node module:
|
||||
|
||||
```js
|
||||
const semver = require('semver')
|
||||
|
||||
semver.valid('1.2.3') // '1.2.3'
|
||||
semver.valid('a.b.c') // null
|
||||
semver.clean(' =v1.2.3 ') // '1.2.3'
|
||||
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
|
||||
semver.gt('1.2.3', '9.8.7') // false
|
||||
semver.lt('1.2.3', '9.8.7') // true
|
||||
semver.minVersion('>=1.0.0') // '1.0.0'
|
||||
semver.valid(semver.coerce('v2')) // '2.0.0'
|
||||
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
|
||||
```
|
||||
|
||||
As a command-line utility:
|
||||
|
||||
```
|
||||
$ semver -h
|
||||
|
||||
A JavaScript implementation of the https://semver.org/ specification
|
||||
Copyright Isaac Z. Schlueter
|
||||
|
||||
Usage: semver [options] <version> [<version> [...]]
|
||||
Prints valid versions sorted by SemVer precedence
|
||||
|
||||
Options:
|
||||
-r --range <range>
|
||||
Print versions that match the specified range.
|
||||
|
||||
-i --increment [<level>]
|
||||
Increment a version by the specified level. Level can
|
||||
be one of: major, minor, patch, premajor, preminor,
|
||||
prepatch, or prerelease. Default level is 'patch'.
|
||||
Only one version may be specified.
|
||||
|
||||
--preid <identifier>
|
||||
Identifier to be used to prefix premajor, preminor,
|
||||
prepatch or prerelease version increments.
|
||||
|
||||
-l --loose
|
||||
Interpret versions and ranges loosely
|
||||
|
||||
-p --include-prerelease
|
||||
Always include prerelease versions in range matching
|
||||
|
||||
-c --coerce
|
||||
Coerce a string into SemVer if possible
|
||||
(does not imply --loose)
|
||||
|
||||
Program exits successfully if any valid version satisfies
|
||||
all supplied ranges, and prints all satisfying versions.
|
||||
|
||||
If no satisfying versions are found, then exits failure.
|
||||
|
||||
Versions are printed in ascending order, so supplying
|
||||
multiple versions to the utility will just sort them.
|
||||
```
|
||||
|
||||
## Versions
|
||||
|
||||
A "version" is described by the `v2.0.0` specification found at
|
||||
<https://semver.org/>.
|
||||
|
||||
A leading `"="` or `"v"` character is stripped off and ignored.
|
||||
|
||||
## Ranges
|
||||
|
||||
A `version range` is a set of `comparators` which specify versions
|
||||
that satisfy the range.
|
||||
|
||||
A `comparator` is composed of an `operator` and a `version`. The set
|
||||
of primitive `operators` is:
|
||||
|
||||
* `<` Less than
|
||||
* `<=` Less than or equal to
|
||||
* `>` Greater than
|
||||
* `>=` Greater than or equal to
|
||||
* `=` Equal. If no operator is specified, then equality is assumed,
|
||||
so this operator is optional, but MAY be included.
|
||||
|
||||
For example, the comparator `>=1.2.7` would match the versions
|
||||
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
|
||||
or `1.1.0`.
|
||||
|
||||
Comparators can be joined by whitespace to form a `comparator set`,
|
||||
which is satisfied by the **intersection** of all of the comparators
|
||||
it includes.
|
||||
|
||||
A range is composed of one or more comparator sets, joined by `||`. A
|
||||
version matches a range if and only if every comparator in at least
|
||||
one of the `||`-separated comparator sets is satisfied by the version.
|
||||
|
||||
For example, the range `>=1.2.7 <1.3.0` would match the versions
|
||||
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
|
||||
or `1.1.0`.
|
||||
|
||||
The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
|
||||
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
|
||||
|
||||
### Prerelease Tags
|
||||
|
||||
If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
|
||||
it will only be allowed to satisfy comparator sets if at least one
|
||||
comparator with the same `[major, minor, patch]` tuple also has a
|
||||
prerelease tag.
|
||||
|
||||
For example, the range `>1.2.3-alpha.3` would be allowed to match the
|
||||
version `1.2.3-alpha.7`, but it would *not* be satisfied by
|
||||
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
|
||||
than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
|
||||
range only accepts prerelease tags on the `1.2.3` version. The
|
||||
version `3.4.5` *would* satisfy the range, because it does not have a
|
||||
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
|
||||
|
||||
The purpose for this behavior is twofold. First, prerelease versions
|
||||
frequently are updated very quickly, and contain many breaking changes
|
||||
that are (by the author's design) not yet fit for public consumption.
|
||||
Therefore, by default, they are excluded from range matching
|
||||
semantics.
|
||||
|
||||
Second, a user who has opted into using a prerelease version has
|
||||
clearly indicated the intent to use *that specific* set of
|
||||
alpha/beta/rc versions. By including a prerelease tag in the range,
|
||||
the user is indicating that they are aware of the risk. However, it
|
||||
is still not appropriate to assume that they have opted into taking a
|
||||
similar risk on the *next* set of prerelease versions.
|
||||
|
||||
Note that this behavior can be suppressed (treating all prerelease
|
||||
versions as if they were normal versions, for the purpose of range
|
||||
matching) by setting the `includePrerelease` flag on the options
|
||||
object to any
|
||||
[functions](https://github.com/npm/node-semver#functions) that do
|
||||
range matching.
|
||||
|
||||
#### Prerelease Identifiers
|
||||
|
||||
The method `.inc` takes an additional `identifier` string argument that
|
||||
will append the value of the string as a prerelease identifier:
|
||||
|
||||
```javascript
|
||||
semver.inc('1.2.3', 'prerelease', 'beta')
|
||||
// '1.2.4-beta.0'
|
||||
```
|
||||
|
||||
command-line example:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.3 -i prerelease --preid beta
|
||||
1.2.4-beta.0
|
||||
```
|
||||
|
||||
Which then can be used to increment further:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.4-beta.0 -i prerelease
|
||||
1.2.4-beta.1
|
||||
```
|
||||
|
||||
### Advanced Range Syntax
|
||||
|
||||
Advanced range syntax desugars to primitive comparators in
|
||||
deterministic ways.
|
||||
|
||||
Advanced ranges may be combined in the same way as primitive
|
||||
comparators using white space or `||`.
|
||||
|
||||
#### Hyphen Ranges `X.Y.Z - A.B.C`
|
||||
|
||||
Specifies an inclusive set.
|
||||
|
||||
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
|
||||
|
||||
If a partial version is provided as the first version in the inclusive
|
||||
range, then the missing pieces are replaced with zeroes.
|
||||
|
||||
* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
|
||||
|
||||
If a partial version is provided as the second version in the
|
||||
inclusive range, then all versions that start with the supplied parts
|
||||
of the tuple are accepted, but nothing that would be greater than the
|
||||
provided tuple parts.
|
||||
|
||||
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`
|
||||
* `1.2.3 - 2` := `>=1.2.3 <3.0.0`
|
||||
|
||||
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
|
||||
|
||||
Any of `X`, `x`, or `*` may be used to "stand in" for one of the
|
||||
numeric values in the `[major, minor, patch]` tuple.
|
||||
|
||||
* `*` := `>=0.0.0` (Any version satisfies)
|
||||
* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)
|
||||
* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)
|
||||
|
||||
A partial version range is treated as an X-Range, so the special
|
||||
character is in fact optional.
|
||||
|
||||
* `""` (empty string) := `*` := `>=0.0.0`
|
||||
* `1` := `1.x.x` := `>=1.0.0 <2.0.0`
|
||||
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`
|
||||
|
||||
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
|
||||
|
||||
Allows patch-level changes if a minor version is specified on the
|
||||
comparator. Allows minor-level changes if not.
|
||||
|
||||
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`
|
||||
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)
|
||||
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)
|
||||
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`
|
||||
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)
|
||||
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)
|
||||
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in
|
||||
the `1.2.3` version will be allowed, if they are greater than or
|
||||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||
different `[major, minor, patch]` tuple.
|
||||
|
||||
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
|
||||
|
||||
Allows changes that do not modify the left-most non-zero digit in the
|
||||
`[major, minor, patch]` tuple. In other words, this allows patch and
|
||||
minor updates for versions `1.0.0` and above, patch updates for
|
||||
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
|
||||
|
||||
Many authors treat a `0.x` version as if the `x` were the major
|
||||
"breaking-change" indicator.
|
||||
|
||||
Caret ranges are ideal when an author may make breaking changes
|
||||
between `0.2.4` and `0.3.0` releases, which is a common practice.
|
||||
However, it presumes that there will *not* be breaking changes between
|
||||
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
|
||||
additive (but non-breaking), according to commonly observed practices.
|
||||
|
||||
* `^1.2.3` := `>=1.2.3 <2.0.0`
|
||||
* `^0.2.3` := `>=0.2.3 <0.3.0`
|
||||
* `^0.0.3` := `>=0.0.3 <0.0.4`
|
||||
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in
|
||||
the `1.2.3` version will be allowed, if they are greater than or
|
||||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||
different `[major, minor, patch]` tuple.
|
||||
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the
|
||||
`0.0.3` version *only* will be allowed, if they are greater than or
|
||||
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
|
||||
|
||||
When parsing caret ranges, a missing `patch` value desugars to the
|
||||
number `0`, but will allow flexibility within that value, even if the
|
||||
major and minor versions are both `0`.
|
||||
|
||||
* `^1.2.x` := `>=1.2.0 <2.0.0`
|
||||
* `^0.0.x` := `>=0.0.0 <0.1.0`
|
||||
* `^0.0` := `>=0.0.0 <0.1.0`
|
||||
|
||||
A missing `minor` and `patch` values will desugar to zero, but also
|
||||
allow flexibility within those values, even if the major version is
|
||||
zero.
|
||||
|
||||
* `^1.x` := `>=1.0.0 <2.0.0`
|
||||
* `^0.x` := `>=0.0.0 <1.0.0`
|
||||
|
||||
### Range Grammar
|
||||
|
||||
Putting all this together, here is a Backus-Naur grammar for ranges,
|
||||
for the benefit of parser authors:
|
||||
|
||||
```bnf
|
||||
range-set ::= range ( logical-or range ) *
|
||||
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||
hyphen ::= partial ' - ' partial
|
||||
simple ::= primitive | partial | tilde | caret
|
||||
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
||||
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||
xr ::= 'x' | 'X' | '*' | nr
|
||||
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
|
||||
tilde ::= '~' partial
|
||||
caret ::= '^' partial
|
||||
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||
pre ::= parts
|
||||
build ::= parts
|
||||
parts ::= part ( '.' part ) *
|
||||
part ::= nr | [-0-9A-Za-z]+
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
All methods and classes take a final `options` object argument. All
|
||||
options in this object are `false` by default. The options supported
|
||||
are:
|
||||
|
||||
- `loose` Be more forgiving about not-quite-valid semver strings.
|
||||
(Any resulting output will always be 100% strict compliant, of
|
||||
course.) For backwards compatibility reasons, if the `options`
|
||||
argument is a boolean value instead of an object, it is interpreted
|
||||
to be the `loose` param.
|
||||
- `includePrerelease` Set to suppress the [default
|
||||
behavior](https://github.com/npm/node-semver#prerelease-tags) of
|
||||
excluding prerelease tagged versions from ranges unless they are
|
||||
explicitly opted into.
|
||||
|
||||
Strict-mode Comparators and Ranges will be strict about the SemVer
|
||||
strings that they parse.
|
||||
|
||||
* `valid(v)`: Return the parsed version, or null if it's not valid.
|
||||
* `inc(v, release)`: Return the version incremented by the release
|
||||
type (`major`, `premajor`, `minor`, `preminor`, `patch`,
|
||||
`prepatch`, or `prerelease`), or null if it's not valid
|
||||
* `premajor` in one call will bump the version up to the next major
|
||||
version and down to a prerelease of that major version.
|
||||
`preminor`, and `prepatch` work the same way.
|
||||
* If called from a non-prerelease version, the `prerelease` will work the
|
||||
same as `prepatch`. It increments the patch version, then makes a
|
||||
prerelease. If the input version is already a prerelease it simply
|
||||
increments it.
|
||||
* `prerelease(v)`: Returns an array of prerelease components, or null
|
||||
if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
|
||||
* `major(v)`: Return the major version number.
|
||||
* `minor(v)`: Return the minor version number.
|
||||
* `patch(v)`: Return the patch version number.
|
||||
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
|
||||
or comparators intersect.
|
||||
* `parse(v)`: Attempt to parse a string as a semantic version, returning either
|
||||
a `SemVer` object or `null`.
|
||||
|
||||
### Comparison
|
||||
|
||||
* `gt(v1, v2)`: `v1 > v2`
|
||||
* `gte(v1, v2)`: `v1 >= v2`
|
||||
* `lt(v1, v2)`: `v1 < v2`
|
||||
* `lte(v1, v2)`: `v1 <= v2`
|
||||
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
|
||||
even if they're not the exact same string. You already know how to
|
||||
compare strings.
|
||||
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
|
||||
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
|
||||
the corresponding function above. `"==="` and `"!=="` do simple
|
||||
string comparison, but are included for completeness. Throws if an
|
||||
invalid comparison string is provided.
|
||||
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
|
||||
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
||||
* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
|
||||
in descending order when passed to `Array.sort()`.
|
||||
* `diff(v1, v2)`: Returns difference between two versions by the release type
|
||||
(`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
|
||||
or null if the versions are the same.
|
||||
|
||||
### Comparators
|
||||
|
||||
* `intersects(comparator)`: Return true if the comparators intersect
|
||||
|
||||
### Ranges
|
||||
|
||||
* `validRange(range)`: Return the valid range or null if it's not valid
|
||||
* `satisfies(version, range)`: Return true if the version satisfies the
|
||||
range.
|
||||
* `maxSatisfying(versions, range)`: Return the highest version in the list
|
||||
that satisfies the range, or `null` if none of them do.
|
||||
* `minSatisfying(versions, range)`: Return the lowest version in the list
|
||||
that satisfies the range, or `null` if none of them do.
|
||||
* `minVersion(range)`: Return the lowest version that can possibly match
|
||||
the given range.
|
||||
* `gtr(version, range)`: Return `true` if version is greater than all the
|
||||
versions possible in the range.
|
||||
* `ltr(version, range)`: Return `true` if version is less than all the
|
||||
versions possible in the range.
|
||||
* `outside(version, range, hilo)`: Return true if the version is outside
|
||||
the bounds of the range in either the high or low direction. The
|
||||
`hilo` argument must be either the string `'>'` or `'<'`. (This is
|
||||
the function called by `gtr` and `ltr`.)
|
||||
* `intersects(range)`: Return true if any of the ranges comparators intersect
|
||||
|
||||
Note that, since ranges may be non-contiguous, a version might not be
|
||||
greater than a range, less than a range, *or* satisfy a range! For
|
||||
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
|
||||
until `2.0.0`, so the version `1.2.10` would not be greater than the
|
||||
range (because `2.0.1` satisfies, which is higher), nor less than the
|
||||
range (since `1.2.8` satisfies, which is lower), and it also does not
|
||||
satisfy the range.
|
||||
|
||||
If you want to know if a version satisfies or does not satisfy a
|
||||
range, use the `satisfies(version, range)` function.
|
||||
|
||||
### Coercion
|
||||
|
||||
* `coerce(version)`: Coerces a string to semver if possible
|
||||
|
||||
This aims to provide a very forgiving translation of a non-semver string to
|
||||
semver. It looks for the first digit in a string, and consumes all
|
||||
remaining characters which satisfy at least a partial semver (e.g., `1`,
|
||||
`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
|
||||
versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
|
||||
surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
|
||||
`3.4.0`). Only text which lacks digits will fail coercion (`version one`
|
||||
is not valid). The maximum length for any semver component considered for
|
||||
coercion is 16 characters; longer components will be ignored
|
||||
(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
|
||||
semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
|
||||
components are invalid (`9999999999999999.4.7.4` is likely invalid).
|
160
node_modules/istanbul-lib-source-maps/node_modules/semver/bin/semver
generated
vendored
Executable file
160
node_modules/istanbul-lib-source-maps/node_modules/semver/bin/semver
generated
vendored
Executable file
|
@ -0,0 +1,160 @@
|
|||
#!/usr/bin/env node
|
||||
// Standalone semver comparison program.
|
||||
// Exits successfully and prints matching version(s) if
|
||||
// any supplied version is valid and passes all tests.
|
||||
|
||||
var argv = process.argv.slice(2)
|
||||
|
||||
var versions = []
|
||||
|
||||
var range = []
|
||||
|
||||
var inc = null
|
||||
|
||||
var version = require('../package.json').version
|
||||
|
||||
var loose = false
|
||||
|
||||
var includePrerelease = false
|
||||
|
||||
var coerce = false
|
||||
|
||||
var identifier
|
||||
|
||||
var semver = require('../semver')
|
||||
|
||||
var reverse = false
|
||||
|
||||
var options = {}
|
||||
|
||||
main()
|
||||
|
||||
function main () {
|
||||
if (!argv.length) return help()
|
||||
while (argv.length) {
|
||||
var a = argv.shift()
|
||||
var indexOfEqualSign = a.indexOf('=')
|
||||
if (indexOfEqualSign !== -1) {
|
||||
a = a.slice(0, indexOfEqualSign)
|
||||
argv.unshift(a.slice(indexOfEqualSign + 1))
|
||||
}
|
||||
switch (a) {
|
||||
case '-rv': case '-rev': case '--rev': case '--reverse':
|
||||
reverse = true
|
||||
break
|
||||
case '-l': case '--loose':
|
||||
loose = true
|
||||
break
|
||||
case '-p': case '--include-prerelease':
|
||||
includePrerelease = true
|
||||
break
|
||||
case '-v': case '--version':
|
||||
versions.push(argv.shift())
|
||||
break
|
||||
case '-i': case '--inc': case '--increment':
|
||||
switch (argv[0]) {
|
||||
case 'major': case 'minor': case 'patch': case 'prerelease':
|
||||
case 'premajor': case 'preminor': case 'prepatch':
|
||||
inc = argv.shift()
|
||||
break
|
||||
default:
|
||||
inc = 'patch'
|
||||
break
|
||||
}
|
||||
break
|
||||
case '--preid':
|
||||
identifier = argv.shift()
|
||||
break
|
||||
case '-r': case '--range':
|
||||
range.push(argv.shift())
|
||||
break
|
||||
case '-c': case '--coerce':
|
||||
coerce = true
|
||||
break
|
||||
case '-h': case '--help': case '-?':
|
||||
return help()
|
||||
default:
|
||||
versions.push(a)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
var options = { loose: loose, includePrerelease: includePrerelease }
|
||||
|
||||
versions = versions.map(function (v) {
|
||||
return coerce ? (semver.coerce(v) || { version: v }).version : v
|
||||
}).filter(function (v) {
|
||||
return semver.valid(v)
|
||||
})
|
||||
if (!versions.length) return fail()
|
||||
if (inc && (versions.length !== 1 || range.length)) { return failInc() }
|
||||
|
||||
for (var i = 0, l = range.length; i < l; i++) {
|
||||
versions = versions.filter(function (v) {
|
||||
return semver.satisfies(v, range[i], options)
|
||||
})
|
||||
if (!versions.length) return fail()
|
||||
}
|
||||
return success(versions)
|
||||
}
|
||||
|
||||
function failInc () {
|
||||
console.error('--inc can only be used on a single version with no range')
|
||||
fail()
|
||||
}
|
||||
|
||||
function fail () { process.exit(1) }
|
||||
|
||||
function success () {
|
||||
var compare = reverse ? 'rcompare' : 'compare'
|
||||
versions.sort(function (a, b) {
|
||||
return semver[compare](a, b, options)
|
||||
}).map(function (v) {
|
||||
return semver.clean(v, options)
|
||||
}).map(function (v) {
|
||||
return inc ? semver.inc(v, inc, options, identifier) : v
|
||||
}).forEach(function (v, i, _) { console.log(v) })
|
||||
}
|
||||
|
||||
function help () {
|
||||
console.log(['SemVer ' + version,
|
||||
'',
|
||||
'A JavaScript implementation of the https://semver.org/ specification',
|
||||
'Copyright Isaac Z. Schlueter',
|
||||
'',
|
||||
'Usage: semver [options] <version> [<version> [...]]',
|
||||
'Prints valid versions sorted by SemVer precedence',
|
||||
'',
|
||||
'Options:',
|
||||
'-r --range <range>',
|
||||
' Print versions that match the specified range.',
|
||||
'',
|
||||
'-i --increment [<level>]',
|
||||
' Increment a version by the specified level. Level can',
|
||||
' be one of: major, minor, patch, premajor, preminor,',
|
||||
" prepatch, or prerelease. Default level is 'patch'.",
|
||||
' Only one version may be specified.',
|
||||
'',
|
||||
'--preid <identifier>',
|
||||
' Identifier to be used to prefix premajor, preminor,',
|
||||
' prepatch or prerelease version increments.',
|
||||
'',
|
||||
'-l --loose',
|
||||
' Interpret versions and ranges loosely',
|
||||
'',
|
||||
'-p --include-prerelease',
|
||||
' Always include prerelease versions in range matching',
|
||||
'',
|
||||
'-c --coerce',
|
||||
' Coerce a string into SemVer if possible',
|
||||
' (does not imply --loose)',
|
||||
'',
|
||||
'Program exits successfully if any valid version satisfies',
|
||||
'all supplied ranges, and prints all satisfying versions.',
|
||||
'',
|
||||
'If no satisfying versions are found, then exits failure.',
|
||||
'',
|
||||
'Versions are printed in ascending order, so supplying',
|
||||
'multiple versions to the utility will just sort them.'
|
||||
].join('\n'))
|
||||
}
|
38
node_modules/istanbul-lib-source-maps/node_modules/semver/package.json
generated
vendored
Normal file
38
node_modules/istanbul-lib-source-maps/node_modules/semver/package.json
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"name": "semver",
|
||||
"version": "5.7.2",
|
||||
"description": "The semantic version parser used by npm.",
|
||||
"main": "semver.js",
|
||||
"scripts": {
|
||||
"test": "tap test/ --100 --timeout=30",
|
||||
"lint": "echo linting disabled",
|
||||
"postlint": "template-oss-check",
|
||||
"template-oss-apply": "template-oss-apply --force",
|
||||
"lintfix": "npm run lint -- --fix",
|
||||
"snap": "tap test/ --100 --timeout=30",
|
||||
"posttest": "npm run lint"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@npmcli/template-oss": "4.17.0",
|
||||
"tap": "^12.7.0"
|
||||
},
|
||||
"license": "ISC",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/npm/node-semver.git"
|
||||
},
|
||||
"bin": {
|
||||
"semver": "./bin/semver"
|
||||
},
|
||||
"files": [
|
||||
"bin",
|
||||
"range.bnf",
|
||||
"semver.js"
|
||||
],
|
||||
"author": "GitHub Inc.",
|
||||
"templateOSS": {
|
||||
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
||||
"content": "./scripts/template-oss",
|
||||
"version": "4.17.0"
|
||||
}
|
||||
}
|
16
node_modules/istanbul-lib-source-maps/node_modules/semver/range.bnf
generated
vendored
Normal file
16
node_modules/istanbul-lib-source-maps/node_modules/semver/range.bnf
generated
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
range-set ::= range ( logical-or range ) *
|
||||
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||
hyphen ::= partial ' - ' partial
|
||||
simple ::= primitive | partial | tilde | caret
|
||||
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
||||
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||
xr ::= 'x' | 'X' | '*' | nr
|
||||
nr ::= '0' | [1-9] ( [0-9] ) *
|
||||
tilde ::= '~' partial
|
||||
caret ::= '^' partial
|
||||
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||
pre ::= parts
|
||||
build ::= parts
|
||||
parts ::= part ( '.' part ) *
|
||||
part ::= nr | [-0-9A-Za-z]+
|
1525
node_modules/istanbul-lib-source-maps/node_modules/semver/semver.js
generated
vendored
Normal file
1525
node_modules/istanbul-lib-source-maps/node_modules/semver/semver.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
44
node_modules/istanbul-lib-source-maps/package.json
generated
vendored
Normal file
44
node_modules/istanbul-lib-source-maps/package.json
generated
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
"name": "istanbul-lib-source-maps",
|
||||
"version": "3.0.6",
|
||||
"description": "Source maps support for istanbul",
|
||||
"author": "Krishnan Anantheswaran <kananthmail-github@yahoo.com>",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"lib",
|
||||
"index.js"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": "^4.1.1",
|
||||
"istanbul-lib-coverage": "^2.0.5",
|
||||
"make-dir": "^2.1.0",
|
||||
"rimraf": "^2.6.3",
|
||||
"source-map": "^0.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ts-node": "^8.1.0"
|
||||
},
|
||||
"license": "BSD-3-Clause",
|
||||
"bugs": {
|
||||
"url": "https://github.com/istanbuljs/istanbuljs/issues"
|
||||
},
|
||||
"homepage": "https://istanbul.js.org/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/istanbuljs/istanbuljs.git"
|
||||
},
|
||||
"keywords": [
|
||||
"istanbul",
|
||||
"sourcemaps",
|
||||
"sourcemap",
|
||||
"source",
|
||||
"maps"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"gitHead": "90e60cc47833bb780680f916488ca24f0be36ca2"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue