Commit a9f55582 authored by wildfirecode's avatar wildfirecode

1

parent a65b650d

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

../atob/bin/atob.js
\ No newline at end of file
../babylon/bin/babylon.js
\ No newline at end of file
../coveralls/bin/coveralls.js
\ No newline at end of file
../escodegen/bin/escodegen.js
\ No newline at end of file
../escodegen/bin/esgenerate.js
\ No newline at end of file
../eslint/bin/eslint.js
\ No newline at end of file
../eslint-config-prettier/bin/cli.js
\ No newline at end of file
../handlebars/bin/handlebars
\ No newline at end of file
../import-local/fixtures/cli.js
\ No newline at end of file
../is-ci/bin.js
\ No newline at end of file
../jest/bin/jest.js
\ No newline at end of file
../jest-runtime/bin/jest-runtime.js
\ No newline at end of file
../js-yaml/bin/js-yaml.js
\ No newline at end of file
../jsesc/bin/jsesc
\ No newline at end of file
../json5/lib/cli.js
\ No newline at end of file
../lint-staged/index.js
\ No newline at end of file
../loose-envify/cli.js
\ No newline at end of file
../node-gyp/bin/node-gyp.js
\ No newline at end of file
../npm-path/bin/npm-path
\ No newline at end of file
../npm-which/bin/npm-which.js
\ No newline at end of file
../nsp/bin/nsp
\ No newline at end of file
../prettier/bin-prettier.js
\ No newline at end of file
../sane/src/cli.js
\ No newline at end of file
../shelljs/bin/shjs
\ No newline at end of file
../sshpk/bin/sshpk-conv
\ No newline at end of file
../sshpk/bin/sshpk-sign
\ No newline at end of file
../sshpk/bin/sshpk-verify
\ No newline at end of file
../uglify-js/bin/uglifyjs
\ No newline at end of file
../uuid/bin/uuid
\ No newline at end of file
../watch/cli.js
\ No newline at end of file
../which/bin/which
\ No newline at end of file
../yosay/cli.js
\ No newline at end of file
# @babel/code-frame
> Generate errors that contain a code frame that point to source locations.
## Install
```sh
npm install --save-dev @babel/code-frame
```
## Usage
```js
import { codeFrameColumns } from '@babel/code-frame';
const rawLines = `class Foo {
constructor()
}`;
const location = { start: { line: 2, column: 16 } };
const result = codeFrameColumns(rawLines, location, { /* options */ });
console.log(result);
```
```
1 | class Foo {
> 2 | constructor()
| ^
3 | }
```
If the column number is not known, you may omit it.
You can also pass an `end` hash in `location`.
```js
import { codeFrameColumns } from '@babel/code-frame';
const rawLines = `class Foo {
constructor() {
console.log("hello");
}
}`;
const location = { start: { line: 2, column: 17 }, end: { line: 4, column: 3 } };
const result = codeFrameColumns(rawLines, location, { /* options */ });
console.log(result);
```
```
1 | class Foo {
> 2 | constructor() {
| ^
> 3 | console.log("hello");
| ^^^^^^^^^^^^^^^^^^^^^^^^^
> 4 | }
| ^^^
5 | };
```
## Options
### `highlightCode`
`boolean`, defaults to `false`.
Toggles syntax highlighting the code as JavaScript for terminals.
### `linesAbove`
`number`, defaults to `2`.
Adjust the number of lines to show above the error.
### `linesBelow`
`number`, defaults to `3`.
Adjust the number of lines to show below the error.
### `forceColor`
`boolean`, defaults to `false`.
Enable this to forcibly syntax highlight the code as JavaScript (for non-terminals); overrides `highlightCode`.
### `message`
`string`, otherwise nothing
Pass in a string to be displayed inline (if possible) next to the highlighted
location in the code. If it can't be positioned inline, it will be placed above
the code frame.
```
1 | class Foo {
> 2 | constructor()
| ^ Missing {
3 | };
```
## Upgrading from prior versions
Prior to version 7, the only API exposed by this module was for a single line and optional column pointer. The old API will now log a deprecation warning.
The new API takes a `location` object, similar to what is available in an AST.
This is an example of the deprecated (but still available) API:
```js
import codeFrame from '@babel/code-frame';
const rawLines = `class Foo {
constructor()
}`;
const lineNumber = 2;
const colNumber = 16;
const result = codeFrame(rawLines, lineNumber, colNumber, { /* options */ });
console.log(result);
```
To get the same highlighting using the new API:
```js
import { codeFrameColumns } from '@babel/code-frame';
const rawLines = `class Foo {
constructor() {
console.log("hello");
}
}`;
const location = { start: { line: 2, column: 16 } };
const result = codeFrameColumns(rawLines, location, { /* options */ });
console.log(result);
```
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.codeFrameColumns = codeFrameColumns;
exports.default = _default;
function _highlight() {
const data = _interopRequireWildcard(require("@babel/highlight"));
_highlight = function () {
return data;
};
return data;
}
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
let deprecationWarningShown = false;
function getDefs(chalk) {
return {
gutter: chalk.grey,
marker: chalk.red.bold,
message: chalk.red.bold
};
}
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
function getMarkerLines(loc, source, opts) {
const startLoc = Object.assign({
column: 0,
line: -1
}, loc.start);
const endLoc = Object.assign({}, startLoc, loc.end);
const {
linesAbove = 2,
linesBelow = 3
} = opts || {};
const startLine = startLoc.line;
const startColumn = startLoc.column;
const endLine = endLoc.line;
const endColumn = endLoc.column;
let start = Math.max(startLine - (linesAbove + 1), 0);
let end = Math.min(source.length, endLine + linesBelow);
if (startLine === -1) {
start = 0;
}
if (endLine === -1) {
end = source.length;
}
const lineDiff = endLine - startLine;
const markerLines = {};
if (lineDiff) {
for (let i = 0; i <= lineDiff; i++) {
const lineNumber = i + startLine;
if (!startColumn) {
markerLines[lineNumber] = true;
} else if (i === 0) {
const sourceLength = source[lineNumber - 1].length;
markerLines[lineNumber] = [startColumn, sourceLength - startColumn];
} else if (i === lineDiff) {
markerLines[lineNumber] = [0, endColumn];
} else {
const sourceLength = source[lineNumber - i].length;
markerLines[lineNumber] = [0, sourceLength];
}
}
} else {
if (startColumn === endColumn) {
if (startColumn) {
markerLines[startLine] = [startColumn, 0];
} else {
markerLines[startLine] = true;
}
} else {
markerLines[startLine] = [startColumn, endColumn - startColumn];
}
}
return {
start,
end,
markerLines
};
}
function codeFrameColumns(rawLines, loc, opts = {}) {
const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight().shouldHighlight)(opts);
const chalk = (0, _highlight().getChalk)(opts);
const defs = getDefs(chalk);
const maybeHighlight = (chalkFn, string) => {
return highlighted ? chalkFn(string) : string;
};
if (highlighted) rawLines = (0, _highlight().default)(rawLines, opts);
const lines = rawLines.split(NEWLINE);
const {
start,
end,
markerLines
} = getMarkerLines(loc, lines, opts);
const hasColumns = loc.start && typeof loc.start.column === "number";
const numberMaxWidth = String(end).length;
let frame = lines.slice(start, end).map((line, index) => {
const number = start + 1 + index;
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
const gutter = ` ${paddedNumber} | `;
const hasMarker = markerLines[number];
const lastMarkerLine = !markerLines[number + 1];
if (hasMarker) {
let markerLine = "";
if (Array.isArray(hasMarker)) {
const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
const numberOfMarkers = hasMarker[1] || 1;
markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join("");
if (lastMarkerLine && opts.message) {
markerLine += " " + maybeHighlight(defs.message, opts.message);
}
}
return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join("");
} else {
return ` ${maybeHighlight(defs.gutter, gutter)}${line}`;
}
}).join("\n");
if (opts.message && !hasColumns) {
frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`;
}
if (highlighted) {
return chalk.reset(frame);
} else {
return frame;
}
}
function _default(rawLines, lineNumber, colNumber, opts = {}) {
if (!deprecationWarningShown) {
deprecationWarningShown = true;
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
if (process.emitWarning) {
process.emitWarning(message, "DeprecationWarning");
} else {
const deprecationError = new Error(message);
deprecationError.name = "DeprecationWarning";
console.warn(new Error(message));
}
}
colNumber = Math.max(colNumber, 0);
const location = {
start: {
column: colNumber,
line: lineNumber
}
};
return codeFrameColumns(rawLines, location, opts);
}
\ No newline at end of file
{
"_args": [
[
"@babel/code-frame@7.0.0-beta.49",
"/Users/wanghongyuan/generator-dbgame"
]
],
"_development": true,
"_from": "@babel/code-frame@7.0.0-beta.49",
"_id": "@babel/code-frame@7.0.0-beta.49",
"_inBundle": false,
"_integrity": "sha1-vs2AVIJzREDJ0TfkbXc0DmTX9Rs=",
"_location": "/@babel/code-frame",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@babel/code-frame@7.0.0-beta.49",
"name": "@babel/code-frame",
"escapedName": "@babel%2fcode-frame",
"scope": "@babel",
"rawSpec": "7.0.0-beta.49",
"saveSpec": null,
"fetchSpec": "7.0.0-beta.49"
},
"_requiredBy": [
"/jest-message-util"
],
"_resolved": "http://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.0.0-beta.49.tgz",
"_spec": "7.0.0-beta.49",
"_where": "/Users/wanghongyuan/generator-dbgame",
"author": {
"name": "Sebastian McKenzie",
"email": "sebmck@gmail.com"
},
"dependencies": {
"@babel/highlight": "7.0.0-beta.49"
},
"description": "Generate errors that contain a code frame that point to source locations.",
"devDependencies": {
"chalk": "^2.0.0",
"strip-ansi": "^4.0.0"
},
"homepage": "https://babeljs.io/",
"license": "MIT",
"main": "lib/index.js",
"name": "@babel/code-frame",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-code-frame"
},
"version": "7.0.0-beta.49"
}
# @babel/highlight
> Syntax highlight JavaScript strings for output in terminals.
## Install
```sh
npm install --save @babel/highlight
```
## Usage
```js
import highlight from "@babel/highlight";
const code = `class Foo {
constructor()
}`;
const result = highlight(code);
console.log(result);
```
```js
class Foo {
constructor()
}
```
By default, `highlight` will not highlight your code if your terminal does not support color. To force colors, pass `{ forceColor: true }` as the second argument to `highlight`.
```js
import highlight from "@babel/highlight";
const code = `class Foo {
constructor()
}`;
const result = highlight(code, { forceColor: true });
```
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.shouldHighlight = shouldHighlight;
exports.getChalk = getChalk;
exports.default = highlight;
function _jsTokens() {
const data = _interopRequireWildcard(require("js-tokens"));
_jsTokens = function () {
return data;
};
return data;
}
function _esutils() {
const data = _interopRequireDefault(require("esutils"));
_esutils = function () {
return data;
};
return data;
}
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
function getDefs(chalk) {
return {
keyword: chalk.cyan,
capitalized: chalk.yellow,
jsx_tag: chalk.yellow,
punctuator: chalk.yellow,
number: chalk.magenta,
string: chalk.green,
regex: chalk.magenta,
comment: chalk.grey,
invalid: chalk.white.bgRed.bold
};
}
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
const JSX_TAG = /^[a-z][\w-]*$/i;
const BRACKET = /^[()[\]{}]$/;
function getTokenType(match) {
const [offset, text] = match.slice(-2);
const token = (0, _jsTokens().matchToToken)(match);
if (token.type === "name") {
if (_esutils().default.keyword.isReservedWordES6(token.value)) {
return "keyword";
}
if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == "</")) {
return "jsx_tag";
}
if (token.value[0] !== token.value[0].toLowerCase()) {
return "capitalized";
}
}
if (token.type === "punctuator" && BRACKET.test(token.value)) {
return "bracket";
}
if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
return "punctuator";
}
return token.type;
}
function highlightTokens(defs, text) {
return text.replace(_jsTokens().default, function (...args) {
const type = getTokenType(args);
const colorize = defs[type];
if (colorize) {
return args[0].split(NEWLINE).map(str => colorize(str)).join("\n");
} else {
return args[0];
}
});
}
function shouldHighlight(options) {
return _chalk().default.supportsColor || options.forceColor;
}
function getChalk(options) {
let chalk = _chalk().default;
if (options.forceColor) {
chalk = new (_chalk().default.constructor)({
enabled: true,
level: 1
});
}
return chalk;
}
function highlight(code, options = {}) {
if (shouldHighlight(options)) {
const chalk = getChalk(options);
const defs = getDefs(chalk);
return highlightTokens(defs, code);
} else {
return code;
}
}
\ No newline at end of file
{
"_args": [
[
"@babel/highlight@7.0.0-beta.49",
"/Users/wanghongyuan/generator-dbgame"
]
],
"_development": true,
"_from": "@babel/highlight@7.0.0-beta.49",
"_id": "@babel/highlight@7.0.0-beta.49",
"_inBundle": false,
"_integrity": "sha1-lr3GtD4TSCASumaRsQGEktOWIsw=",
"_location": "/@babel/highlight",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@babel/highlight@7.0.0-beta.49",
"name": "@babel/highlight",
"escapedName": "@babel%2fhighlight",
"scope": "@babel",
"rawSpec": "7.0.0-beta.49",
"saveSpec": null,
"fetchSpec": "7.0.0-beta.49"
},
"_requiredBy": [
"/@babel/code-frame"
],
"_resolved": "http://registry.npm.taobao.org/@babel/highlight/download/@babel/highlight-7.0.0-beta.49.tgz",
"_spec": "7.0.0-beta.49",
"_where": "/Users/wanghongyuan/generator-dbgame",
"author": {
"name": "suchipi",
"email": "me@suchipi.com"
},
"dependencies": {
"chalk": "^2.0.0",
"esutils": "^2.0.2",
"js-tokens": "^3.0.0"
},
"description": "Syntax highlight JavaScript strings for output in terminals.",
"devDependencies": {
"strip-ansi": "^4.0.0"
},
"homepage": "https://babeljs.io/",
"license": "MIT",
"main": "lib/index.js",
"name": "@babel/highlight",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel/tree/master/packages/babel-highlight"
},
"version": "7.0.0-beta.49"
}
# Change Log
All notable changes will be documented in this file.
`readdir-enhanced` adheres to [Semantic Versioning](http://semver.org/).
## [v2.2.0](https://github.com/BigstickCarpet/readdir-enhanced/tree/v2.2.0) (2018-01-09)
- Refactored the codebase to use ES6 syntax (Node v4.x compatible)
- You can now provide [your own implementation](https://github.com/BigstickCarpet/readdir-enhanced#custom-fs-methods) for the [filesystem module](https://nodejs.org/api/fs.html) that's used by `readdir-enhanced`. Just set the `fs` option to your implementation. Thanks to [@mrmlnc](https://github.com/mrmlnc) for the idea and [the PR](https://github.com/BigstickCarpet/readdir-enhanced/pull/10)!
- [Better error handling](https://github.com/BigstickCarpet/readdir-enhanced/commit/0d330b68524bafbdeae11566a3e8af1bc3f184bf), especially around user-specified logic, such as `options.deep`, `options.filter`, and `options.fs`
[Full Changelog](https://github.com/BigstickCarpet/readdir-enhanced/compare/v2.1.0...v2.2.0)
## [v2.1.0](https://github.com/BigstickCarpet/readdir-enhanced/tree/v2.1.0) (2017-12-01)
- The `fs.Stats` objects now include a `depth` property, which indicates the number of subdirectories beneath the base path. Thanks to [@mrmlnc](https://github.com/mrmlnc) for [the PR](https://github.com/BigstickCarpet/readdir-enhanced/pull/8)!
[Full Changelog](https://github.com/BigstickCarpet/readdir-enhanced/compare/v2.0.0...v2.1.0)
## [v2.0.0](https://github.com/BigstickCarpet/readdir-enhanced/tree/v2.0.0) (2017-11-15)
- Dropped support for Node v0.x, which is no longer actively maintained. Please upgrade to Node 4 or newer.
[Full Changelog](https://github.com/BigstickCarpet/readdir-enhanced/compare/v1.5.0...v2.0.0)
## [v1.5.0](https://github.com/BigstickCarpet/readdir-enhanced/tree/v1.5.0) (2017-04-10)
The [`deep` option](README.md#deep) can now be set to a [regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp), a [glob pattern](https://github.com/isaacs/node-glob#glob-primer), or a function, which allows you to customize which subdirectories get crawled. Of course, you can also still still set the `deep` option to `true` to crawl _all_ subdirectories, or a number if you just want to limit the recursion depth.
[Full Changelog](https://github.com/BigstickCarpet/readdir-enhanced/compare/v1.4.0...v1.5.0)
## [v1.4.0](https://github.com/BigstickCarpet/readdir-enhanced/tree/v1.4.0) (2016-08-26)
The [`filter` option](README.md#filter) can now be set to a regular expression or a glob pattern string, which simplifies filtering based on file names. Of course, you can still set the `filter` option to a function if you need to perform more advanced filtering based on the [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) of each file.
[Full Changelog](https://github.com/BigstickCarpet/readdir-enhanced/compare/v1.3.4...v1.4.0)
## [v1.3.4](https://github.com/BigstickCarpet/readdir-enhanced/tree/v1.3.4) (2016-08-26)
As of this release, `readdir-enhanced` is fully tested on all major Node versions (0.x, 4.x, 5.x, 6.x) on [linux](https://travis-ci.org/BigstickCarpet/readdir-enhanced) and [Windows](https://ci.appveyor.com/project/BigstickCarpet/readdir-enhanced/branch/master), with [nearly 100% code coverage](https://coveralls.io/github/BigstickCarpet/readdir-enhanced?branch=master). I do all of my local development and testing on MacOS, so that's covered too.
[Full Changelog](https://github.com/BigstickCarpet/readdir-enhanced/compare/v1.0.1...v1.3.4)
The MIT License (MIT)
Copyright (c) 2016 James Messinger
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.
.
\ No newline at end of file
This diff is collapsed.
'use strict';
module.exports = asyncForEach;
/**
* Simultaneously processes all items in the given array.
*
* @param {array} array - The array to iterate over
* @param {function} iterator - The function to call for each item in the array
* @param {function} done - The function to call when all iterators have completed
*/
function asyncForEach (array, iterator, done) {
if (array.length === 0) {
// NOTE: Normally a bad idea to mix sync and async, but it's safe here because
// of the way that this method is currently used by DirectoryReader.
done();
return;
}
// Simultaneously process all items in the array.
let pending = array.length;
array.forEach(item => {
iterator(item, () => {
if (--pending === 0) {
done();
}
});
});
}
'use strict';
module.exports = readdirAsync;
const maybe = require('call-me-maybe');
const DirectoryReader = require('../directory-reader');
let asyncFacade = {
fs: require('fs'),
forEach: require('./for-each'),
async: true
};
/**
* Returns the buffered output from an asynchronous {@link DirectoryReader},
* via an error-first callback or a {@link Promise}.
*
* @param {string} dir
* @param {object} [options]
* @param {function} [callback]
* @param {object} internalOptions
*/
function readdirAsync (dir, options, callback, internalOptions) {
if (typeof options === 'function') {
callback = options;
options = undefined;
}
return maybe(callback, new Promise(((resolve, reject) => {
let results = [];
internalOptions.facade = asyncFacade;
let reader = new DirectoryReader(dir, options, internalOptions);
let stream = reader.stream;
stream.on('error', err => {
reject(err);
stream.pause();
});
stream.on('data', result => {
results.push(result);
});
stream.on('end', () => {
resolve(results);
});
})));
}
'use strict';
let call = module.exports = {
safe: safeCall,
once: callOnce,
};
/**
* Calls a function with the given arguments, and ensures that the error-first callback is _always_
* invoked exactly once, even if the function throws an error.
*
* @param {function} fn - The function to invoke
* @param {...*} args - The arguments to pass to the function. The final argument must be a callback function.
*/
function safeCall (fn, args) {
// Get the function arguments as an array
args = Array.prototype.slice.call(arguments, 1);
// Replace the callback function with a wrapper that ensures it will only be called once
let callback = call.once(args.pop());
args.push(callback);
try {
fn.apply(null, args);
}
catch (err) {
callback(err);
}
}
/**
* Returns a wrapper function that ensures the given callback function is only called once.
* Subsequent calls are ignored, unless the first argument is an Error, in which case the
* error is thrown.
*
* @param {function} fn - The function that should only be called once
* @returns {function}
*/
function callOnce (fn) {
let fulfilled = false;
return function onceWrapper (err) {
if (!fulfilled) {
fulfilled = true;
return fn.apply(this, arguments);
}
else if (err) {
// The callback has already been called, but now an error has occurred
// (most likely inside the callback function). So re-throw the error,
// so it gets handled further up the call stack
throw err;
}
};
}
This diff is collapsed.
'use strict';
const readdirSync = require('./sync');
const readdirAsync = require('./async');
const readdirStream = require('./stream');
module.exports = exports = readdirAsyncPath;
exports.readdir = exports.readdirAsync = exports.async = readdirAsyncPath;
exports.readdirAsyncStat = exports.async.stat = readdirAsyncStat;
exports.readdirStream = exports.stream = readdirStreamPath;
exports.readdirStreamStat = exports.stream.stat = readdirStreamStat;
exports.readdirSync = exports.sync = readdirSyncPath;
exports.readdirSyncStat = exports.sync.stat = readdirSyncStat;
/**
* Synchronous readdir that returns an array of string paths.
*
* @param {string} dir
* @param {object} [options]
* @returns {string[]}
*/
function readdirSyncPath (dir, options) {
return readdirSync(dir, options, {});
}
/**
* Synchronous readdir that returns results as an array of {@link fs.Stats} objects
*
* @param {string} dir
* @param {object} [options]
* @returns {fs.Stats[]}
*/
function readdirSyncStat (dir, options) {
return readdirSync(dir, options, { stats: true });
}
/**
* Aynchronous readdir (accepts an error-first callback or returns a {@link Promise}).
* Results are an array of path strings.
*
* @param {string} dir
* @param {object} [options]
* @param {function} [callback]
* @returns {Promise<string[]>}
*/
function readdirAsyncPath (dir, options, callback) {
return readdirAsync(dir, options, callback, {});
}
/**
* Aynchronous readdir (accepts an error-first callback or returns a {@link Promise}).
* Results are an array of {@link fs.Stats} objects.
*
* @param {string} dir
* @param {object} [options]
* @param {function} [callback]
* @returns {Promise<fs.Stats[]>}
*/
function readdirAsyncStat (dir, options, callback) {
return readdirAsync(dir, options, callback, { stats: true });
}
/**
* Aynchronous readdir that returns a {@link stream.Readable} (which is also an {@link EventEmitter}).
* All stream data events ("data", "file", "directory", "symlink") are passed a path string.
*
* @param {string} dir
* @param {object} [options]
* @returns {stream.Readable}
*/
function readdirStreamPath (dir, options) {
return readdirStream(dir, options, {});
}
/**
* Aynchronous readdir that returns a {@link stream.Readable} (which is also an {@link EventEmitter})
* All stream data events ("data", "file", "directory", "symlink") are passed an {@link fs.Stats} object.
*
* @param {string} dir
* @param {object} [options]
* @returns {stream.Readable}
*/
function readdirStreamStat (dir, options) {
return readdirStream(dir, options, { stats: true });
}
'use strict';
const path = require('path');
const globToRegExp = require('glob-to-regexp');
module.exports = normalizeOptions;
let isWindows = /^win/.test(process.platform);
/**
* @typedef {Object} FSFacade
* @property {fs.readdir} readdir
* @property {fs.stat} stat
* @property {fs.lstat} lstat
*/
/**
* Validates and normalizes the options argument
*
* @param {object} [options] - User-specified options, if any
* @param {object} internalOptions - Internal options that aren't part of the public API
*
* @param {number|boolean|function} [options.deep]
* The number of directories to recursively traverse. Any falsy value or negative number will
* default to zero, so only the top-level contents will be returned. Set to `true` or `Infinity`
* to traverse all subdirectories. Or provide a function that accepts a {@link fs.Stats} object
* and returns a truthy value if the directory's contents should be crawled.
*
* @param {function|string|RegExp} [options.filter]
* A function that accepts a {@link fs.Stats} object and returns a truthy value if the data should
* be returned. Or a RegExp or glob string pattern, to filter by file name.
*
* @param {string} [options.sep]
* The path separator to use. By default, the OS-specific separator will be used, but this can be
* set to a specific value to ensure consistency across platforms.
*
* @param {string} [options.basePath]
* The base path to prepend to each result. If empty, then all results will be relative to `dir`.
*
* @param {FSFacade} [options.fs]
* Synchronous or asynchronous facades for Node.js File System module
*
* @param {object} [internalOptions.facade]
* Synchronous or asynchronous facades for various methods, including for the Node.js File System module
*
* @param {boolean} [internalOptions.emit]
* Indicates whether the reader should emit "file", "directory", and "symlink" events
*
* @param {boolean} [internalOptions.stats]
* Indicates whether the reader should emit {@link fs.Stats} objects instead of path strings
*
* @returns {object}
*/
function normalizeOptions (options, internalOptions) {
if (options === null || options === undefined) {
options = {};
}
else if (typeof options !== 'object') {
throw new TypeError('options must be an object');
}
let recurseDepth, recurseFn, recurseRegExp, recurseGlob, deep = options.deep;
if (deep === null || deep === undefined) {
recurseDepth = 0;
}
else if (typeof deep === 'boolean') {
recurseDepth = deep ? Infinity : 0;
}
else if (typeof deep === 'number') {
if (deep < 0 || isNaN(deep)) {
throw new Error('options.deep must be a positive number');
}
else if (Math.floor(deep) !== deep) {
throw new Error('options.deep must be an integer');
}
else {
recurseDepth = deep;
}
}
else if (typeof deep === 'function') {
recurseDepth = Infinity;
recurseFn = deep;
}
else if (deep instanceof RegExp) {
recurseDepth = Infinity;
recurseRegExp = deep;
}
else if (typeof deep === 'string' && deep.length > 0) {
recurseDepth = Infinity;
recurseGlob = globToRegExp(deep, { extended: true, globstar: true });
}
else {
throw new TypeError('options.deep must be a boolean, number, function, regular expression, or glob pattern');
}
let filterFn, filterRegExp, filterGlob, filter = options.filter;
if (filter !== null && filter !== undefined) {
if (typeof filter === 'function') {
filterFn = filter;
}
else if (filter instanceof RegExp) {
filterRegExp = filter;
}
else if (typeof filter === 'string' && filter.length > 0) {
filterGlob = globToRegExp(filter, { extended: true, globstar: true });
}
else {
throw new TypeError('options.filter must be a function, regular expression, or glob pattern');
}
}
let sep = options.sep;
if (sep === null || sep === undefined) {
sep = path.sep;
}
else if (typeof sep !== 'string') {
throw new TypeError('options.sep must be a string');
}
let basePath = options.basePath;
if (basePath === null || basePath === undefined) {
basePath = '';
}
else if (typeof basePath === 'string') {
// Append a path separator to the basePath, if necessary
if (basePath && basePath.substr(-1) !== sep) {
basePath += sep;
}
}
else {
throw new TypeError('options.basePath must be a string');
}
// Convert the basePath to POSIX (forward slashes)
// so that glob pattern matching works consistently, even on Windows
let posixBasePath = basePath;
if (posixBasePath && sep !== '/') {
posixBasePath = posixBasePath.replace(new RegExp('\\' + sep, 'g'), '/');
/* istanbul ignore if */
if (isWindows) {
// Convert Windows root paths (C:\) and UNCs (\\) to POSIX root paths
posixBasePath = posixBasePath.replace(/^([a-zA-Z]\:\/|\/\/)/, '/');
}
}
// Determine which facade methods to use
let facade;
if (options.fs === null || options.fs === undefined) {
// The user didn't provide their own facades, so use our internal ones
facade = internalOptions.facade;
}
else if (typeof options.fs === 'object') {
// Merge the internal facade methods with the user-provided `fs` facades
facade = Object.assign({}, internalOptions.facade);
facade.fs = Object.assign({}, internalOptions.facade.fs, options.fs);
}
else {
throw new TypeError('options.fs must be an object');
}
return {
recurseDepth,
recurseFn,
recurseRegExp,
recurseGlob,
filterFn,
filterRegExp,
filterGlob,
sep,
basePath,
posixBasePath,
facade,
emit: !!internalOptions.emit,
stats: !!internalOptions.stats,
};
}
'use strict';
const call = require('./call');
module.exports = stat;
/**
* Retrieves the {@link fs.Stats} for the given path. If the path is a symbolic link,
* then the Stats of the symlink's target are returned instead. If the symlink is broken,
* then the Stats of the symlink itself are returned.
*
* @param {object} fs - Synchronous or Asynchronouse facade for the "fs" module
* @param {string} path - The path to return stats for
* @param {function} callback
*/
function stat (fs, path, callback) {
let isSymLink = false;
call.safe(fs.lstat, path, (err, lstats) => {
if (err) {
// fs.lstat threw an eror
return callback(err);
}
try {
isSymLink = lstats.isSymbolicLink();
}
catch (err2) {
// lstats.isSymbolicLink() threw an error
// (probably because fs.lstat returned an invalid result)
return callback(err2);
}
if (isSymLink) {
// Try to resolve the symlink
symlinkStat(fs, path, lstats, callback);
}
else {
// It's not a symlink, so return the stats as-is
callback(null, lstats);
}
});
}
/**
* Retrieves the {@link fs.Stats} for the target of the given symlink.
* If the symlink is broken, then the Stats of the symlink itself are returned.
*
* @param {object} fs - Synchronous or Asynchronouse facade for the "fs" module
* @param {string} path - The path of the symlink to return stats for
* @param {object} lstats - The stats of the symlink
* @param {function} callback
*/
function symlinkStat (fs, path, lstats, callback) {
call.safe(fs.stat, path, (err, stats) => {
if (err) {
// The symlink is broken, so return the stats for the link itself
return callback(null, lstats);
}
try {
// Return the stats for the resolved symlink target,
// and override the `isSymbolicLink` method to indicate that it's a symlink
stats.isSymbolicLink = () => true;
}
catch (err2) {
// Setting stats.isSymbolicLink threw an error
// (probably because fs.stat returned an invalid result)
return callback(err2);
}
callback(null, stats);
});
}
'use strict';
module.exports = readdirStream;
const DirectoryReader = require('../directory-reader');
let streamFacade = {
fs: require('fs'),
forEach: require('../async/for-each'),
async: true
};
/**
* Returns the {@link stream.Readable} of an asynchronous {@link DirectoryReader}.
*
* @param {string} dir
* @param {object} [options]
* @param {object} internalOptions
*/
function readdirStream (dir, options, internalOptions) {
internalOptions.facade = streamFacade;
let reader = new DirectoryReader(dir, options, internalOptions);
return reader.stream;
}
'use strict';
module.exports = syncForEach;
/**
* A facade that allows {@link Array.forEach} to be called as though it were asynchronous.
*
* @param {array} array - The array to iterate over
* @param {function} iterator - The function to call for each item in the array
* @param {function} done - The function to call when all iterators have completed
*/
function syncForEach (array, iterator, done) {
array.forEach(item => {
iterator(item, () => {
// Note: No error-handling here because this is currently only ever called
// by DirectoryReader, which never passes an `error` parameter to the callback.
// Instead, DirectoryReader emits an "error" event if an error occurs.
});
});
done();
}
'use strict';
const fs = require('fs');
const call = require('../call');
/**
* A facade around {@link fs.readdirSync} that allows it to be called
* the same way as {@link fs.readdir}.
*
* @param {string} dir
* @param {function} callback
*/
exports.readdir = function (dir, callback) {
// Make sure the callback is only called once
callback = call.once(callback);
try {
let items = fs.readdirSync(dir);
callback(null, items);
}
catch (err) {
callback(err);
}
};
/**
* A facade around {@link fs.statSync} that allows it to be called
* the same way as {@link fs.stat}.
*
* @param {string} path
* @param {function} callback
*/
exports.stat = function (path, callback) {
// Make sure the callback is only called once
callback = call.once(callback);
try {
let stats = fs.statSync(path);
callback(null, stats);
}
catch (err) {
callback(err);
}
};
/**
* A facade around {@link fs.lstatSync} that allows it to be called
* the same way as {@link fs.lstat}.
*
* @param {string} path
* @param {function} callback
*/
exports.lstat = function (path, callback) {
// Make sure the callback is only called once
callback = call.once(callback);
try {
let stats = fs.lstatSync(path);
callback(null, stats);
}
catch (err) {
callback(err);
}
};
'use strict';
module.exports = readdirSync;
const DirectoryReader = require('../directory-reader');
let syncFacade = {
fs: require('./fs'),
forEach: require('./for-each'),
sync: true
};
/**
* Returns the buffered output from a synchronous {@link DirectoryReader}.
*
* @param {string} dir
* @param {object} [options]
* @param {object} internalOptions
*/
function readdirSync (dir, options, internalOptions) {
internalOptions.facade = syncFacade;
let reader = new DirectoryReader(dir, options, internalOptions);
let stream = reader.stream;
let results = [];
let data = stream.read();
while (data !== null) {
results.push(data);
data = stream.read();
}
return results;
}
{
"_args": [
[
"@mrmlnc/readdir-enhanced@2.2.1",
"/Users/wanghongyuan/generator-dbgame"
]
],
"_from": "@mrmlnc/readdir-enhanced@2.2.1",
"_id": "@mrmlnc/readdir-enhanced@2.2.1",
"_inBundle": false,
"_integrity": "sha1-UkryQNGjYFJ7cwR17PoTRKpUDd4=",
"_location": "/@mrmlnc/readdir-enhanced",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@mrmlnc/readdir-enhanced@2.2.1",
"name": "@mrmlnc/readdir-enhanced",
"escapedName": "@mrmlnc%2freaddir-enhanced",
"scope": "@mrmlnc",
"rawSpec": "2.2.1",
"saveSpec": null,
"fetchSpec": "2.2.1"
},
"_requiredBy": [
"/fast-glob"
],
"_resolved": "http://registry.npm.taobao.org/@mrmlnc/readdir-enhanced/download/@mrmlnc/readdir-enhanced-2.2.1.tgz",
"_spec": "2.2.1",
"_where": "/Users/wanghongyuan/generator-dbgame",
"author": {
"name": "James Messinger",
"url": "http://bigstickcarpet.com"
},
"bugs": {
"url": "https://github.com/bigstickcarpet/readdir-enhanced/issues"
},
"dependencies": {
"call-me-maybe": "^1.0.1",
"glob-to-regexp": "^0.3.0"
},
"description": "fs.readdir with sync, async, and streaming APIs + filtering, recursion, absolute paths, etc.",
"devDependencies": {
"chai": "^4.1.2",
"codacy-coverage": "^2.0.3",
"coveralls": "^3.0.0",
"del": "^3.0.0",
"eslint": "^4.15.0",
"eslint-config-modular": "^4.1.1",
"istanbul": "^0.4.5",
"mkdirp": "^0.5.1",
"mocha": "^4.1.0",
"npm-check": "^5.5.2",
"through2": "^2.0.3",
"version-bump-prompt": "^4.0.0"
},
"engines": {
"node": ">=4"
},
"files": [
"lib",
"types.d.ts"
],
"homepage": "https://github.com/bigstickcarpet/readdir-enhanced",
"keywords": [
"fs",
"readdir",
"stream",
"event",
"recursive",
"deep",
"filter",
"absolute"
],
"license": "MIT",
"main": "lib/index.js",
"name": "@mrmlnc/readdir-enhanced",
"repository": {
"type": "git",
"url": "git+https://github.com/bigstickcarpet/readdir-enhanced.git"
},
"scripts": {
"bump": "bump --prompt --tag --push --all",
"cover": "istanbul cover _mocha",
"lint": "eslint lib test --fix",
"release": "npm run upgrade && npm test && npm run bump && npm publish",
"test": "mocha && npm run lint",
"upgrade": "npm-check -u"
},
"typings": "types.d.ts",
"version": "2.2.1"
}
/// <reference types="node" />
import fs = require('fs');
declare namespace re {
interface Entry extends fs.Stats {
path: string;
depth: number;
}
type FilterFunction = (stat: Entry) => boolean;
type Callback<T> = (err: NodeJS.ErrnoException, result: T) => void;
type CallbackString = Callback<string[]>;
type CallbackEntry = Callback<Entry[]>;
interface FileSystem {
readdir?: (path: string, callback: Callback<string[]>) => void;
lstat?: (path: string, callback: Callback<fs.Stats>) => void;
stat?: (path: string, callback: Callback<fs.Stats>) => void;
}
interface Options {
filter?: string | RegExp | FilterFunction;
deep?: boolean | number | RegExp | FilterFunction;
sep?: string;
basePath?: string;
fs?: FileSystem;
}
function stat(root: string, options?: Options): Promise<Entry[]>;
function stat(root: string, callback: CallbackEntry): void;
function stat(root: string, options: Options, callback: CallbackEntry): void;
function async(root: string, options?: Options): Promise<string[]>;
function async(root: string, callback: CallbackString): void;
function async(root: string, options: Options, callback: CallbackString): void;
function readdirAsyncStat(root: string, options?: Options): Promise<Entry[]>;
function readdirAsyncStat(root: string, callback: CallbackEntry): void;
function readdirAsyncStat(root: string, options: Options, callback: CallbackEntry): void;
namespace async {
function stat(root: string, options?: Options): Promise<Entry[]>;
function stat(root: string, callback: CallbackEntry): void;
function stat(root: string, options: Options, callback: CallbackEntry): void;
}
function stream(root: string, options?: Options): NodeJS.ReadableStream;
function readdirStreamStat(root: string, options?: Options): NodeJS.ReadableStream;
namespace stream {
function stat(root: string, options?: Options): NodeJS.ReadableStream;
}
function sync(root: string, options?: Options): string[];
function readdirSyncStat(root: string, options?: Options): Entry[];
namespace sync {
function stat(root: string, options?: Options): Entry[];
}
}
declare function re(root: string, options?: re.Options): Promise<string[]>;
declare function re(root: string, callback: re.CallbackString): void;
declare function re(root: string, options: re.Options, callback: re.CallbackString): void;
export = re;
# @nodelib/fs.stat
> Get the status of a file with some features.
## :bulb: Highlights
Wrapper over standard methods ([`fs.lstat`](https://nodejs.org/dist/latest/docs/api/fs.html#fs_fs_lstat_path_callback), [`fs.stat`](https://nodejs.org/dist/latest/docs/api/fs.html#fs_fs_stat_path_callback)) with some features.
* :beginner: Normally follows symlinks.
* :gear: Can safely work with broken symlinks (returns information about symlink instead of generating an error).
## Install
```
$ npm install @nodelib/fs.stat
```
## Usage
```js
const fsStat = require('@nodelib/fs.stat');
fsStat.stat('path').then((stat) => {
console.log(stat); // => fs.Stats
});
```
## API
### fsStat.stat(path, [options])
Returns a [`Promise<fs.Stats>`](https://nodejs.org/dist/latest/docs/api/fs.html#fs_class_fs_stats) for provided path.
### fsStat.statSync(path, [options])
Returns a [`fs.Stats`](https://nodejs.org/dist/latest/docs/api/fs.html#fs_class_fs_stats) for provided path.
### fsStat.statCallback(path, [options], callback)
Returns a [`fs.Stats`](https://nodejs.org/dist/latest/docs/api/fs.html#fs_class_fs_stats) for provided path with standard callback-style.
#### path
* Type: `string | Buffer | URL`
The `path` argument for [`fs.lstat`](https://nodejs.org/dist/latest/docs/api/fs.html#fs_fs_lstat_path_callback) or [`fs.stat`](https://nodejs.org/dist/latest/docs/api/fs.html#fs_fs_stat_path_callback) method.
#### options
* Type: `Object`
See [options](#options-1) section for more detailed information.
## Options
### throwErrorOnBrokenSymlinks
* Type: `boolean`
* Default: `true`
Throw an error or return information about symlink, when symlink is broken. When `false`, methods will be return lstat call for broken symlinks.
### followSymlinks
* Type: `boolean`
* Default: `true`
By default, the methods of this package follows symlinks. If you do not want it, set this option to `false` or use the standard method [`fs.lstat`](https://nodejs.org/dist/latest/docs/api/fs.html#fs_fs_lstat_path_callback).
### fs
* Type: `FileSystemAdapter`
* Default: `built-in FS methods`
By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace each method with your own.
```ts
interface FileSystemAdapter {
lstat?: typeof fs.lstat;
stat?: typeof fs.stat;
lstatSync?: typeof fs.lstatSync;
statSync?: typeof fs.statSync;
}
```
## Changelog
See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelogs for each release version.
## License
This software is released under the terms of the MIT license.
/// <reference types="node" />
import * as fs from 'fs';
export interface FileSystemAdapter {
lstat: typeof fs.lstat;
stat: typeof fs.stat;
lstatSync: typeof fs.lstatSync;
statSync: typeof fs.statSync;
}
export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter;
export declare function getFileSystemAdapter(fsMethods?: Partial<FileSystemAdapter>): FileSystemAdapter;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs");
exports.FILE_SYSTEM_ADAPTER = {
lstat: fs.lstat,
stat: fs.stat,
lstatSync: fs.lstatSync,
statSync: fs.statSync
};
function getFileSystemAdapter(fsMethods) {
if (!fsMethods) {
return exports.FILE_SYSTEM_ADAPTER;
}
return Object.assign({}, exports.FILE_SYSTEM_ADAPTER, fsMethods);
}
exports.getFileSystemAdapter = getFileSystemAdapter;
/// <reference types="node" />
import * as fs from 'fs';
import { FileSystemAdapter } from './adapters/fs';
import { Options } from './managers/options';
import { AsyncCallback } from './providers/stat';
/**
* Asynchronous API.
*/
export declare function stat(path: fs.PathLike, opts?: Options): Promise<fs.Stats>;
/**
* Callback API.
*/
export declare function statCallback(path: fs.PathLike, callback: AsyncCallback): void;
export declare function statCallback(path: fs.PathLike, opts: Options, callback: AsyncCallback): void;
/**
* Synchronous API.
*/
export declare function statSync(path: fs.PathLike, opts?: Options): fs.Stats;
export declare type Options = Options;
export declare type StatAsyncCallback = AsyncCallback;
export declare type FileSystemAdapter = FileSystemAdapter;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const optionsManager = require("./managers/options");
const statProvider = require("./providers/stat");
/**
* Asynchronous API.
*/
function stat(path, opts) {
return new Promise((resolve, reject) => {
statProvider.async(path, optionsManager.prepare(opts), (err, stats) => err ? reject(err) : resolve(stats));
});
}
exports.stat = stat;
function statCallback(path, optsOrCallback, callback) {
if (typeof optsOrCallback === 'function') {
callback = optsOrCallback; /* tslint:disable-line: no-parameter-reassignment */
optsOrCallback = undefined; /* tslint:disable-line: no-parameter-reassignment */
}
if (typeof callback === 'undefined') {
throw new TypeError('The "callback" argument must be of type Function.');
}
statProvider.async(path, optionsManager.prepare(optsOrCallback), callback);
}
exports.statCallback = statCallback;
/**
* Synchronous API.
*/
function statSync(path, opts) {
return statProvider.sync(path, optionsManager.prepare(opts));
}
exports.statSync = statSync;
import { FileSystemAdapter } from '../adapters/fs';
export interface Options {
fs?: Partial<FileSystemAdapter>;
throwErrorOnBrokenSymlinks?: boolean;
followSymlinks?: boolean;
}
export declare type StrictOptions = {
fs: FileSystemAdapter;
} & Required<Options>;
export declare function prepare(opts?: Options): StrictOptions;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fsAdapter = require("../adapters/fs");
function prepare(opts) {
const options = Object.assign({
fs: fsAdapter.getFileSystemAdapter(opts ? opts.fs : undefined),
throwErrorOnBrokenSymlinks: true,
followSymlinks: true
}, opts);
return options;
}
exports.prepare = prepare;
/// <reference types="node" />
import * as fs from 'fs';
import { StrictOptions } from '../managers/options';
export declare function sync(path: fs.PathLike, options: StrictOptions): fs.Stats;
export declare type AsyncCallback = (err: NodeJS.ErrnoException | null, stats?: fs.Stats) => void;
export declare function async(path: fs.PathLike, options: StrictOptions, callback: AsyncCallback): void;
/**
* Returns `true` for followed symlink.
*/
export declare function isFollowedSymlink(stat: fs.Stats, options: StrictOptions): boolean;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function sync(path, options) {
const lstat = options.fs.lstatSync(path);
if (!isFollowedSymlink(lstat, options)) {
return lstat;
}
try {
const stat = options.fs.statSync(path);
stat.isSymbolicLink = () => true;
return stat;
}
catch (err) {
if (!options.throwErrorOnBrokenSymlinks) {
return lstat;
}
throw err;
}
}
exports.sync = sync;
function async(path, options, callback) {
options.fs.lstat(path, (err0, lstat) => {
if (err0) {
return callback(err0, undefined);
}
if (!isFollowedSymlink(lstat, options)) {
return callback(null, lstat);
}
options.fs.stat(path, (err1, stat) => {
if (err1) {
return options.throwErrorOnBrokenSymlinks ? callback(err1) : callback(null, lstat);
}
stat.isSymbolicLink = () => true;
callback(null, stat);
});
});
}
exports.async = async;
/**
* Returns `true` for followed symlink.
*/
function isFollowedSymlink(stat, options) {
return stat.isSymbolicLink() && options.followSymlinks;
}
exports.isFollowedSymlink = isFollowedSymlink;
{
"_from": "@nodelib/fs.stat@^1.0.1",
"_id": "@nodelib/fs.stat@1.1.0",
"_inBundle": false,
"_integrity": "sha1-UMHiJgrA7ZQ5oYHeNyWgFo1ZxIo=",
"_location": "/@nodelib/fs.stat",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@nodelib/fs.stat@^1.0.1",
"name": "@nodelib/fs.stat",
"escapedName": "@nodelib%2ffs.stat",
"scope": "@nodelib",
"rawSpec": "^1.0.1",
"saveSpec": null,
"fetchSpec": "^1.0.1"
},
"_requiredBy": [
"/fast-glob"
],
"_resolved": "http://registry.npm.taobao.org/@nodelib/fs.stat/download/@nodelib/fs.stat-1.1.0.tgz",
"_shasum": "50c1e2260ac0ed9439a181de3725a0168d59c48a",
"_spec": "@nodelib/fs.stat@^1.0.1",
"_where": "/Users/wanghongyuan/generator-dbgame/node_modules/fast-glob",
"bundleDependencies": false,
"deprecated": false,
"description": "Get the status of a file with some features",
"engines": {
"node": ">= 6"
},
"gitHead": "12bf340ba9630871dbe8d1df874d65b46c8d4ab7",
"keywords": [
"NodeLib",
"fs",
"FileSystem",
"file system",
"stat"
],
"license": "MIT",
"main": "out/index.js",
"name": "@nodelib/fs.stat",
"repository": {
"type": "git",
"url": "https://github.com/nodelib/nodelib/tree/master/packages/fs.stat"
},
"scripts": {
"build": "npm run clean && npm run lint && npm run compile && npm test",
"clean": "rimraf out",
"compile": "tsc -p .",
"lint": "tslint \"src/**/*.ts\" -p . -t stylish",
"test": "mocha \"out/**/*.spec.js\" -s 0",
"watch": "npm run clean && npm run lint && npm run compile -- --sourceMap --watch"
},
"typings": "out/index.d.ts",
"version": "1.1.0"
}
(The BSD License)
Copyright (c) 2010-2012, Christian Johansen (christian@cjohansen.no) and
August Lilleaas (august.lilleaas@gmail.com). 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 Christian Johansen nor the names of his 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 THE COPYRIGHT HOLDER OR CONTRIBUTORS 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.
# formatio
[![Build status](https://secure.travis-ci.org/sinonjs/formatio.svg?branch=master)](http://travis-ci.org/sinonjs/formatio)
[![Coverage Status](https://coveralls.io/repos/github/sinonjs/formatio/badge.svg?branch=master)](https://coveralls.io/github/sinonjs/formatio?branch=master)
> The cheesy object formatter
Pretty formatting of arbitrary JavaScript values. Currently only supports ascii
formatting, suitable for command-line utilities. Like `JSON.stringify`, it
formats objects recursively, but unlike `JSON.stringify`, it can handle
regular expressions, functions, circular objects and more.
`formatio` is a general-purpose library. It works in browsers (including old
and rowdy ones, like IE6) and Node. It will define itself as an AMD module if
you want it to (i.e. if there's a `define` function available).
Documentation: https://sinonjs.github.io/formatio/
## Backers
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/sinon#backer)]
<a href="https://opencollective.com/sinon/backer/0/website" target="_blank"><img src="https://opencollective.com/sinon/backer/0/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/1/website" target="_blank"><img src="https://opencollective.com/sinon/backer/1/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/2/website" target="_blank"><img src="https://opencollective.com/sinon/backer/2/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/3/website" target="_blank"><img src="https://opencollective.com/sinon/backer/3/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/4/website" target="_blank"><img src="https://opencollective.com/sinon/backer/4/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/5/website" target="_blank"><img src="https://opencollective.com/sinon/backer/5/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/6/website" target="_blank"><img src="https://opencollective.com/sinon/backer/6/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/7/website" target="_blank"><img src="https://opencollective.com/sinon/backer/7/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/8/website" target="_blank"><img src="https://opencollective.com/sinon/backer/8/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/9/website" target="_blank"><img src="https://opencollective.com/sinon/backer/9/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/10/website" target="_blank"><img src="https://opencollective.com/sinon/backer/10/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/11/website" target="_blank"><img src="https://opencollective.com/sinon/backer/11/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/12/website" target="_blank"><img src="https://opencollective.com/sinon/backer/12/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/13/website" target="_blank"><img src="https://opencollective.com/sinon/backer/13/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/14/website" target="_blank"><img src="https://opencollective.com/sinon/backer/14/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/15/website" target="_blank"><img src="https://opencollective.com/sinon/backer/15/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/16/website" target="_blank"><img src="https://opencollective.com/sinon/backer/16/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/17/website" target="_blank"><img src="https://opencollective.com/sinon/backer/17/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/18/website" target="_blank"><img src="https://opencollective.com/sinon/backer/18/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/19/website" target="_blank"><img src="https://opencollective.com/sinon/backer/19/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/20/website" target="_blank"><img src="https://opencollective.com/sinon/backer/20/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/21/website" target="_blank"><img src="https://opencollective.com/sinon/backer/21/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/22/website" target="_blank"><img src="https://opencollective.com/sinon/backer/22/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/23/website" target="_blank"><img src="https://opencollective.com/sinon/backer/23/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/24/website" target="_blank"><img src="https://opencollective.com/sinon/backer/24/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/25/website" target="_blank"><img src="https://opencollective.com/sinon/backer/25/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/26/website" target="_blank"><img src="https://opencollective.com/sinon/backer/26/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/27/website" target="_blank"><img src="https://opencollective.com/sinon/backer/27/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/28/website" target="_blank"><img src="https://opencollective.com/sinon/backer/28/avatar.svg"></a>
<a href="https://opencollective.com/sinon/backer/29/website" target="_blank"><img src="https://opencollective.com/sinon/backer/29/avatar.svg"></a>
## Sponsors
Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor](https://opencollective.com/sinon#sponsor)]
<a href="https://opencollective.com/sinon/sponsor/0/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/1/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/2/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/3/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/4/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/5/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/6/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/7/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/8/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/9/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/9/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/10/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/10/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/11/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/11/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/12/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/12/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/13/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/13/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/14/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/14/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/15/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/15/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/16/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/16/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/17/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/17/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/18/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/18/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/19/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/19/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/20/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/20/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/21/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/21/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/22/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/22/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/23/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/23/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/24/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/24/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/25/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/25/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/26/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/26/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/27/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/27/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/28/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/28/avatar.svg"></a>
<a href="https://opencollective.com/sinon/sponsor/29/website" target="_blank"><img src="https://opencollective.com/sinon/sponsor/29/avatar.svg"></a>
## Licence
samsam was released under [BSD-3](LICENSE)
(function (root, factory) {
"use strict";
if (typeof define === "function" && define.amd) {
// AMD. Register as an anonymous module.
define(["samsam"], factory);
} else if (typeof module === "object" && module.exports) {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require("samsam"));
} else {
// Browser globals (root is window)
root.formatio = factory(root.samsam);
}
}(typeof self !== "undefined" ? self : this, function (samsam) {
"use strict";
var formatio = {
excludeConstructors: ["Object", /^.$/],
quoteStrings: true,
limitChildrenCount: 0
};
var specialObjects = [];
if (typeof global !== "undefined") {
specialObjects.push({ object: global, value: "[object global]" });
}
if (typeof document !== "undefined") {
specialObjects.push({
object: document,
value: "[object HTMLDocument]"
});
}
if (typeof window !== "undefined") {
specialObjects.push({ object: window, value: "[object Window]" });
}
function functionName(func) {
if (!func) { return ""; }
if (func.displayName) { return func.displayName; }
if (func.name) { return func.name; }
var matches = func.toString().match(/function\s+([^\(]+)/m);
return (matches && matches[1]) || "";
}
function constructorName(f, object) {
var name = functionName(object && object.constructor);
var excludes = f.excludeConstructors ||
formatio.excludeConstructors || [];
var i, l;
for (i = 0, l = excludes.length; i < l; ++i) {
if (typeof excludes[i] === "string" && excludes[i] === name) {
return "";
} else if (excludes[i].test && excludes[i].test(name)) {
return "";
}
}
return name;
}
function isCircular(object, objects) {
if (typeof object !== "object") { return false; }
var i, l;
for (i = 0, l = objects.length; i < l; ++i) {
if (objects[i] === object) { return true; }
}
return false;
}
function ascii(f, object, processed, indent) {
if (typeof object === "string") {
if (object.length === 0) { return "(empty string)"; }
var qs = f.quoteStrings;
var quote = typeof qs !== "boolean" || qs;
return processed || quote ? "\"" + object + "\"" : object;
}
if (typeof object === "function" && !(object instanceof RegExp)) {
return ascii.func(object);
}
processed = processed || [];
if (isCircular(object, processed)) { return "[Circular]"; }
if (Object.prototype.toString.call(object) === "[object Array]") {
return ascii.array.call(f, object, processed);
}
if (!object) { return String((1 / object) === -Infinity ? "-0" : object); }
if (samsam.isElement(object)) { return ascii.element(object); }
if (typeof object.toString === "function" &&
object.toString !== Object.prototype.toString) {
return object.toString();
}
var i, l;
for (i = 0, l = specialObjects.length; i < l; i++) {
if (object === specialObjects[i].object) {
return specialObjects[i].value;
}
}
if (typeof Set !== "undefined" && object instanceof Set) {
return ascii.set.call(f, object, processed);
}
return ascii.object.call(f, object, processed, indent);
}
ascii.func = function (func) {
return "function " + functionName(func) + "() {}";
};
function delimit(str, delimiters) {
delimiters = delimiters || ["[", "]"];
return delimiters[0] + str + delimiters[1];
}
ascii.array = function (array, processed, delimiters) {
processed = processed || [];
processed.push(array);
var pieces = [];
var i, l;
l = (this.limitChildrenCount > 0) ?
Math.min(this.limitChildrenCount, array.length) : array.length;
for (i = 0; i < l; ++i) {
pieces.push(ascii(this, array[i], processed));
}
if (l < array.length) {
pieces.push("[... " + (array.length - l) + " more elements]");
}
return delimit(pieces.join(", "), delimiters);
};
ascii.set = function (set, processed) {
return ascii.array.call(this, Array.from(set), processed, ["Set {", "}"]);
};
ascii.object = function (object, processed, indent) {
processed = processed || [];
processed.push(object);
indent = indent || 0;
var pieces = [];
var properties = samsam.keys(object).sort();
var length = 3;
var prop, str, obj, i, k, l;
l = (this.limitChildrenCount > 0) ?
Math.min(this.limitChildrenCount, properties.length) : properties.length;
for (i = 0; i < l; ++i) {
prop = properties[i];
obj = object[prop];
if (isCircular(obj, processed)) {
str = "[Circular]";
} else {
str = ascii(this, obj, processed, indent + 2);
}
str = (/\s/.test(prop) ? "\"" + prop + "\"" : prop) + ": " + str;
length += str.length;
pieces.push(str);
}
var cons = constructorName(this, object);
var prefix = cons ? "[" + cons + "] " : "";
var is = "";
for (i = 0, k = indent; i < k; ++i) { is += " "; }
if (l < properties.length)
{pieces.push("[... " + (properties.length - l) + " more elements]");}
if (length + indent > 80) {
return prefix + "{\n " + is + pieces.join(",\n " + is) + "\n" +
is + "}";
}
return prefix + "{ " + pieces.join(", ") + " }";
};
ascii.element = function (element) {
var tagName = element.tagName.toLowerCase();
var attrs = element.attributes;
var pairs = [];
var attr, attrName, i, l, val;
for (i = 0, l = attrs.length; i < l; ++i) {
attr = attrs.item(i);
attrName = attr.nodeName.toLowerCase().replace("html:", "");
val = attr.nodeValue;
if (attrName !== "contenteditable" || val !== "inherit") {
if (val) { pairs.push(attrName + "=\"" + val + "\""); }
}
}
var formatted = "<" + tagName + (pairs.length > 0 ? " " : "");
// SVG elements have undefined innerHTML
var content = element.innerHTML || "";
if (content.length > 20) {
content = content.substr(0, 20) + "[...]";
}
var res = formatted + pairs.join(" ") + ">" + content +
"</" + tagName + ">";
return res.replace(/ contentEditable="inherit"/, "");
};
function Formatio(options) {
// eslint-disable-next-line guard-for-in
for (var opt in options) {
this[opt] = options[opt];
}
}
Formatio.prototype = {
functionName: functionName,
configure: function (options) {
return new Formatio(options);
},
constructorName: function (object) {
return constructorName(this, object);
},
ascii: function (object, processed, indent) {
return ascii(this, object, processed, indent);
}
};
return Formatio.prototype;
}));
{
"_args": [
[
"@sinonjs/formatio@2.0.0",
"/Users/wanghongyuan/generator-dbgame"
]
],
"_development": true,
"_from": "@sinonjs/formatio@2.0.0",
"_id": "@sinonjs/formatio@2.0.0",
"_inBundle": false,
"_integrity": "sha1-hNt+nrVTHfGKjF4L+25EnlXmVLI=",
"_location": "/@sinonjs/formatio",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@sinonjs/formatio@2.0.0",
"name": "@sinonjs/formatio",
"escapedName": "@sinonjs%2fformatio",
"scope": "@sinonjs",
"rawSpec": "2.0.0",
"saveSpec": null,
"fetchSpec": "2.0.0"
},
"_requiredBy": [
"/nise",
"/sinon"
],
"_resolved": "http://registry.npm.taobao.org/@sinonjs/formatio/download/@sinonjs/formatio-2.0.0.tgz",
"_spec": "2.0.0",
"_where": "/Users/wanghongyuan/generator-dbgame",
"author": {
"name": "Christian Johansen"
},
"bugs": {
"url": "https://github.com/sinonjs/formatio/issues"
},
"dependencies": {
"samsam": "1.3.0"
},
"description": "Human-readable object formatting",
"devDependencies": {
"eslint": "4.16.0",
"eslint-config-sinon": "1.0.3",
"eslint-plugin-ie11": "1.0.0",
"eslint-plugin-mocha": "4.11.0",
"mocha": "5.0.0",
"nyc": "11.4.1",
"referee": "1.2.0"
},
"files": [
"lib/**/*[^test].js"
],
"homepage": "http://busterjs.org/docs/formatio/",
"license": "BSD-3-Clause",
"main": "./lib/formatio",
"name": "@sinonjs/formatio",
"repository": {
"type": "git",
"url": "git+https://github.com/sinonjs/formatio.git"
},
"scripts": {
"lint": "eslint .",
"test": "mocha 'lib/**/*.test.js'",
"test-coverage": "nyc --reporter text --reporter html --reporter lcovonly npm run test"
},
"version": "2.0.0"
}
## 1.0.4
- Added license file
## 1.0.3
- Replaced `let` with `var` in `lib/btoa.js`
- Follow up from `1.0.2`
- Resolves https://github.com/jsdom/abab/issues/18
## 1.0.2
- Replaced `const` with `var` in `index.js`
- Allows use of `abab` in the browser without a transpilation step
- Resolves https://github.com/jsdom/abab/issues/15
Both the original source code and new contributions in this repository are released under the [W3C 3-clause BSD license](https://github.com/w3c/web-platform-tests/blob/master/LICENSE.md#w3c-3-clause-bsd-license).
# W3C 3-clause BSD License
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of works must retain the original copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the original 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 W3C nor the names of its contributors may be used to endorse or promote products derived from this work 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 THE COPYRIGHT OWNER OR CONTRIBUTORS 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.
# abab
[![npm version](https://badge.fury.io/js/abab.svg)](https://www.npmjs.com/package/abab) [![Build Status](https://travis-ci.org/jsdom/abab.svg?branch=master)](https://travis-ci.org/jsdom/abab)
A module that implements `window.atob` and `window.btoa` according to the [WHATWG spec](https://html.spec.whatwg.org/multipage/webappapis.html#atob). The code is originally from [w3c/web-platform-tests](https://github.com/w3c/web-platform-tests/blob/master/html/webappapis/atob/base64.html).
Compatibility: Node.js version 3+ and all major browsers (using browserify or webpack)
Install with `npm`:
```sh
npm install abab
```
## API
### `btoa` (base64 encode)
```js
const btoa = require('abab').btoa;
btoa('Hello, world!'); // 'SGVsbG8sIHdvcmxkIQ=='
```
### `atob` (base64 decode)
```js
const atob = require('abab').atob;
atob('SGVsbG8sIHdvcmxkIQ=='); // 'Hello, world!'
```
#### Valid characters
[Per the spec](https://html.spec.whatwg.org/multipage/webappapis.html#atob:dom-windowbase64-btoa-3), `btoa` will accept strings "containing only characters in the range `U+0000` to `U+00FF`." If passed a string with characters above `U+00FF`, `btoa` will return `null`. If `atob` is passed a string that is not base64-valid, it will also return `null`. In both cases when `null` is returned, the spec calls for throwing a `DOMException` of type `InvalidCharacterError`.
## Browsers
If you want to include just one of the methods to save bytes in your client-side code, you can `require` the desired module directly.
```js
var atob = require('abab/lib/atob');
var btoa = require('abab/lib/btoa');
```
-----
### Checklists
If you're **submitting a PR** or **deploying to npm**, please use the [checklists in CONTRIBUTING.md](https://github.com/jsdom/abab/blob/master/CONTRIBUTING.md#checklists)
### Remembering `atob` vs. `btoa`
Here's a mnemonic that might be useful: if you have a plain string and want to base64 encode it, then decode it, `btoa` is what you run before (**b**efore - **b**toa), and `atob` is what you run after (**a**fter - **a**tob).
'use strict';
var atob = require('./lib/atob');
var btoa = require('./lib/btoa');
module.exports = {
atob: atob,
btoa: btoa
};
'use strict';
/**
* Implementation of atob() according to the HTML spec, except that instead of
* throwing INVALID_CHARACTER_ERR we return null.
*/
function atob(input) {
// WebIDL requires DOMStrings to just be converted using ECMAScript
// ToString, which in our case amounts to calling String().
input = String(input);
// "Remove all space characters from input."
input = input.replace(/[ \t\n\f\r]/g, '');
// "If the length of input divides by 4 leaving no remainder, then: if
// input ends with one or two U+003D EQUALS SIGN (=) characters, remove
// them from input."
if (input.length % 4 == 0 && /==?$/.test(input)) {
input = input.replace(/==?$/, '');
}
// "If the length of input divides by 4 leaving a remainder of 1, throw an
// INVALID_CHARACTER_ERR exception and abort these steps."
//
// "If input contains a character that is not in the following list of
// characters and character ranges, throw an INVALID_CHARACTER_ERR
// exception and abort these steps:
//
// U+002B PLUS SIGN (+)
// U+002F SOLIDUS (/)
// U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9)
// U+0041 LATIN CAPITAL LETTER A to U+005A LATIN CAPITAL LETTER Z
// U+0061 LATIN SMALL LETTER A to U+007A LATIN SMALL LETTER Z"
if (input.length % 4 == 1 || !/^[+/0-9A-Za-z]*$/.test(input)) {
return null;
}
// "Let output be a string, initially empty."
var output = '';
// "Let buffer be a buffer that can have bits appended to it, initially
// empty."
//
// We append bits via left-shift and or. accumulatedBits is used to track
// when we've gotten to 24 bits.
var buffer = 0;
var accumulatedBits = 0;
// "While position does not point past the end of input, run these
// substeps:"
for (var i = 0; i < input.length; i++) {
// "Find the character pointed to by position in the first column of
// the following table. Let n be the number given in the second cell of
// the same row."
//
// "Append to buffer the six bits corresponding to number, most
// significant bit first."
//
// atobLookup() implements the table from the spec.
buffer <<= 6;
buffer |= atobLookup(input[i]);
// "If buffer has accumulated 24 bits, interpret them as three 8-bit
// big-endian numbers. Append the three characters with code points
// equal to those numbers to output, in the same order, and then empty
// buffer."
accumulatedBits += 6;
if (accumulatedBits == 24) {
output += String.fromCharCode((buffer & 0xff0000) >> 16);
output += String.fromCharCode((buffer & 0xff00) >> 8);
output += String.fromCharCode(buffer & 0xff);
buffer = accumulatedBits = 0;
}
// "Advance position by one character."
}
// "If buffer is not empty, it contains either 12 or 18 bits. If it
// contains 12 bits, discard the last four and interpret the remaining
// eight as an 8-bit big-endian number. If it contains 18 bits, discard the
// last two and interpret the remaining 16 as two 8-bit big-endian numbers.
// Append the one or two characters with code points equal to those one or
// two numbers to output, in the same order."
if (accumulatedBits == 12) {
buffer >>= 4;
output += String.fromCharCode(buffer);
} else if (accumulatedBits == 18) {
buffer >>= 2;
output += String.fromCharCode((buffer & 0xff00) >> 8);
output += String.fromCharCode(buffer & 0xff);
}
// "Return output."
return output;
}
/**
* A lookup table for atob(), which converts an ASCII character to the
* corresponding six-bit number.
*/
function atobLookup(chr) {
if (/[A-Z]/.test(chr)) {
return chr.charCodeAt(0) - 'A'.charCodeAt(0);
}
if (/[a-z]/.test(chr)) {
return chr.charCodeAt(0) - 'a'.charCodeAt(0) + 26;
}
if (/[0-9]/.test(chr)) {
return chr.charCodeAt(0) - '0'.charCodeAt(0) + 52;
}
if (chr == '+') {
return 62;
}
if (chr == '/') {
return 63;
}
// Throw exception; should not be hit in tests
}
module.exports = atob;
'use strict';
/**
* btoa() as defined by the HTML5 spec, which mostly just references RFC4648.
*/
function btoa(s) {
var i;
// String conversion as required by WebIDL.
s = String(s);
// "The btoa() method must throw an INVALID_CHARACTER_ERR exception if the
// method's first argument contains any character whose code point is
// greater than U+00FF."
for (i = 0; i < s.length; i++) {
if (s.charCodeAt(i) > 255) {
return null;
}
}
var out = '';
for (i = 0; i < s.length; i += 3) {
var groupsOfSix = [undefined, undefined, undefined, undefined];
groupsOfSix[0] = s.charCodeAt(i) >> 2;
groupsOfSix[1] = (s.charCodeAt(i) & 0x03) << 4;
if (s.length > i + 1) {
groupsOfSix[1] |= s.charCodeAt(i + 1) >> 4;
groupsOfSix[2] = (s.charCodeAt(i + 1) & 0x0f) << 2;
}
if (s.length > i + 2) {
groupsOfSix[2] |= s.charCodeAt(i + 2) >> 6;
groupsOfSix[3] = s.charCodeAt(i + 2) & 0x3f;
}
for (var j = 0; j < groupsOfSix.length; j++) {
if (typeof groupsOfSix[j] == 'undefined') {
out += '=';
} else {
out += btoaLookup(groupsOfSix[j]);
}
}
}
return out;
}
/**
* Lookup table for btoa(), which converts a six-bit number into the
* corresponding ASCII character.
*/
function btoaLookup(idx) {
if (idx < 26) {
return String.fromCharCode(idx + 'A'.charCodeAt(0));
}
if (idx < 52) {
return String.fromCharCode(idx - 26 + 'a'.charCodeAt(0));
}
if (idx < 62) {
return String.fromCharCode(idx - 52 + '0'.charCodeAt(0));
}
if (idx == 62) {
return '+';
}
if (idx == 63) {
return '/';
}
// Throw INVALID_CHARACTER_ERR exception here -- won't be hit in the tests.
}
module.exports = btoa;
{
"_from": "abab@^1.0.4",
"_id": "abab@1.0.4",
"_inBundle": false,
"_integrity": "sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4=",
"_location": "/abab",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "abab@^1.0.4",
"name": "abab",
"escapedName": "abab",
"rawSpec": "^1.0.4",
"saveSpec": null,
"fetchSpec": "^1.0.4"
},
"_requiredBy": [
"/data-urls",
"/jsdom"
],
"_resolved": "http://registry.npm.taobao.org/abab/download/abab-1.0.4.tgz",
"_shasum": "5faad9c2c07f60dd76770f71cf025b62a63cfd4e",
"_spec": "abab@^1.0.4",
"_where": "/Users/wanghongyuan/generator-dbgame/node_modules/jsdom",
"author": {
"name": "Jeff Carpenter",
"email": "gcarpenterv@gmail.com"
},
"bugs": {
"url": "https://github.com/jsdom/abab/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "WHATWG spec-compliant implementations of window.atob and window.btoa.",
"devDependencies": {
"babel-core": "^6.1.4",
"babel-loader": "^6.1.0",
"babel-preset-es2015": "^6.1.4",
"eslint": "^1.3.1",
"jscs": "^2.1.1",
"karma": "^0.13.10",
"karma-cli": "^0.1.1",
"karma-firefox-launcher": "^0.1.6",
"karma-mocha": "^0.2.0",
"karma-sauce-launcher": "^0.2.14",
"karma-webpack": "^1.7.0",
"mocha": "^2.2.5",
"webpack": "^1.12.2"
},
"files": [
"index.js",
"lib/"
],
"homepage": "https://github.com/jsdom/abab#readme",
"keywords": [
"atob",
"btoa",
"browser"
],
"license": "ISC",
"main": "index.js",
"name": "abab",
"repository": {
"type": "git",
"url": "git+https://github.com/jsdom/abab.git"
},
"scripts": {
"karma": "karma start",
"lint": "jscs . && eslint .",
"mocha": "mocha test/node",
"test": "npm run lint && npm run mocha && npm run karma"
},
"version": "1.0.4"
}
{
"_from": "abbrev@1",
"_id": "abbrev@1.1.1",
"_inBundle": false,
"_integrity": "sha1-+PLIh60Qv2f2NPAFtph/7TF5qsg=",
"_location": "/abbrev",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "abbrev@1",
"name": "abbrev",
"escapedName": "abbrev",
"rawSpec": "1",
"saveSpec": null,
"fetchSpec": "1"
},
"_requiredBy": [
"/node-pre-gyp/nopt",
"/nopt"
],
"_resolved": "http://registry.npm.taobao.org/abbrev/download/abbrev-1.1.1.tgz",
"_shasum": "f8f2c887ad10bf67f634f005b6987fed3179aac8",
"_spec": "abbrev@1",
"_where": "/Users/wanghongyuan/generator-dbgame/node_modules/nopt",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me"
},
"bugs": {
"url": "https://github.com/isaacs/abbrev-js/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Like ruby's abbrev module, but in js",
"devDependencies": {
"tap": "^10.1"
},
"files": [
"abbrev.js"
],
"homepage": "https://github.com/isaacs/abbrev-js#readme",
"license": "ISC",
"main": "abbrev.js",
"name": "abbrev",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/isaacs/abbrev-js.git"
},
"scripts": {
"postpublish": "git push origin --all; git push origin --tags",
"postversion": "npm publish",
"preversion": "npm test",
"test": "tap test.js --100"
},
"version": "1.1.1"
}
Copyright (c) 2014 Forbes Lindesay
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.
\ No newline at end of file
# acorn-globals
Detect global variables in JavaScript using acorn
[![Build Status](https://img.shields.io/travis/ForbesLindesay/acorn-globals/master.svg)](https://travis-ci.org/ForbesLindesay/acorn-globals)
[![Dependency Status](https://img.shields.io/david/ForbesLindesay/acorn-globals.svg)](https://david-dm.org/ForbesLindesay/acorn-globals)
[![NPM version](https://img.shields.io/npm/v/acorn-globals.svg)](https://www.npmjs.org/package/acorn-globals)
## Installation
npm install acorn-globals
## Usage
detect.js
```js
var fs = require('fs');
var detect = require('acorn-globals');
var src = fs.readFileSync(__dirname + '/input.js', 'utf8');
var scope = detect(src);
console.dir(scope);
```
input.js
```js
var x = 5;
var y = 3, z = 2;
w.foo();
w = 2;
RAWR=444;
RAWR.foo();
BLARG=3;
foo(function () {
var BAR = 3;
process.nextTick(function (ZZZZZZZZZZZZ) {
console.log('beep boop');
var xyz = 4;
x += 10;
x.zzzzzz;
ZZZ=6;
});
function doom () {
}
ZZZ.foo();
});
console.log(xyz);
```
output:
```
$ node example/detect.js
[ { name: 'BLARG', nodes: [ [Object] ] },
{ name: 'RAWR', nodes: [ [Object], [Object] ] },
{ name: 'ZZZ', nodes: [ [Object], [Object] ] },
{ name: 'console', nodes: [ [Object], [Object] ] },
{ name: 'foo', nodes: [ [Object] ] },
{ name: 'process', nodes: [ [Object] ] },
{ name: 'w', nodes: [ [Object], [Object] ] },
{ name: 'xyz', nodes: [ [Object] ] } ]
```
## License
MIT
'use strict';
var acorn = require('acorn');
var walk = require('acorn/dist/walk');
function isScope(node) {
return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration' || node.type === 'ArrowFunctionExpression' || node.type === 'Program';
}
function isBlockScope(node) {
return node.type === 'BlockStatement' || isScope(node);
}
function declaresArguments(node) {
return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration';
}
function declaresThis(node) {
return node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration';
}
function reallyParse(source, options) {
var parseOptions = Object.assign({}, options,
{
allowReturnOutsideFunction: true,
allowImportExportEverywhere: true,
allowHashBang: true
}
);
return acorn.parse(source, parseOptions);
}
module.exports = findGlobals;
module.exports.parse = reallyParse;
function findGlobals(source, options) {
options = options || {};
var globals = [];
var ast;
// istanbul ignore else
if (typeof source === 'string') {
ast = reallyParse(source, options);
} else {
ast = source;
}
// istanbul ignore if
if (!(ast && typeof ast === 'object' && ast.type === 'Program')) {
throw new TypeError('Source must be either a string of JavaScript or an acorn AST');
}
var declareFunction = function (node) {
var fn = node;
fn.locals = fn.locals || {};
node.params.forEach(function (node) {
declarePattern(node, fn);
});
if (node.id) {
fn.locals[node.id.name] = true;
}
}
var declarePattern = function (node, parent) {
switch (node.type) {
case 'Identifier':
parent.locals[node.name] = true;
break;
case 'ObjectPattern':
node.properties.forEach(function (node) {
declarePattern(node.value, parent);
});
break;
case 'ArrayPattern':
node.elements.forEach(function (node) {
if (node) declarePattern(node, parent);
});
break;
case 'RestElement':
declarePattern(node.argument, parent);
break;
case 'AssignmentPattern':
declarePattern(node.left, parent);
break;
// istanbul ignore next
default:
throw new Error('Unrecognized pattern type: ' + node.type);
}
}
var declareModuleSpecifier = function (node, parents) {
ast.locals = ast.locals || {};
ast.locals[node.local.name] = true;
}
walk.ancestor(ast, {
'VariableDeclaration': function (node, parents) {
var parent = null;
for (var i = parents.length - 1; i >= 0 && parent === null; i--) {
if (node.kind === 'var' ? isScope(parents[i]) : isBlockScope(parents[i])) {
parent = parents[i];
}
}
parent.locals = parent.locals || {};
node.declarations.forEach(function (declaration) {
declarePattern(declaration.id, parent);
});
},
'FunctionDeclaration': function (node, parents) {
var parent = null;
for (var i = parents.length - 2; i >= 0 && parent === null; i--) {
if (isScope(parents[i])) {
parent = parents[i];
}
}
parent.locals = parent.locals || {};
parent.locals[node.id.name] = true;
declareFunction(node);
},
'Function': declareFunction,
'ClassDeclaration': function (node, parents) {
var parent = null;
for (var i = parents.length - 2; i >= 0 && parent === null; i--) {
if (isScope(parents[i])) {
parent = parents[i];
}
}
parent.locals = parent.locals || {};
parent.locals[node.id.name] = true;
},
'TryStatement': function (node) {
if (node.handler === null) return;
node.handler.locals = node.handler.locals || {};
node.handler.locals[node.handler.param.name] = true;
},
'ImportDefaultSpecifier': declareModuleSpecifier,
'ImportSpecifier': declareModuleSpecifier,
'ImportNamespaceSpecifier': declareModuleSpecifier
});
function identifier(node, parents) {
var name = node.name;
if (name === 'undefined') return;
for (var i = 0; i < parents.length; i++) {
if (name === 'arguments' && declaresArguments(parents[i])) {
return;
}
if (parents[i].locals && name in parents[i].locals) {
return;
}
}
node.parents = parents;
globals.push(node);
}
walk.ancestor(ast, {
'VariablePattern': identifier,
'Identifier': identifier,
'ThisExpression': function (node, parents) {
for (var i = 0; i < parents.length; i++) {
if (declaresThis(parents[i])) {
return;
}
}
node.parents = parents;
globals.push(node);
}
});
var groupedGlobals = {};
globals.forEach(function (node) {
var name = node.type === 'ThisExpression' ? 'this' : node.name;
groupedGlobals[name] = (groupedGlobals[name] || []);
groupedGlobals[name].push(node);
});
return Object.keys(groupedGlobals).sort().map(function (name) {
return {name: name, nodes: groupedGlobals[name]};
});
}
{
"_from": "acorn-globals@^4.1.0",
"_id": "acorn-globals@4.1.0",
"_inBundle": false,
"_integrity": "sha1-q3FgJdvhfFTT74HTLs4rLZn+JTg=",
"_location": "/acorn-globals",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "acorn-globals@^4.1.0",
"name": "acorn-globals",
"escapedName": "acorn-globals",
"rawSpec": "^4.1.0",
"saveSpec": null,
"fetchSpec": "^4.1.0"
},
"_requiredBy": [
"/jsdom"
],
"_resolved": "http://registry.npm.taobao.org/acorn-globals/download/acorn-globals-4.1.0.tgz",
"_shasum": "ab716025dbe17c54d3ef81d32ece2b2d99fe2538",
"_spec": "acorn-globals@^4.1.0",
"_where": "/Users/wanghongyuan/generator-dbgame/node_modules/jsdom",
"author": {
"name": "ForbesLindesay"
},
"bugs": {
"url": "https://github.com/ForbesLindesay/acorn-globals/issues"
},
"bundleDependencies": false,
"dependencies": {
"acorn": "^5.0.0"
},
"deprecated": false,
"description": "Detect global variables in JavaScript using acorn",
"devDependencies": {
"testit": "^3.0.0"
},
"files": [
"index.js",
"LICENSE"
],
"homepage": "https://github.com/ForbesLindesay/acorn-globals#readme",
"keywords": [
"ast",
"variable",
"name",
"lexical",
"scope",
"local",
"global",
"implicit"
],
"license": "MIT",
"name": "acorn-globals",
"repository": {
"type": "git",
"url": "git+https://github.com/ForbesLindesay/acorn-globals.git"
},
"scripts": {
"test": "node test"
},
"version": "4.1.0"
}
Copyright (C) 2012-2014 by Ingvar Stepanyan
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.
# Acorn-JSX
[![Build Status](https://travis-ci.org/RReverser/acorn-jsx.svg?branch=master)](https://travis-ci.org/RReverser/acorn-jsx)
[![NPM version](https://img.shields.io/npm/v/acorn-jsx.svg)](https://www.npmjs.org/package/acorn-jsx)
This is plugin for [Acorn](http://marijnhaverbeke.nl/acorn/) - a tiny, fast JavaScript parser, written completely in JavaScript.
It was created as an experimental alternative, faster [React.js JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) parser.
According to [benchmarks](https://github.com/RReverser/acorn-jsx/blob/master/test/bench.html), Acorn-JSX is 2x faster than official [Esprima-based parser](https://github.com/facebook/esprima) when location tracking is turned on in both (call it "source maps enabled mode"). At the same time, it consumes all the ES6+JSX syntax that can be consumed by Esprima-FB (this is proved by [official tests](https://github.com/RReverser/acorn-jsx/blob/master/test/tests-jsx.js)).
**UPDATE [14-Apr-2015]**: Facebook implementation started [deprecation process](https://github.com/facebook/esprima/issues/111) in favor of Acorn + Acorn-JSX + Babel for parsing and transpiling JSX syntax.
## Transpiler
Please note that this tool only parses source code to JSX AST, which is useful for various language tools and services. If you want to transpile your code to regular ES5-compliant JavaScript with source map, check out the [babel transpiler](https://babeljs.io/) which uses `acorn-jsx` under the hood.
## Usage
You can use module directly in order to get Acorn instance with plugin installed:
```javascript
var acorn = require('acorn-jsx');
```
Or you can use `inject.js` for injecting plugin into your own version of Acorn like following:
```javascript
var acorn = require('acorn-jsx/inject')(require('./custom-acorn'));
```
Then, use `plugins` option whenever you need to support JSX while parsing:
```javascript
var ast = acorn.parse(code, {
plugins: { jsx: true }
});
```
Note that official spec doesn't support mix of XML namespaces and object-style access in tag names (#27) like in `<namespace:Object.Property />`, so it was deprecated in `acorn-jsx@3.0`. If you still want to opt-in to support of such constructions, you can pass the following option:
```javascript
var ast = acorn.parse(code, {
plugins: {
jsx: { allowNamespacedObjects: true }
}
});
```
Also, since most apps use pure React transformer, a new option was introduced that allows to prohibit namespaces completely:
```javascript
var ast = acorn.parse(code, {
plugins: {
jsx: { allowNamespaces: false }
}
});
```
Note that by default `allowNamespaces` is enabled for spec compliancy.
## License
This plugin is issued under the [MIT license](./LICENSE).
'use strict';
module.exports = require('./inject')(require('acorn'));
This diff is collapsed.
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
{
"plugins": {
"node": true,
"es_modules": true
}
}
\ No newline at end of file
language: node_js
sudo: false
node_js:
- '0.12'
- '4'
- '5'
- '6'
List of Acorn contributors. Updated before every release.
Adrian Rakovsky
Alistair Braidwood
Amila Welihinda
Andres Suarez
Angelo
Aparajita Fishman
Arian Stolwijk
Artem Govorov
Brandon Mills
Charles Hughes
Conrad Irwin
Daniel Tschinder
David Bonnet
Domenico Matteo
ForbesLindesay
Forbes Lindesay
Gilad Peleg
impinball
Ingvar Stepanyan
Jackson Ray Hamilton
Jesse McCarthy
Jiaxing Wang
Joel Kemp
Johannes Herr
Jordan Klassen
Jürg Lehni
keeyipchan
Keheliya Gallaba
Kevin Irish
Kevin Kwok
krator
Marijn Haverbeke
Martin Carlberg
Mathias Bynens
Mathieu 'p01' Henri
Matthew Bastien
Max Schaefer
Max Zerzouri
Mihai Bazon
Mike Rennie
Nicholas C. Zakas
Nick Fitzgerald
Olivier Thomann
Oskar Schöldström
Paul Harper
Peter Rust
PlNG
Prayag Verma
ReadmeCritic
r-e-d
Richard Gibson
Rich Harris
Rich-Harris
Sebastian McKenzie
Timothy Gu
Toru Nagashima
zsjforcn
## 3.3.0 (2016-07-25)
### Bug fixes
Fix bug in tokenizing of regexp operator after a function declaration.
Fix parser crash when parsing an array pattern with a hole.
### New features
Implement check against complex argument lists in functions that
enable strict mode in ES7.
## 3.2.0 (2016-06-07)
### Bug fixes
Improve handling of lack of unicode regexp support in host
environment.
Properly reject shorthand properties whose name is a keyword.
Don't crash when the loose parser is called without options object.
### New features
Visitors created with `visit.make` now have their base as _prototype_,
rather than copying properties into a fresh object.
Make it possible to use `visit.ancestor` with a walk state.
## 3.1.0 (2016-04-18)
### Bug fixes
Fix issue where the loose parser created invalid TemplateElement nodes
for unclosed template literals.
Properly tokenize the division operator directly after a function
expression.
Allow trailing comma in destructuring arrays.
### New features
The walker now allows defining handlers for `CatchClause` nodes.
## 3.0.4 (2016-02-25)
### Fixes
Allow update expressions as left-hand-side of the ES7 exponential
operator.
## 3.0.2 (2016-02-10)
### Fixes
Fix bug that accidentally made `undefined` a reserved word when
parsing ES7.
## 3.0.0 (2016-02-10)
### Breaking changes
The default value of the `ecmaVersion` option is now 6 (used to be 5).
Support for comprehension syntax (which was dropped from the draft
spec) has been removed.
### Fixes
`let` and `yield` are now “contextual keywords”, meaning you can
mostly use them as identifiers in ES5 non-strict code.
A parenthesized class or function expression after `export default` is
now parsed correctly.
### New features
When `ecmaVersion` is set to 7, Acorn will parse the exponentiation
operator (`**`).
The identifier character ranges are now based on Unicode 8.0.0.
Plugins can now override the `raiseRecoverable` method to override the
way non-critical errors are handled.
## 2.7.0 (2016-01-04)
### Fixes
Stop allowing rest parameters in setters.
Make sure the loose parser always attaches a `local` property to
`ImportNamespaceSpecifier` nodes.
Disallow `y` rexexp flag in ES5.
Disallow `\00` and `\000` escapes in strict mode.
Raise an error when an import name is a reserved word.
## 2.6.4 (2015-11-12)
### Fixes
Fix crash in loose parser when parsing invalid object pattern.
### New features
Support plugins in the loose parser.
## 2.6.2 (2015-11-10)
### Fixes
Don't crash when no options object is passed.
## 2.6.0 (2015-11-09)
### Fixes
Add `await` as a reserved word in module sources.
Disallow `yield` in a parameter default value for a generator.
Forbid using a comma after a rest pattern in an array destructuring.
### New features
Support parsing stdin in command-line tool.
## 2.5.2 (2015-10-27)
### Fixes
Fix bug where the walker walked an exported `let` statement as an
expression.
## 2.5.0 (2015-10-27)
### Fixes
Fix tokenizer support in the command-line tool.
In the loose parser, don't allow non-string-literals as import
sources.
Stop allowing `new.target` outside of functions.
Remove legacy `guard` and `guardedHandler` properties from try nodes.
Stop allowing multiple `__proto__` properties on an object literal in
strict mode.
Don't allow rest parameters to be non-identifier patterns.
Check for duplicate paramter names in arrow functions.
Copyright (C) 2012-2016 by various contributors (see AUTHORS)
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.
This diff is collapsed.
#!/usr/bin/env node
'use strict';
var path = require('path');
var fs = require('fs');
var acorn = require('../dist/acorn.js');
var infile;
var forceFile;
var silent = false;
var compact = false;
var tokenize = false;
var options = {}
function help(status) {
var print = (status == 0) ? console.log : console.error
print("usage: " + path.basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6|--ecma7]")
print(" [--tokenize] [--locations] [---allow-hash-bang] [--compact] [--silent] [--module] [--help] [--] [infile]")
process.exit(status)
}
for (var i = 2; i < process.argv.length; ++i) {
var arg = process.argv[i]
if ((arg == "-" || arg[0] != "-") && !infile) infile = arg
else if (arg == "--" && !infile && i + 2 == process.argv.length) forceFile = infile = process.argv[++i]
else if (arg == "--ecma3") options.ecmaVersion = 3
else if (arg == "--ecma5") options.ecmaVersion = 5
else if (arg == "--ecma6") options.ecmaVersion = 6
else if (arg == "--ecma7") options.ecmaVersion = 7
else if (arg == "--locations") options.locations = true
else if (arg == "--allow-hash-bang") options.allowHashBang = true
else if (arg == "--silent") silent = true
else if (arg == "--compact") compact = true
else if (arg == "--help") help(0)
else if (arg == "--tokenize") tokenize = true
else if (arg == "--module") options.sourceType = 'module'
else help(1)
}
function run(code) {
var result
if (!tokenize) {
try { result = acorn.parse(code, options) }
catch(e) { console.error(e.message); process.exit(1) }
} else {
result = []
var tokenizer = acorn.tokenizer(code, options), token
while (true) {
try { token = tokenizer.getToken() }
catch(e) { console.error(e.message); process.exit(1) }
result.push(token)
if (token.type == acorn.tokTypes.eof) break
}
}
if (!silent) console.log(JSON.stringify(result, null, compact ? null : 2))
}
if (forceFile || infile && infile != "-") {
run(fs.readFileSync(infile, "utf8"))
} else {
var code = ""
process.stdin.resume()
process.stdin.on("data", function (chunk) { return code += chunk; })
process.stdin.on("end", function () { return run(code); })
}
\ No newline at end of file
'use strict';
// Which Unicode version should be used?
var version = '9.0.0';
var start = require('unicode-' + version + '/Binary_Property/ID_Start/code-points.js')
.filter(function(ch) { return ch > 0x7f; });
var last = -1;
var cont = [0x200c, 0x200d].concat(require('unicode-' + version + '/Binary_Property/ID_Continue/code-points.js')
.filter(function(ch) { return ch > 0x7f && search(start, ch, last + 1) == -1; }));
function search(arr, ch, starting) {
for (var i = starting; arr[i] <= ch && i < arr.length; last = i++)
if (arr[i] === ch)
return i;
return -1;
}
function pad(str, width) {
while (str.length < width) str = "0" + str;
return str;
}
function esc(code) {
var hex = code.toString(16);
if (hex.length <= 2) return "\\x" + pad(hex, 2);
else return "\\u" + pad(hex, 4);
}
function generate(chars) {
var astral = [], re = "";
for (var i = 0, at = 0x10000; i < chars.length; i++) {
var from = chars[i], to = from;
while (i < chars.length - 1 && chars[i + 1] == to + 1) {
i++;
to++;
}
if (to <= 0xffff) {
if (from == to) re += esc(from);
else if (from + 1 == to) re += esc(from) + esc(to);
else re += esc(from) + "-" + esc(to);
} else {
astral.push(from - at, to - from);
at = to;
}
}
return {nonASCII: re, astral: astral};
}
var startData = generate(start), contData = generate(cont);
console.log("let nonASCIIidentifierStartChars = \"" + startData.nonASCII + "\"");
console.log("let nonASCIIidentifierChars = \"" + contData.nonASCII + "\"");
console.log("const astralIdentifierStartCodes = " + JSON.stringify(startData.astral));
console.log("const astralIdentifierCodes = " + JSON.stringify(contData.astral));
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment