node_modules

This commit is contained in:
Florian Dold 2017-08-14 05:01:11 +02:00
parent 5634e77ad9
commit 363723fc84
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
6490 changed files with 394413 additions and 757121 deletions

2
node_modules/.bin/tsc generated vendored
View File

@ -1 +1 @@
../typescript/bin/tsc
../typedoc/node_modules/typescript/bin/tsc

2
node_modules/.bin/tsserver generated vendored
View File

@ -1 +1 @@
../typescript/bin/tsserver
../typedoc/node_modules/typescript/bin/tsserver

2
node_modules/.bin/uglifyjs generated vendored
View File

@ -1 +1 @@
../uglify-js/bin/uglifyjs
../handlebars/node_modules/uglify-js/bin/uglifyjs

View File

@ -1,9 +1,8 @@
'use strict';
/* eslint-disable import/no-dynamic-require */
function buildPreset() {
module.exports = () => {
const plugins = require(`./plugins/best-match`)
.map(module => require(module));
return {plugins};
}
module.exports = buildPreset;
};

View File

@ -0,0 +1,10 @@
'use strict';
var md5OMatic = require('md5-o-matic');
module.exports = function (input) {
if (Array.isArray(input)) {
input = input.join('');
}
return md5OMatic(input);
};

View File

@ -0,0 +1,23 @@
'use strict';
var crypto = require('crypto');
module.exports = function (input) {
var hash = crypto.createHash('md5');
var update = function (buf) {
var inputEncoding = typeof buf === 'string' ? 'utf8' : undefined;
hash.update(buf, inputEncoding);
};
if (arguments.length > 1) {
throw new Error('Too many arguments. Try specifying an array.');
}
if (Array.isArray(input)) {
input.forEach(update);
} else {
update(input);
}
return hash.digest('hex');
};

View File

@ -0,0 +1,39 @@
{
"name": "md5-hex",
"version": "1.3.0",
"description": "Create a MD5 hash with hex encoding",
"license": "MIT",
"repository": "sindresorhus/md5-hex",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"browser": "browser.js",
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js",
"browser.js"
],
"keywords": [
"hash",
"crypto",
"md5",
"hex",
"buffer",
"browser",
"browserify"
],
"dependencies": {
"md5-o-matic": "^0.1.1"
},
"devDependencies": {
"ava": "*",
"xo": "*"
}
}

View File

@ -0,0 +1,44 @@
# md5-hex [![Build Status](https://travis-ci.org/sindresorhus/md5-hex.svg?branch=master)](https://travis-ci.org/sindresorhus/md5-hex)
> Create a MD5 hash with hex encoding
*Please don't use MD5 hashes for anything sensitive!*
Checkout [`hasha`](https://github.com/sindresorhus/hasha) if you need something more flexible.
## Install
```
$ npm install --save md5-hex
```
## Usage
```js
const fs = require('fs');
const md5Hex = require('md5-hex');
const buffer = fs.readFileSync('unicorn.png');
md5Hex(buffer);
//=> '1abcb33beeb811dca15f0ac3e47b88d9'
```
## API
### md5Hex(input)
#### input
Type: `buffer` `string` `array[string|buffer]`
Prefer buffers as they're faster to hash, but strings can be useful for small things.
Pass an array instead of concatenating strings and/or buffers. The output is the same, but arrays do not incur the overhead of concatenation.
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

View File

@ -1,42 +1,30 @@
{
"name": "@ava/babel-preset-stage-4",
"version": "1.0.0",
"description": "Efficiently applies the minimum of transforms to run stage 4 code on Node.js 4 and 6",
"main": "index.js",
"version": "1.1.0",
"description": "Efficiently applies the minimum of transforms to run stage 4 code on Node.js 4, 6 and 8",
"license": "MIT",
"repository": "avajs/babel-preset-stage-4",
"author": "Mark Wubben (https://novemberborn.net)",
"publishConfig": {
"access": "public"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava",
"posttest": "xo",
"coverage": "nyc npm test"
},
"files": [
"index.js",
"package-hash.js",
"plugins"
],
"scripts": {
"test": "ava",
"posttest": "xo",
"coverage": "nyc npm test"
},
"engines": {
"node": ">=4"
},
"repository": {
"type": "git",
"url": "git+https://github.com/avajs/babel-preset-stage-4.git"
},
"keywords": [
"ava",
"babel-preset"
],
"author": "Mark Wubben (https://novemberborn.net/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/avajs/babel-preset-stage-4/issues"
},
"homepage": "https://github.com/avajs/babel-preset-stage-4#readme",
"devDependencies": {
"ava": "^0.17.0",
"coveralls": "^2.11.15",
"nyc": "^10.1.2",
"proxyquire": "^1.7.10",
"xo": "^0.17.1"
},
"dependencies": {
"babel-plugin-check-es2015-constants": "^6.8.0",
"babel-plugin-syntax-trailing-function-commas": "^6.20.0",
@ -51,6 +39,13 @@
"babel-plugin-transform-exponentiation-operator": "^6.8.0",
"package-hash": "^1.2.0"
},
"devDependencies": {
"ava": "^0.17.0",
"coveralls": "^2.11.15",
"nyc": "^10.1.2",
"proxyquire": "^1.7.10",
"xo": "^0.17.1"
},
"nyc": {
"reporter": [
"html",

View File

@ -0,0 +1,3 @@
[
"babel-plugin-transform-es2015-modules-commonjs"
]

View File

@ -4,6 +4,10 @@ const process = require('process');
function getClosestVersion() {
const version = parseFloat(process.versions.node);
if (version >= 8) {
return 8;
}
if (version >= 6) {
return 6;
}

View File

@ -1,19 +1,15 @@
# @ava/babel-preset-stage-4
# @ava/babel-preset-stage-4 [![Build Status](https://travis-ci.org/avajs/babel-preset-stage-4.svg?branch=master)](https://travis-ci.org/avajs/babel-preset-stage-4)
A [Babel] preset for use with [AVA]. Aspires to bring ECMAScript stage 4
proposals to AVA's test and helper files.
> [Babel] preset for use with [AVA]
Efficiently applies the minimum of transforms to run stage 4 code on Node.js 4
and 6.
Aspires to bring ECMAScript stage 4 proposals to AVA's test and helper files.
Built-ins are not added or extended, so features like Proxies,
`Array.prototype.includes` or `String.prototype.padStart` will only be available
if the Node.js version running the tests supports it. Consult [node.green] for
details.
Efficiently applies the minimum of transforms to run stage 4 code on Node.js 4, 6 and 8.
Built-ins are not added or extended, so features like Proxies, `Array.prototype.includes` or `String.prototype.padStart` will only be available if the Node.js version running the tests supports it. Consult [node.green] for details.
Sometimes a particular feature is *mostly* implemented in Node.js. In that case transforms are not applied. This applies to `new.target` and iterator closing, which are not supported in Node.js 4 even though classes and iterators are.
Sometimes a particular feature is *mostly* implemented in Node.js. In that case
transforms are not applied. This applies to `new.target` and iterator closing,
which are not supported in Node.js 4 even though classes and iterators are.
## Install
@ -21,14 +17,14 @@ which are not supported in Node.js 4 even though classes and iterators are.
$ npm install --save @ava/babel-preset-stage-4
```
## Usage
Add `@ava/stage-4` to your [Babel] presets.
Require `@ava/babel-preset-stage-4/package-hash` to get a combined hash for the
installed version of the preset, as well as the plugins that were selected for
the active Node.js version.
Require `@ava/babel-preset-stage-4/package-hash` to get a combined hash for the installed version of the preset, as well as the plugins that were selected for the active Node.js version.
[AVA]: https://ava.li
[Babel]: https://babeljs.io/
[node.green]: http://node.green/
[Babel]: https://babeljs.io
[node.green]: http://node.green

View File

@ -1,3 +0,0 @@
__tests__
perf
.travis.yml

View File

@ -1,15 +0,0 @@
## ISC License
Copyright (c) 2016, James Kyle <me@thejameskyle.com>
Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.

View File

@ -1,134 +0,0 @@
# @ava/pretty-format [![Travis build status](http://img.shields.io/travis/avajs/pretty-format.svg?style=flat)](https://travis-ci.org/avajs/pretty-format)
> Stringify any JavaScript value.
- Supports [all built-in JavaScript types](#type-support)
- [Blazingly fast](https://gist.github.com/thejameskyle/2b04ffe4941aafa8f970de077843a8fd) (similar performance to v8's `JSON.stringify` and significantly faster than Node's `util.format`)
- Plugin system for extending with custom types (i.e. [`ReactTestComponent`](#reacttestcomponent-plugin))
## Installation
```sh
$ npm install @ava/pretty-format
```
## Usage
```js
var prettyFormat = require('pretty-format');
var obj = { property: {} };
obj.circularReference = obj;
obj[Symbol('foo')] = 'foo';
obj.map = new Map();
obj.map.set('prop', 'value');
obj.array = [1, NaN, Infinity];
console.log(prettyFormat(obj));
```
**Result:**
```js
Object {
"property": Object {},
"circularReference": [Circular],
"map": Map {
"prop" => "value"
},
"array": Array [
1,
NaN,
Infinity
],
Symbol(foo): "foo"
}
```
#### Type Support
`Object`, `Array`, `ArrayBuffer`, `DataView`, `Float32Array`, `Float64Array`, `Int8Array`, `Int16Array`, `Int32Array`, `Uint8Array`, `Uint8ClampedArray`, `Uint16Array`, `Uint32Array`, `arguments`, `Boolean`, `Date`, `Error`, `Function`, `Infinity`, `Map`, `NaN`, `null`, `Number`, `RegExp`, `Set`, `String`, `Symbol`, `undefined`, `WeakMap`, `WeakSet`
### API
```js
console.log(prettyFormat(object));
console.log(prettyFormat(object, options));
```
Options:
* **`callToJSON`**<br>
Type: `boolean`, default: `true`<br>
Call `toJSON()` on passed object.
* **`indent`**<br>
Type: `number`, default: `2`<br>
Number of spaces for indentation.
* **`maxDepth`**<br>
Type: `number`, default: `Infinity`<br>
Print only this number of levels.
* **`min`**<br>
Type: `boolean`, default: `false`<br>
Print without whitespace.
* **`plugins`**<br>
Type: `array`, default: `[]`<br>
Plugins (see the next section).
* **`printFunctionName`**<br>
Type: `boolean`, default: `true`<br>
Print function names or just `[Function]`.
* **`escapeRegex`**<br>
Type: `boolean`, default: `false`<br>
Escape special characters in regular expressions.
* **`highlight`**<br>
Type: `boolean`, default: `false`<br>
Highlight syntax for terminal (works only with `ReactTestComponent` and `ReactElement` plugins.
* **`theme`**<br>
Type: `object`, default: `{tag: 'cyan', content: 'reset'...}`<br>
Syntax highlight theme.<br>
Uses [ansi-styles colors](https://github.com/chalk/ansi-styles#colors) + `reset` for no color.<br>
Available types: `tag`, `content`, `prop` and `value`.
### Plugins
Pretty format also supports adding plugins:
```js
var fooPlugin = {
test: function(val) {
return val && val.hasOwnProperty('foo');
},
print: function(val, print, indent) {
return 'Foo: ' + print(val.foo);
}
};
var obj = { foo: { bar: {} } };
prettyFormat(obj, {
plugins: [fooPlugin]
});
// Foo: Object {
// "bar": Object {}
// }
```
#### `ReactTestComponent` and `ReactElement` plugins
```js
var prettyFormat = require('pretty-format');
var reactTestPlugin = require('pretty-format/plugins/ReactTestComponent');
var reactElementPlugin = require('pretty-format/plugins/ReactElement');
var React = require('react');
var renderer = require('react-test-renderer');
var jsx = React.createElement('h1', null, 'Hello World');
prettyFormat(renderer.create(jsx).toJSON(), {
plugins: [reactTestPlugin, reactElementPlugin]
});
// <h1>
// Hello World
// </h1>
```

View File

@ -1,397 +0,0 @@
'use strict';
const keyword = require('esutils').keyword;
const style = require('ansi-styles');
const printString = require('./printString');
const toString = Object.prototype.toString;
const toISOString = Date.prototype.toISOString;
const errorToString = Error.prototype.toString;
const regExpToString = RegExp.prototype.toString;
const symbolToString = Symbol.prototype.toString;
const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;
const NEWLINE_REGEXP = /\n/ig;
const getSymbols = Object.getOwnPropertySymbols || (obj => []);
function isToStringedArrayType(toStringed) {
return (
toStringed === '[object Array]' ||
toStringed === '[object ArrayBuffer]' ||
toStringed === '[object DataView]' ||
toStringed === '[object Float32Array]' ||
toStringed === '[object Float64Array]' ||
toStringed === '[object Int8Array]' ||
toStringed === '[object Int16Array]' ||
toStringed === '[object Int32Array]' ||
toStringed === '[object Uint8Array]' ||
toStringed === '[object Uint8ClampedArray]' ||
toStringed === '[object Uint16Array]' ||
toStringed === '[object Uint32Array]'
);
}
function printNumber(val) {
if (val != +val) return 'NaN';
const isNegativeZero = val === 0 && (1 / val) < 0;
return isNegativeZero ? '-0' : '' + val;
}
function printFunction(val, printFunctionName) {
if (!printFunctionName) {
return '[Function]';
} else if (val.name === '') {
return '[Function anonymous]'
} else {
return '[Function ' + val.name + ']';
}
}
function printSymbol(val) {
return symbolToString.call(val).replace(SYMBOL_REGEXP, 'Symbol($1)');
}
function printError(val) {
return '[' + errorToString.call(val) + ']';
}
function printBasicValue(val, printFunctionName, escapeRegex, colors) {
if (val === true || val === false) return colors.boolean.open + val + colors.boolean.close;
if (val === undefined) return colors.misc.open + 'undefined' + colors.misc.close;
if (val === null) return colors.misc.open + 'null' + colors.misc.close;
const typeOf = typeof val;
if (typeOf === 'number') return colors.number.open + printNumber(val) + colors.number.close;
if (typeOf === 'string') return colors.string.open + '"' + printString(val) + '"' + colors.string.close;
if (typeOf === 'function') return colors.function.open + printFunction(val, printFunctionName) + colors.function.close;
if (typeOf === 'symbol') return colors.symbol.open + printSymbol(val) + colors.symbol.close;
const toStringed = toString.call(val);
if (toStringed === '[object WeakMap]') return colors.label.open + 'WeakMap ' + colors.label.close + colors.bracket.open + '{}' + colors.bracket.close;
if (toStringed === '[object WeakSet]') return colors.label.open + 'WeakSet ' + colors.label.close + colors.bracket.open + '{}' + colors.bracket.close;
if (toStringed === '[object Function]' || toStringed === '[object GeneratorFunction]') return colors.function.open + printFunction(val, printFunctionName) + colors.function.close;
if (toStringed === '[object Symbol]') return colors.symbol.open + printSymbol(val) + colors.symbol.close;
if (toStringed === '[object Date]') return colors.date.open + toISOString.call(val) + colors.date.close;
if (toStringed === '[object Error]') return colors.error.open + printError(val) + colors.error.close;
if (toStringed === '[object RegExp]') {
if (escapeRegex) {
return colors.regex.open + printString(regExpToString.call(val)) + colors.regex.close;
}
return colors.regex.open + regExpToString.call(val) + colors.regex.close;
};
if (toStringed === '[object Arguments]' && val.length === 0) return colors.label.open + 'Arguments ' + colors.label.close + colors.bracket.open + '[]' + colors.bracket.close;
if (isToStringedArrayType(toStringed) && val.length === 0) return val.constructor.name + colors.bracket.open + ' []' + colors.bracket.close;
if (val instanceof Error) return colors.error.open + printError(val) + colors.error.close;
return false;
}
function printList(list, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors) {
let body = '';
if (list.length) {
body += edgeSpacing;
const innerIndent = prevIndent + indent;
for (let i = 0; i < list.length; i++) {
body += innerIndent + print(list[i], indent, innerIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors);
if (i < list.length - 1) {
body += colors.comma.open + ',' + colors.comma.close + spacing;
}
}
body += (min ? '' : colors.comma.open + ',' + colors.comma.close) + edgeSpacing + prevIndent;
}
return colors.bracket.open + '[' + colors.bracket.close + body + colors.bracket.open + ']' + colors.bracket.close;
}
function printArguments(val, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors) {
return colors.label.open + (min ? '' : 'Arguments ') + colors.label.close + printList(val, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors);
}
function printArray(val, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors) {
return colors.label.open + (min ? '' : val.constructor.name + ' ') + colors.label.close + printList(val, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors);
}
function printKey(key, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors) {
const typeOf = typeof key;
if (typeOf === 'string') {
if (keyword.isIdentifierNameES6(key, true)) return colors.key.open + key + colors.key.close;
if (/^\d+$/.test(key)) return colors.key.open + key + colors.key.close;
return colors.key.open + '"' + printString(key) + '"' + colors.key.close;
}
if (typeOf === 'symbol') return colors.key.open + printSymbol(key) + colors.key.close;
return print(key, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors);
}
function printMap(val, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors) {
let result = colors.label.open + 'Map ' + colors.label.close + colors.bracket.open + '{' + colors.bracket.close;
const iterator = val.entries();
let current = iterator.next();
if (!current.done) {
result += edgeSpacing;
const innerIndent = prevIndent + indent;
while (!current.done) {
const key = printKey(current.value[0], indent, innerIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors);
const value = print(current.value[1], indent, innerIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors);
result += innerIndent + key + ' => ' + value;
current = iterator.next();
if (!current.done) {
result += colors.comma.open + ',' + colors.comma.close + spacing;
}
}
result += (min ? '' : colors.comma.open + ',' + colors.comma.close) + edgeSpacing + prevIndent;
}
return result + colors.bracket.open + '}' + colors.bracket.close;
}
function printObject(val, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors) {
const constructor = min ? '' : (val.constructor ? val.constructor.name + ' ' : 'Object ');
let result = colors.label.open + constructor + colors.label.close + colors.bracket.open + '{' + colors.bracket.close;
let keys = Object.keys(val).sort();
const symbols = getSymbols(val);
if (symbols.length) {
keys = keys
.filter(key => !(typeof key === 'symbol' || toString.call(key) === '[object Symbol]'))
.concat(symbols);
}
if (keys.length) {
result += edgeSpacing;
const innerIndent = prevIndent + indent;
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
const name = printKey(key, indent, innerIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors);
const value = print(val[key], indent, innerIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors);
result += innerIndent + name + ': ' + value;
if (i < keys.length - 1) {
result += colors.comma.open + ',' + colors.comma.close + spacing;
}
}
result += (min ? '' : colors.comma.open + ',' + colors.comma.close) + edgeSpacing + prevIndent;
}
return result + colors.bracket.open + '}' + colors.bracket.close;
}
function printSet(val, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors) {
let result = colors.label.open + 'Set ' + colors.label.close + colors.bracket.open + '{' + colors.bracket.close;
const iterator = val.entries();
let current = iterator.next();
if (!current.done) {
result += edgeSpacing;
const innerIndent = prevIndent + indent;
while (!current.done) {
result += innerIndent + print(current.value[1], indent, innerIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors);
current = iterator.next();
if (!current.done) {
result += colors.comma.open + ',' + colors.comma.close + spacing;
}
}
result += (min ? '' : colors.comma.open + ',' + colors.comma.close) + edgeSpacing + prevIndent;
}
return result + colors.bracket.open + '}' + colors.bracket.close;
}
function printComplexValue(val, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors) {
refs = refs.slice();
if (refs.indexOf(val) > -1) {
return '[Circular]';
} else {
refs.push(val);
}
currentDepth++;
const hitMaxDepth = currentDepth > maxDepth;
if (callToJSON && !hitMaxDepth && val.toJSON && typeof val.toJSON === 'function') {
return print(val.toJSON(), indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors);
}
const toStringed = toString.call(val);
if (toStringed === '[object Arguments]') {
return hitMaxDepth ? '[Arguments]' : printArguments(val, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors);
} else if (isToStringedArrayType(toStringed)) {
return hitMaxDepth ? '[Array]' : printArray(val, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors);
} else if (toStringed === '[object Map]') {
return hitMaxDepth ? '[Map]' : printMap(val, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors);
} else if (toStringed === '[object Set]') {
return hitMaxDepth ? '[Set]' : printSet(val, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors);
} else if (typeof val === 'object') {
return hitMaxDepth ? '[Object]' : printObject(val, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors);
}
}
function printPlugin(val, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors) {
let match = false;
let plugin;
for (let p = 0; p < plugins.length; p++) {
plugin = plugins[p];
if (plugin.test(val)) {
match = true;
break;
}
}
if (!match) {
return false;
}
function boundPrint(val) {
return print(val, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors);
}
function boundIndent(str) {
const indentation = prevIndent + indent;
return indentation + str.replace(NEWLINE_REGEXP, '\n' + indentation);
}
const opts = {
edgeSpacing: edgeSpacing,
spacing: spacing
};
return plugin.print(val, boundPrint, boundIndent, opts, colors);
}
function print(val, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors) {
const basic = printBasicValue(val, printFunctionName, escapeRegex, colors);
if (basic) return basic;
const plugin = printPlugin(val, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors);
if (plugin) return plugin;
return printComplexValue(val, indent, prevIndent, spacing, edgeSpacing, refs, maxDepth, currentDepth, plugins, min, callToJSON, printFunctionName, escapeRegex, colors);
}
const DEFAULTS = {
callToJSON: true,
indent: 2,
maxDepth: Infinity,
min: false,
plugins: [],
printFunctionName: true,
escapeRegex: false,
highlight: false,
theme: {
tag: 'cyan',
content: 'reset',
prop: 'yellow',
value: 'green',
number: 'yellow',
string: 'red',
date: 'red',
symbol: 'red',
regex: 'red',
function: 'blue',
error: 'red',
boolean: 'yellow',
label: 'blue',
bracket: 'grey',
comma: 'grey',
misc: 'grey',
key: 'reset'
}
};
function validateOptions(opts) {
Object.keys(opts).forEach(key => {
if (!DEFAULTS.hasOwnProperty(key)) {
throw new Error('prettyFormat: Invalid option: ' + key);
}
});
if (opts.min && opts.indent !== undefined && opts.indent !== 0) {
throw new Error('prettyFormat: Cannot run with min option and indent');
}
}
function normalizeOptions(opts) {
const result = {};
Object.keys(DEFAULTS).forEach(key =>
result[key] = opts.hasOwnProperty(key) ? opts[key] : DEFAULTS[key]
);
if (result.min) {
result.indent = 0;
}
return result;
}
function createIndent(indent) {
return new Array(indent + 1).join(' ');
}
function prettyFormat(val, opts) {
if (!opts) {
opts = DEFAULTS;
} else {
validateOptions(opts)
opts = normalizeOptions(opts);
}
let colors = {};
Object.keys(opts.theme).forEach(key => {
if (opts.highlight) {
colors[key] = style[opts.theme[key]];
} else {
colors[key] = {open: '', close: ''};
}
});
let indent;
let refs;
const prevIndent = '';
const currentDepth = 0;
const spacing = opts.min ? ' ' : '\n';
const edgeSpacing = opts.min ? '' : '\n';
if (opts && opts.plugins.length) {
indent = createIndent(opts.indent);
refs = [];
var pluginsResult = printPlugin(val, indent, prevIndent, spacing, edgeSpacing, refs, opts.maxDepth, currentDepth, opts.plugins, opts.min, opts.callToJSON, opts.printFunctionName, opts.escapeRegex, colors);
if (pluginsResult) return pluginsResult;
}
var basicResult = printBasicValue(val, opts.printFunctionName, opts.escapeRegex, colors);
if (basicResult) return basicResult;
if (!indent) indent = createIndent(opts.indent);
if (!refs) refs = [];
return printComplexValue(val, indent, prevIndent, spacing, edgeSpacing, refs, opts.maxDepth, currentDepth, opts.plugins, opts.min, opts.callToJSON, opts.printFunctionName, opts.escapeRegex, colors);
}
module.exports = prettyFormat;

View File

@ -1,29 +0,0 @@
{
"name": "@ava/pretty-format",
"version": "1.1.0",
"description": "Stringify any JavaScript value",
"license": "MIT",
"repository": "avajs/pretty-format",
"author": "James Kyle <me@thejameskyle.com>",
"publishConfig": {
"access": "public"
},
"scripts": {
"test": "jest",
"perf": "node perf/test.js"
},
"dependencies": {
"ansi-styles": "^2.2.1",
"esutils": "^2.0.2"
},
"devDependencies": {
"chalk": "^1.1.3",
"jest": "^15.1.1",
"left-pad": "^1.1.1",
"react": "15.3.0"
},
"jest": {
"testEnvironment": "node",
"verbose": true
}
}

View File

@ -1,83 +0,0 @@
'use strict';
const printString = require('../printString');
const reactElement = Symbol.for('react.element');
function traverseChildren(opaqueChildren, cb) {
if (Array.isArray(opaqueChildren)) {
opaqueChildren.forEach(child => traverseChildren(child, cb));
} else if (opaqueChildren != null && opaqueChildren !== false) {
cb(opaqueChildren);
}
}
function printChildren(flatChildren, print, indent, colors, opts) {
return flatChildren.map(node => {
if (typeof node === 'object') {
return printElement(node, print, indent, colors, opts);
} else if (typeof node === 'string') {
return printString(colors.content.open + node + colors.content.close);
} else {
return print(node);
}
}).join(opts.edgeSpacing);
}
function printProps(props, print, indent, colors, opts) {
return Object.keys(props).sort().map(name => {
if (name === 'children') {
return '';
}
const prop = props[name];
let printed = print(prop);
if (typeof prop !== 'string') {
if (printed.indexOf('\n') !== -1) {
printed = '{' + opts.edgeSpacing + indent(indent(printed) + opts.edgeSpacing + '}');
} else {
printed = '{' + printed + '}';
}
}
return opts.spacing + indent(colors.prop.open + name + colors.prop.close + '=') + colors.value.open + printed + colors.value.close;
}).join('');
}
function printElement(element, print, indent, colors, opts) {
let result = colors.tag.open + '<';
let elementName;
if (typeof element.type === 'string') {
elementName = element.type;
} else if (typeof element.type === 'function') {
elementName = element.type.displayName || element.type.name || 'Unknown';
} else {
elementName = 'Unknown';
}
result += elementName + colors.tag.close;
result += printProps(element.props, print, indent, colors, opts);
const opaqueChildren = element.props.children;
if (opaqueChildren) {
let flatChildren = [];
traverseChildren(opaqueChildren, child => {
flatChildren.push(child);
});
const children = printChildren(flatChildren, print, indent, colors, opts);
result += colors.tag.open + '>' + colors.tag.close + opts.edgeSpacing + indent(children) + opts.edgeSpacing + colors.tag.open + '</' + elementName + '>' + colors.tag.close;
} else {
result += colors.tag.open + ' />' + colors.tag.close;
}
return result;
}
module.exports = {
test(object) {
return object && object.$$typeof === reactElement;
},
print(val, print, indent, opts, colors) {
return printElement(val, print, indent, colors, opts);
}
};

View File

@ -1,58 +0,0 @@
'use strict';
const printString = require('../printString');
const reactTestInstance = Symbol.for('react.test.json');
function printChildren(children, print, indent, colors, opts) {
return children.map(child => printInstance(child, print, indent, colors, opts)).join(opts.edgeSpacing);
}
function printProps(props, print, indent, colors, opts) {
return Object.keys(props).sort().map(name => {
const prop = props[name];
let printed = print(prop);
if (typeof prop !== 'string') {
if (printed.indexOf('\n') !== -1) {
printed = '{' + opts.edgeSpacing + indent(indent(printed) + opts.edgeSpacing + '}');
} else {
printed = '{' + printed + '}';
}
}
return opts.spacing + indent(colors.prop.open + name + colors.prop.close + '=') + colors.value.open + printed + colors.value.close;
}).join('');
}
function printInstance(instance, print, indent, colors, opts) {
if (typeof instance == 'number') {
return print(instance);
} else if (typeof instance === 'string') {
return printString(colors.content.open + instance + colors.content.close);
}
let result = colors.tag.open + '<' + instance.type + colors.tag.close;
if (instance.props) {
result += printProps(instance.props, print, indent, colors, opts);
}
if (instance.children) {
const children = printChildren(instance.children, print, indent, colors, opts);
result += colors.tag.open + '>' + colors.tag.close + opts.edgeSpacing + indent(children) + opts.edgeSpacing + colors.tag.open + '</' + instance.type + '>' + colors.tag.close;
} else {
result += colors.tag.open + ' />' + colors.tag.close;
}
return result;
}
module.exports = {
test(object) {
return object && object.$$typeof === reactTestInstance;
},
print(val, print, indent, opts, colors) {
return printInstance(val, print, indent, colors, opts);
}
};

View File

@ -1,7 +0,0 @@
'use strict';
const ESCAPED_CHARACTERS = /(\\|\"|\')/g;
module.exports = function printString(val) {
return val.replace(ESCAPED_CHARACTERS, '\\$1');
}

6
node_modules/@ava/write-file-atomic/LICENSE generated vendored Normal file
View File

@ -0,0 +1,6 @@
Copyright (c) 2015, Rebecca Turner
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

54
node_modules/@ava/write-file-atomic/README.md generated vendored Normal file
View File

@ -0,0 +1,54 @@
write-file-atomic
-----------------
**Forked from https://github.com/npm/write-file-atomic to include https://github.com/npm/write-file-atomic/pull/25, for
use with [AVA](https://github.com/avajs/ava/).**
---
This is an extension for node's `fs.writeFile` that makes its operation
atomic and allows you set ownership (uid/gid of the file).
### var writeFileAtomic = require('write-file-atomic')<br>writeFileAtomic(filename, data, [options], callback)
* filename **String**
* data **String** | **Buffer**
* options **Object**
* chown **Object**
* uid **Number**
* gid **Number**
* encoding **String** | **Null** default = 'utf8'
* fsync **Boolean** default = true
* mode **Number** default = 438 (aka 0666 in Octal)
callback **Function**
Atomically and asynchronously writes data to a file, replacing the file if it already
exists. data can be a string or a buffer.
The file is initially named `filename + "." + murmurhex(__filename, process.pid, ++invocations)`.
If writeFile completes successfully then, if passed the **chown** option it will change
the ownership of the file. Finally it renames the file back to the filename you specified. If
it encounters errors at any of these steps it will attempt to unlink the temporary file and then
pass the error back to the caller.
If provided, the **chown** option requires both **uid** and **gid** properties or else
you'll get an error.
The **encoding** option is ignored if **data** is a buffer. It defaults to 'utf8'.
If the **fsync** option is **false**, writeFile will skip the final fsync call.
The callback is always invoked with the initial (temporary) filename.
Example:
```javascript
writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function (err) {
if (err) throw err;
console.log('It\'s saved!');
});
```
### var writeFileAtomicSync = require('write-file-atomic').sync<br>writeFileAtomicSync(filename, data, [options])
The synchronous version of **writeFileAtomic**. Returns the initial (temporary) filename.

135
node_modules/@ava/write-file-atomic/index.js generated vendored Normal file
View File

@ -0,0 +1,135 @@
'use strict'
module.exports = writeFile
module.exports.sync = writeFileSync
module.exports._getTmpname = getTmpname // for testing
var fs = require('graceful-fs')
var chain = require('slide').chain
var MurmurHash3 = require('imurmurhash')
var invocations = 0
function getTmpname (filename) {
return filename + '.' +
MurmurHash3(__filename)
.hash(String(process.pid))
.hash(String(++invocations))
.result()
}
function writeFile (filename, data, options, callback) {
if (options instanceof Function) {
callback = options
options = null
}
if (!options) options = {}
fs.realpath(filename, function (_, realname) {
_writeFile(realname || filename, data, options, callback)
})
}
function _writeFile (filename, data, options, callback) {
var tmpfile = getTmpname(filename)
if (options.mode && options.chown) {
return thenWriteFile()
} else {
// Either mode or chown is not explicitly set
// Default behavior is to copy it from original file
return fs.stat(filename, function (err, stats) {
if (err || !stats) return thenWriteFile()
options = Object.assign({}, options)
if (!options.mode) {
options.mode = stats.mode
}
if (!options.chown && process.getuid) {
options.chown = { uid: stats.uid, gid: stats.gid }
}
return thenWriteFile()
})
}
function thenWriteFile () {
chain([
[writeFileAsync, tmpfile, data, options.mode, options.encoding || 'utf8'],
options.chown && [fs, fs.chown, tmpfile, options.chown.uid, options.chown.gid],
options.mode && [fs, fs.chmod, tmpfile, options.mode],
[fs, fs.rename, tmpfile, filename]
], function (err) {
err ? fs.unlink(tmpfile, function () { callback(err, tmpfile) })
: callback(null, tmpfile)
})
}
// doing this instead of `fs.writeFile` in order to get the ability to
// call `fsync`.
function writeFileAsync (file, data, mode, encoding, cb) {
fs.open(file, 'w', options.mode, function (err, fd) {
if (err) return cb(err)
if (Buffer.isBuffer(data)) {
return fs.write(fd, data, 0, data.length, 0, syncAndClose)
} else if (data != null) {
return fs.write(fd, String(data), 0, String(encoding), syncAndClose)
} else {
return syncAndClose()
}
function syncAndClose (err) {
if (err) return cb(err)
if (options.fsync !== false) {
fs.fsync(fd, function (err) {
if (err) return cb(err)
fs.close(fd, cb)
})
} else {
fs.close(fd, cb)
}
}
})
}
}
function writeFileSync (filename, data, options) {
if (!options) options = {}
try {
filename = fs.realpathSync(filename)
} catch (ex) {
// it's ok, it'll happen on a not yet existing file
}
var tmpfile = getTmpname(filename)
try {
if (!options.mode || !options.chown) {
// Either mode or chown is not explicitly set
// Default behavior is to copy it from original file
try {
var stats = fs.statSync(filename)
options = Object.assign({}, options)
if (!options.mode) {
options.mode = stats.mode
}
if (!options.chown && process.getuid) {
options.chown = { uid: stats.uid, gid: stats.gid }
}
} catch (ex) {
// ignore stat errors
}
}
var fd = fs.openSync(tmpfile, 'w', options.mode)
if (Buffer.isBuffer(data)) {
fs.writeSync(fd, data, 0, data.length, 0)
} else if (data != null) {
fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8'))
}
if (options.fsync !== false) {
fs.fsyncSync(fd)
}
fs.closeSync(fd)
if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid)
if (options.mode) fs.chmodSync(tmpfile, options.mode)
fs.renameSync(tmpfile, filename)
return tmpfile
} catch (err) {
try { fs.unlinkSync(tmpfile) } catch (e) {}
throw err
}
}

38
node_modules/@ava/write-file-atomic/package.json generated vendored Normal file
View File

@ -0,0 +1,38 @@
{
"name": "@ava/write-file-atomic",
"version": "2.2.0",
"description": "Write files in an atomic fashion w/configurable ownership",
"main": "index.js",
"scripts": {
"test": "standard && tap --100 test/*.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/avajs/write-file-atomic"
},
"keywords": [
"writeFile",
"atomic"
],
"author": "Rebecca Turner <me@re-becca.org> (http://re-becca.org)",
"license": "ISC",
"bugs": {
"url": "https://github.com/iarna/write-file-atomic/issues"
},
"homepage": "https://github.com/iarna/write-file-atomic",
"dependencies": {
"graceful-fs": "^4.1.11",
"imurmurhash": "^0.1.4",
"slide": "^1.1.5"
},
"devDependencies": {
"mkdirp": "^0.5.1",
"require-inject": "^1.4.0",
"rimraf": "^2.5.4",
"standard": "^10.0.2",
"tap": "^10.3.2"
},
"files": [
"index.js"
]
}

14
node_modules/@concordance/react/LICENSE generated vendored Normal file
View File

@ -0,0 +1,14 @@
ISC License (ISC)
Copyright (c) 2017, Mark Wubben <mark@novemberborn.net> (novemberborn.net)
Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.

20
node_modules/@concordance/react/README.md generated vendored Normal file
View File

@ -0,0 +1,20 @@
# @concordance/react
React plugin for [Concordance](https://github.com/concordancejs/concordance).
Allows
[`React.createElement()`](https://facebook.github.io/react/docs/react-api.html#createelement)
objects to be compared, formatted, diffed and serialized. Also supports
`toJSON()` renderings of
[`react-test-renderer`](https://www.npmjs.com/package/react-test-renderer).
These may be compared to `React.createElement()` objects.
When comparing [React
component](https://facebook.github.io/react/docs/components-and-props.html)
elements, the element type is compared by identity. After deserialization the
element types are compared by function name, taking into account whether
serialization and / or comparison is done using Node.js 4, which has less
reliable support for function names.
Component elements are formatted with a &#x235F; character after the element
name. Properties and children are formatted by [Concordance](https://github.com/concordancejs/concordance).

75
node_modules/@concordance/react/index.js generated vendored Normal file
View File

@ -0,0 +1,75 @@
'use strict'
const pkg = require('./package.json')
const elementFactory = require('./lib/elementFactory')
const testJsonFactory = require('./lib/testJsonFactory')
// Must be unique across all registered plugins.
exports.name = pkg.name
// Expected API version to be passed to register().
exports.apiVersion = 1
// Expected minimal version of Concordance. Concordance will increment its API
// version for breaking changes, this is useful if you rely on features or
// patches that were introduced in a specific version of Concordance.
exports.minimalConcordanceVersion = '1.0.0'
// Plugin-specific version of its serialization output.
exports.serializerVersion = 1
exports.theme = {
react: {
functionType: '\u235F',
openTag: {
start: '<',
end: '>',
selfClose: '/',
selfCloseVoid: ' /'
},
closeTag: {
open: '</',
close: '>'
},
tagName: {open: '', close: ''},
attribute: {
separator: '=',
value: {
openBracket: '{',
closeBracket: '}',
string: {
line: {open: '"', close: '"', escapeQuote: '"'}
}
}
},
child: {
openBracket: '{',
closeBracket: '}',
string: {
line: {open: '', close: '', escapeQuote: ''},
multiline: {start: '', end: '', escapeQuote: ''}
}
}
}
}
const ELEMENT = Symbol.for('react.element')
const TEST_JSON = Symbol.for('react.test.json')
function register (api) {
const reactTags = new Set()
const element = elementFactory(api, reactTags)
const testJson = testJsonFactory(api, element)
api.addDescriptor(0x01, element.tag, element.deserialize)
api.addDescriptor(0x02, testJson.tag, testJson.deserialize)
reactTags.add(element.tag).add(testJson.tag)
return value => {
if (value.$$typeof === ELEMENT) return element.describe
if (value.$$typeof === TEST_JSON) return testJson.describe
return null
}
}
exports.register = register

239
node_modules/@concordance/react/lib/diffShallow.js generated vendored Normal file
View File

@ -0,0 +1,239 @@
'use strict'
function diffShallow (api, actual, expected, theme, indent) {
const childBuffer = api.lineBuilder.buffer()
const propertyBuffer = api.lineBuilder.buffer()
return {
append (formatted, origin) {
if (origin.isItem === true) {
childBuffer.append(formatted)
} else {
propertyBuffer.append(formatted)
}
},
finalize: () => {
const namesAreEqual = actual.compareNames(expected)
const actualName = actual.formatName(theme)
const expectedName = expected.formatName(theme)
const openTag = theme.react.openTag
const innerIndentation = indent.increase()
const allChildren = childBuffer.withFirstPrefixed(innerIndentation)
const children = allChildren.decompose()
const allProperties = propertyBuffer.withFirstPrefixed(innerIndentation)
const properties = allProperties.decompose()
// If the first properties are also the last, and either side has no
// children, ensure the properties are treated as being last. This
// leads to a better balanced diff.
if (properties.remaining.isEmpty && (!actual.hasChildren || !expected.hasChildren)) {
properties.last = properties.first
properties.first = {actual: api.lineBuilder.buffer(), expected: api.lineBuilder.buffer()}
}
const result = api.lineBuilder.buffer()
// Create a custom diff that is as neat as possible. It's likely
// there's a generic algorithm that can be used, but for expediency's
// sake handles all possible diffs by brute force instead.
if (actual.hasProperties && expected.hasProperties) {
if (namesAreEqual) {
result
.append(api.lineBuilder.first(openTag.start + actualName))
.append(properties.first.actual.stripFlags())
.append(properties.first.expected.stripFlags())
} else {
result
.append(api.lineBuilder.actual.first(openTag.start + actualName))
.append(properties.first.actual.stripFlags())
.append(api.lineBuilder.expected.first(openTag.start + expectedName))
.append(properties.first.expected.stripFlags())
}
result.append(properties.remaining.stripFlags())
if (actual.hasChildren && expected.hasChildren) {
result
.append(properties.last.actual.stripFlags())
.append(properties.last.expected.stripFlags())
.append(api.lineBuilder.line(indent + openTag.end))
if (namesAreEqual) {
result
.append(allChildren.stripFlags())
.append(api.lineBuilder.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
} else {
result
.append(children.first.actual.stripFlags())
.append(children.first.expected.stripFlags())
.append(children.remaining.stripFlags())
.append(children.last.actual.stripFlags())
.append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
.append(children.last.expected.stripFlags())
.append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName)))
}
} else if (actual.hasChildren) {
result
.append(properties.last.actual.stripFlags())
.append(api.lineBuilder.actual.line(indent + openTag.end))
.append(allChildren.stripFlags())
.append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
.append(properties.last.expected.stripFlags())
.append(api.lineBuilder.expected.last(indent + openTag.selfClose + openTag.end))
} else if (expected.hasChildren) {
result
.append(properties.last.actual.stripFlags())
.append(api.lineBuilder.actual.last(indent + openTag.selfClose + openTag.end))
.append(properties.last.expected.stripFlags())
.append(api.lineBuilder.expected.line(indent + openTag.end))
.append(allChildren.stripFlags())
.append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName)))
} else {
result
.append(properties.last.actual.stripFlags())
.append(properties.last.expected.stripFlags())
.append(api.lineBuilder.last(indent + openTag.selfClose + openTag.end))
}
} else if (actual.hasProperties) {
result
.append(api.lineBuilder.actual.first(openTag.start + actualName))
.append(allProperties.stripFlags())
if (actual.hasChildren && expected.hasChildren) {
result
.append(api.lineBuilder.actual.line(indent + openTag.end))
.append(children.first.actual.stripFlags())
.append(api.lineBuilder.expected.first(openTag.start + expectedName + openTag.end))
.append(children.first.expected.stripFlags())
.append(children.remaining.stripFlags())
if (namesAreEqual) {
result
.append(children.last.actual.stripFlags())
.append(children.last.expected.stripFlags())
.append(api.lineBuilder.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
} else {
result
.append(children.last.actual.stripFlags())
.append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
.append(children.last.expected.stripFlags())
.append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName)))
}
} else if (actual.hasChildren) {
result
.append(api.lineBuilder.actual.last(indent + openTag.selfClose + openTag.end))
.append(allChildren.stripFlags())
.append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
.append(api.lineBuilder.expected.single(openTag.start + expectedName + openTag.selfCloseVoid + openTag.end))
} else if (expected.hasChildren) {
result
.append(api.lineBuilder.actual.last(indent + openTag.selfClose + openTag.end))
.append(api.lineBuilder.expected.first(openTag.start + expectedName + openTag.end))
.append(allChildren.stripFlags())
.append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName)))
} else {
result
.append(api.lineBuilder.actual.last(indent + openTag.selfClose + openTag.end))
.append(api.lineBuilder.expected.single(openTag.start + expectedName + openTag.selfCloseVoid + openTag.end))
}
} else if (expected.hasProperties) {
if (actual.hasChildren && expected.hasChildren) {
result
.append(api.lineBuilder.actual.first(openTag.start + actualName + openTag.end))
.append(children.first.actual.stripFlags())
.append(api.lineBuilder.expected.first(openTag.start + expectedName))
.append(allProperties.stripFlags())
.append(api.lineBuilder.expected.line(indent + openTag.end))
.append(children.first.expected.stripFlags())
.append(children.remaining.stripFlags())
if (namesAreEqual) {
result
.append(children.last.actual.stripFlags())
.append(children.last.expected.stripFlags())
.append(api.lineBuilder.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
} else {
result
.append(children.last.actual.stripFlags())
.append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
.append(children.last.expected.stripFlags())
.append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName)))
}
} else if (actual.hasChildren) {
result
.append(api.lineBuilder.actual.first(openTag.start + actualName + openTag.end))
.append(allChildren.stripFlags())
.append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
.append(api.lineBuilder.expected.first(openTag.start + expectedName))
.append(allProperties.stripFlags())
.append(api.lineBuilder.expected.last(indent + openTag.selfClose + openTag.end))
} else if (expected.hasChildren) {
result
.append(api.lineBuilder.actual.single(openTag.start + actualName + openTag.selfCloseVoid + openTag.end))
.append(api.lineBuilder.expected.first(openTag.start + expectedName))
.append(allProperties.stripFlags())
.append(api.lineBuilder.expected.line(indent + openTag.end))
.append(allChildren.stripFlags())
.append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName)))
} else {
result
.append(api.lineBuilder.actual.single(openTag.start + actualName + openTag.selfCloseVoid + openTag.end))
.append(api.lineBuilder.expected.first(openTag.start + expectedName))
.append(allProperties.stripFlags())
.append(api.lineBuilder.expected.last(indent + openTag.selfCloseVoid + openTag.end))
}
} else {
if (actual.hasChildren && expected.hasChildren) {
if (namesAreEqual) {
result
.append(api.lineBuilder.first(openTag.start + actualName + openTag.end))
.append(allChildren.stripFlags())
.append(api.lineBuilder.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
} else {
result
.append(api.lineBuilder.actual.first(openTag.start + actualName + openTag.end))
.append(children.first.actual.stripFlags())
.append(api.lineBuilder.expected.first(openTag.start + expectedName + openTag.end))
.append(children.first.expected.stripFlags())
.append(children.remaining.stripFlags())
.append(children.last.actual.stripFlags())
.append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
.append(children.last.expected.stripFlags())
.append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, expectedName)))
}
} else if (actual.hasChildren) {
result
.append(api.lineBuilder.actual.first(openTag.start + actualName + openTag.end))
.append(allChildren.stripFlags())
.append(api.lineBuilder.actual.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
.append(api.lineBuilder.expected.single(openTag.start + expectedName + openTag.selfCloseVoid + openTag.end))
} else if (expected.hasChildren) {
result
.append(api.lineBuilder.actual.single(openTag.start + actualName + openTag.selfCloseVoid + openTag.end))
.append(api.lineBuilder.expected.first(openTag.start + expectedName + openTag.end))
.append(allChildren.stripFlags())
.append(api.lineBuilder.expected.last(indent + api.wrapFromTheme(theme.react.closeTag, actualName)))
} else {
if (namesAreEqual) {
result.append(api.lineBuilder.single(openTag.start + actualName + openTag.selfCloseVoid + openTag.end))
} else {
result
.append(api.lineBuilder.actual.single(openTag.start + actualName + openTag.selfCloseVoid + openTag.end))
.append(api.lineBuilder.expected.single(openTag.start + expectedName + openTag.selfCloseVoid + openTag.end))
}
}
}
return result
},
shouldFormat (subject) {
return subject.isItem === true || subject.isProperty === true
},
increaseIndent: true
}
}
module.exports = diffShallow

349
node_modules/@concordance/react/lib/elementFactory.js generated vendored Normal file
View File

@ -0,0 +1,349 @@
'use strict'
const arrify = require('arrify')
const diffShallow = require('./diffShallow')
const escapeText = require('./escapeText')
function factory (api, reactTags) {
const tag = Symbol('@concordance/react.ElementValue')
function customPropertyFormatter (theme, indent, key, value) {
const separator = theme.react.attribute.separator + theme.react.attribute.value.openBracket
if (value.isSingle) {
return value
.withFirstPrefixed(key.formatAsKey(theme) + separator)
.withLastPostfixed(theme.react.attribute.value.closeBracket)
}
return api.lineBuilder.first(key.formatAsKey(theme) + separator)
.concat(value.withFirstPrefixed(indent.increase()).stripFlags())
.append(api.lineBuilder.last(indent + theme.react.attribute.value.closeBracket))
}
function themeProperty (theme) {
theme.property.increaseValueIndent = true
theme.property.customFormat = customPropertyFormatter
}
function themeStringProperty (theme) {
theme.property.separator = theme.react.attribute.separator
theme.property.after = ''
Object.assign(theme.string.line, theme.react.attribute.value.string.line)
}
function customItemFormatter (theme, indent, value) {
if (value.isSingle) {
return value
.withFirstPrefixed(theme.react.child.openBracket)
.withLastPostfixed(theme.react.child.closeBracket)
}
return api.lineBuilder.first(theme.react.child.openBracket)
.concat(value.withFirstPrefixed(indent.increase()).stripFlags())
.append(api.lineBuilder.last(indent + theme.react.child.closeBracket))
}
function themeChild (theme) {
theme.item.increaseValueIndent = true
theme.item.customFormat = customItemFormatter
}
function themeReactChild (theme) {
theme.item.after = ''
}
function themeStringChild (theme) {
theme.item.after = ''
Object.assign(theme.string, theme.react.child.string)
}
function describe (props) {
const element = props.value
const type = element.type
const hasTypeFn = typeof type === 'function'
const typeFn = hasTypeFn ? type : null
const name = hasTypeFn ? type.displayName || type.name : type
const children = arrify(element.props.children)
const properties = Object.assign({}, element.props)
delete properties.children
if (element.key !== null) {
properties.key = element.key
}
const hasProperties = Object.keys(properties).length > 0
return new DescribedElementValue(Object.assign({
children,
hasProperties,
hasTypeFn,
name,
properties,
typeFn,
isList: children.length > 0
}, props))
}
function deserialize (state, recursor) {
return new DeserializedElementValue(state, recursor)
}
class ElementValue extends api.ObjectValue {
constructor (props) {
super(props)
this.name = props.name
this.hasProperties = props.hasProperties
this.hasTypeFn = props.hasTypeFn
this.hasChildren = this.isList
}
compare (expected) {
return this.tag === expected.tag && this.name === expected.name
? api.SHALLOW_EQUAL
: api.UNEQUAL
}
formatName (theme) {
const formatted = api.wrapFromTheme(theme.react.tagName, this.name)
return this.hasTypeFn
? formatted + theme.react.functionType
: formatted
}
compareNames (expected) {
return this.name === expected.name && this.hasTypeFn === expected.hasTypeFn
}
formatShallow (theme, indent) {
const childBuffer = api.lineBuilder.buffer()
const propertyBuffer = api.lineBuilder.buffer()
return {
append (formatted, origin) {
if (origin.isItem === true) {
childBuffer.append(formatted)
} else {
propertyBuffer.append(formatted)
}
},
finalize: () => {
const name = this.formatName(theme)
const openTag = theme.react.openTag
if (!this.hasChildren && !this.hasProperties) {
return api.lineBuilder.single(openTag.start + name + openTag.selfCloseVoid + openTag.end)
}
const innerIndentation = indent.increase()
const children = childBuffer.withFirstPrefixed(innerIndentation).stripFlags()
const properties = propertyBuffer.withFirstPrefixed(innerIndentation).stripFlags()
const result = api.lineBuilder.buffer()
if (this.hasProperties) {
result
.append(api.lineBuilder.first(openTag.start + name))
.append(properties)
if (this.hasChildren) {
result.append(api.lineBuilder.line(indent + openTag.end))
} else {
result.append(api.lineBuilder.last(indent + openTag.selfClose + openTag.end))
}
} else {
result.append(api.lineBuilder.first(openTag.start + name + openTag.end))
}
if (this.hasChildren) {
result
.append(children)
.append(api.lineBuilder.last(indent + api.wrapFromTheme(theme.react.closeTag, name)))
}
return result
},
maxDepth: () => {
const name = this.formatName(theme)
const openTag = theme.react.openTag
if (!this.hasChildren && !this.hasProperties) {
return api.lineBuilder.single(openTag.start + name + openTag.selfCloseVoid + openTag.end)
}
let str = openTag.start + name
if (this.hasProperties) {
str += theme.maxDepth
if (this.hasChildren) {
str += openTag.end
} else {
str += ' ' + openTag.selfClose + openTag.end
}
} else {
str += openTag.end
}
if (this.hasChildren) {
str += theme.maxDepth + api.wrapFromTheme(theme.react.closeTag, name)
}
return api.lineBuilder.single(str)
},
shouldFormat (subject) {
return subject.isItem === true || subject.isProperty === true
},
increaseIndent: true
}
}
prepareDiff (expected) {
return {
compareResult: this.tag === expected.tag
? api.SHALLOW_EQUAL
: api.UNEQUAL
}
}
diffShallow (expected, theme, indent) {
return diffShallow(api, this, expected, theme, indent)
}
serialize () {
return [this.name, this.hasProperties, this.hasTypeFn, super.serialize()]
}
}
Object.defineProperty(ElementValue.prototype, 'tag', {value: tag})
function modifyThemes (recursor) {
return api.mapRecursor(recursor, next => {
let modifier
if (next.isItem === true) {
if (next.tag === api.descriptorTags.primitiveItem && next.value.tag === api.descriptorTags.string) {
modifier = themeStringChild
} else if (next.tag === api.descriptorTags.complexItem && reactTags.has(next.value.tag)) {
modifier = themeReactChild
} else {
modifier = themeChild
}
} else if (next.isProperty === true) {
if (
next.tag === api.descriptorTags.primitiveProperty &&
next.value.tag === api.descriptorTags.string &&
!next.value.includesLinebreaks
) {
modifier = themeStringProperty
} else {
modifier = themeProperty
}
}
return modifier
? api.modifyTheme(next, modifier)
: next
})
}
function DescribedMixin (base) {
return class extends api.DescribedMixin(base) {
constructor (props) {
super(props)
this.children = props.children
this.properties = props.properties
this.typeFn = props.typeFn
}
compare (expected) {
const result = super.compare(expected)
return result === api.SHALLOW_EQUAL && this.typeFn !== expected.typeFn
? api.UNEQUAL
: result
}
compareNames (expected) {
return super.compareNames(expected) && this.typeFn === expected.typeFn
}
createPropertyRecursor () {
// Symbols are not valid property keys for React elements. This code
// also assumes that the keys can be formatted as JSX-like attribute
// names. Keys are not pre-escaped before being passed to Concordance's
// property descriptor.
const keys = Object.keys(this.properties).sort()
const size = keys.length
let index = 0
const next = () => {
if (index === size) return null
const key = keys[index++]
// Note that string values are not specifically escaped such that the
// output is valid JSX.
return this.describeProperty(key, this.describeAny(this.properties[key]))
}
return {size, next}
}
createListRecursor () {
if (!this.isList) return super.createListRecursor()
const size = this.children.length
let index = 0
const next = () => {
if (index === size) return null
const current = index++
const child = this.children[current]
const type = typeof child
let descriptor
if (type === 'string') {
descriptor = this.describeAny(escapeText(child))
} else {
descriptor = this.describeAny(child)
}
return this.describeItem(current, descriptor)
}
return {size, next}
}
createRecursor () {
return modifyThemes(super.createRecursor())
}
}
}
function DeserializedMixin (base) {
return class extends api.DeserializedMixin(base) {
constructor (state, recursor) {
super(state[3], recursor)
this.name = state[0]
this.hasProperties = state[1]
this.hasTypeFn = state[2]
}
createRecursor () {
return modifyThemes(super.createRecursor())
}
}
}
const DescribedElementValue = DescribedMixin(ElementValue)
const DeserializedElementValue = DeserializedMixin(ElementValue)
return {
DescribedMixin,
DeserializedMixin,
ElementValue,
describe,
deserialize,
tag
}
}
module.exports = factory

10
node_modules/@concordance/react/lib/escapeText.js generated vendored Normal file
View File

@ -0,0 +1,10 @@
'use strict'
function escapeText (text) {
return text
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
// TODO: Escape characters that Concordance would otherwise replace with \u
// sequences.
}
module.exports = escapeText

59
node_modules/@concordance/react/lib/testJsonFactory.js generated vendored Normal file
View File

@ -0,0 +1,59 @@
'use strict'
const arrify = require('arrify')
function factory (api, element) {
const tag = Symbol('@concordance/react.TestJsonValue')
function describe (props) {
const obj = props.value
const name = obj.type
const children = arrify(obj.children)
const properties = Object.assign({}, obj.props)
const hasProperties = Object.keys(properties).length > 0
return new DescribedTestJsonValue(Object.assign({
children,
hasProperties,
hasTypeFn: false,
name,
properties,
typeFn: null,
isList: children.length > 0
}, props))
}
function deserialize (state, recursor) {
return new DeserializedTestJsonValue(state, recursor)
}
class TestJsonValue extends element.ElementValue {
compare (expected) {
// Allow expected value to be a React element.
return (this.tag === expected.tag || expected.tag === element.tag) && this.name === expected.name
? api.SHALLOW_EQUAL
: api.UNEQUAL
}
prepareDiff (expected) {
return {
// Allow expected value to be a React element.
compareResult: this.tag === expected.tag || expected.tag === element.tag
? api.SHALLOW_EQUAL
: api.UNEQUAL
}
}
}
Object.defineProperty(TestJsonValue.prototype, 'tag', {value: tag})
const DescribedTestJsonValue = element.DescribedMixin(TestJsonValue)
const DeserializedTestJsonValue = element.DeserializedMixin(TestJsonValue)
return {
describe,
deserialize,
tag
}
}
module.exports = factory

80
node_modules/@concordance/react/package.json generated vendored Normal file
View File

@ -0,0 +1,80 @@
{
"name": "@concordance/react",
"version": "1.0.0",
"description": "Compare, format, diff and serialize React trees with Concordance",
"main": "index.js",
"files": [
"lib",
"index.js"
],
"engines": {
"node": ">=4.5"
},
"scripts": {
"build:fixtures": "babel --presets=react,@ava/stage-4 --out-dir=test/fixtures/react --extensions=.jsx test/fixtures/react",
"coverage": "nyc npm test",
"lint": "as-i-preach",
"pretest": "npm run build:fixtures",
"test": "ava",
"posttest": "as-i-preach"
},
"repository": {
"type": "git",
"url": "git+https://github.com/concordancejs/react.git"
},
"author": "Mark Wubben (https://novemberborn.net/)",
"license": "ISC",
"bugs": {
"url": "https://github.com/concordancejs/react/issues"
},
"homepage": "https://github.com/concordancejs/react#readme",
"keywords": [
"concordance-plugin",
"concordance",
"react"
],
"dependencies": {
"arrify": "^1.0.1"
},
"devDependencies": {
"@novemberborn/as-i-preach": "^10.0.1",
"ava": "^0.19.0",
"babel-cli": "^6.24.1",
"babel-core": "^6.25.0",
"babel-preset-react": "^6.24.1",
"codecov": "^2.1.0",
"concordance": "^1.0.0",
"nyc": "^11.0.1",
"react": "^15.6.1",
"react-test-renderer": "^15.6.1"
},
"as-i-preach": {
"allowDevDependencies": [
"test/**/*.js",
"test/**/*.jsx"
],
"ignore": [
"test/fixtures/react/*.js"
]
},
"ava": {
"source": [
"!test/**/*.js.snap"
],
"babel": {
"presets": [
"@ava/stage-4",
"@ava/transform-test-files",
"react"
]
}
},
"nyc": {
"reporter": [
"html",
"lcov",
"text"
]
},
"standard-engine": "@novemberborn/as-i-preach"
}

16
node_modules/@soyuka/exists-sync/index.js generated vendored Normal file
View File

@ -0,0 +1,16 @@
'use strict'
const fs = require('fs')
/**
* fs.existsSync is deprecated
*/
module.exports = function existsSync(path) {
var exists = false
try {
fs.accessSync(path, fs.F_OK)
exists = true
} catch(e) {}
return exists
}

22
node_modules/@soyuka/exists-sync/package.json generated vendored Normal file
View File

@ -0,0 +1,22 @@
{
"name": "@soyuka/exists-sync",
"version": "1.0.1",
"description": "fs.existsSync polyfill",
"main": "index.js",
"scripts": {
"test": "./node_modules/mocha/bin/mocha test.js"
},
"engines": {
"node": ">4.0"
},
"keywords": [
"fs",
"exists"
],
"author": "soyuka",
"repository": "http://github.com/soyuka/existsSync",
"license": "MIT",
"devDependencies": {
"mocha": "^2.3.4"
}
}

13
node_modules/@soyuka/exists-sync/test.js generated vendored Normal file
View File

@ -0,0 +1,13 @@
'use strict'
const existsSync = require('./index.js')
const assert = require('assert')
describe('exists', function() {
it('should exists', function() {
assert(existsSync('./package.json'))
})
it('should not exists', function() {
assert(!existsSync('./nonexistant'))
})
})

42
node_modules/@types/fs-extra/LICENSE generated vendored
View File

@ -1,21 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
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
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
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

View File

@ -8,7 +8,7 @@ This package contains type definitions for fs-extra (https://github.com/jprichar
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fs-extra
Additional Details
* Last updated: Mon, 22 May 2017 17:16:10 GMT
* Last updated: Sat, 22 Jul 2017 19:03:51 GMT
* Dependencies: fs, node
* Global values: none

View File

@ -1,293 +1,304 @@
// Type definitions for fs-extra 3.0
// Project: https://github.com/jprichardson/node-fs-extra
// Definitions by: Alan Agius <https://github.com/alan-agius4>
// midknight41 <https://github.com/midknight41>
// Brendan Forster <https://github.com/shiftkey>
// Mees van Dijk <https://github.com/mees->
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="node" />
import { Stats } from "fs";
export * from "fs";
export function copy(src: string, dest: string, options?: CopyOptions): Promise<void>;
export function copy(src: string, dest: string, callback: (err: Error) => void): void;
export function copy(src: string, dest: string, options: CopyOptions, callback: (err: Error) => void): void;
export function copySync(src: string, dest: string, options?: CopyOptions): void;
export function move(src: string, dest: string, options?: MoveOptions): Promise<void>;
export function move(src: string, dest: string, callback: (err: Error) => void): void;
export function move(src: string, dest: string, options: MoveOptions, callback: (err: Error) => void): void;
export function moveSync(src: string, dest: string, options?: MoveOptions): void;
export function createFile(file: string): Promise<void>;
export function createFile(file: string, callback: (err: Error) => void): void;
export function createFileSync(file: string): void;
export function ensureDir(path: string): Promise<void>;
export function ensureDir(path: string, callback: (err: Error) => void): void;
export function ensureDirSync(path: string): void;
export function mkdirs(dir: string): Promise<void>;
export function mkdirs(dir: string, callback: (err: Error) => void): void;
export function mkdirp(dir: string): Promise<void>;
export function mkdirp(dir: string, callback: (err: Error) => void): void;
export function mkdirsSync(dir: string): void;
export function mkdirpSync(dir: string): void;
export function outputFile(file: string, data: any): Promise<void>;
export function outputFile(file: string, data: any, callback: (err: Error) => void): void;
export function outputFileSync(file: string, data: any): void;
export function readJson(file: string, options?: ReadOptions): Promise<any>;
export function readJson(file: string, callback: (err: Error, jsonObject: any) => void): void;
export function readJson(file: string, options: ReadOptions, callback: (err: Error, jsonObject: any) => void): void;
export function readJSON(file: string, options?: ReadOptions): Promise<any>;
export function readJSON(file: string, callback: (err: Error, jsonObject: any) => void): void;
export function readJSON(file: string, options: ReadOptions, callback: (err: Error, jsonObject: any) => void): void;
export function readJsonSync(file: string, options?: ReadOptions): any;
export function readJSONSync(file: string, options?: ReadOptions): any;
export function remove(dir: string): Promise<void>;
export function remove(dir: string, callback: (err: Error) => void): void;
export function removeSync(dir: string): void;
export function outputJSON(file: string, data: any, options?: WriteOptions): Promise<void>;
export function outputJSON(file: string, data: any, options: WriteOptions, callback: (err: Error) => void): void;
export function outputJSON(file: string, data: any, callback: (err: Error) => void): void;
export function outputJson(file: string, data: any, options?: WriteOptions): Promise<void>;
export function outputJson(file: string, data: any, options: WriteOptions, callback: (err: Error) => void): void;
export function outputJson(file: string, data: any, callback: (err: Error) => void): void;
export function outputJsonSync(file: string, data: any, options?: WriteOptions): void;
export function outputJSONSync(file: string, data: any, options?: WriteOptions): void;
export function writeJSON(file: string, object: any, options?: WriteOptions): Promise<void>;
export function writeJSON(file: string, object: any, callback: (err: Error) => void): void;
export function writeJSON(file: string, object: any, options: WriteOptions, callback: (err: Error) => void): void;
export function writeJson(file: string, object: any, options?: WriteOptions): Promise<void>;
export function writeJson(file: string, object: any, callback: (err: Error) => void): void;
export function writeJson(file: string, object: any, options: WriteOptions, callback: (err: Error) => void): void;
export function writeJsonSync(file: string, object: any, options?: WriteOptions): void;
export function writeJSONSync(file: string, object: any, options?: WriteOptions): void;
export function ensureFile(path: string): Promise<void>;
export function ensureFile(path: string, callback: (err: Error) => void): void;
export function ensureFileSync(path: string): void;
export function ensureLink(path: string): Promise<void>;
export function ensureLink(path: string, callback: (err: Error) => void): void;
export function ensureLinkSync(path: string): void;
export function ensureSymlink(path: string): Promise<void>;
export function ensureSymlink(path: string, callback: (err: Error) => void): void;
export function ensureSymlinkSync(path: string): void;
export function emptyDir(path: string): Promise<void>;
export function emptyDir(path: string, callback: (err: Error) => void): void;
export function emptyDirSync(path: string): void;
export function pathExists(path: string): Promise<boolean>;
export function pathExists(path: string, callback: (err: Error, exists: boolean) => void): void;
export function pathExistsSync(path: string): boolean;
// fs async methods
// copied from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/v6/index.d.ts
/** Tests a user's permissions for the file specified by path. */
export function access(path: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void;
export function access(path: string | Buffer, mode: number, callback: (err: NodeJS.ErrnoException) => void): void;
export function access(path: string | Buffer, mode?: number): Promise<void>;
export function appendFile(file: string | Buffer | number, data: any, options: { encoding?: string; mode?: number | string; flag?: string; }, callback: (err: NodeJS.ErrnoException) => void): void;
export function appendFile(file: string | Buffer | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void;
export function appendFile(file: string | Buffer | number, data: any, options?: { encoding?: string; mode?: number | string; flag?: string; }): Promise<void>;
export function chmod(path: string | Buffer, mode: string | number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function chmod(path: string | Buffer, mode: string | number): Promise<void>;
export function chown(path: string | Buffer, uid: number, gid: number): Promise<void>;
export function chown(path: string | Buffer, uid: number, gid: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function close(fd: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function close(fd: number): Promise<void>;
export function fchmod(fd: number, mode: string | number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function fchmod(fd: number, mode: string | number): Promise<void>;
export function fchown(fd: number, uid: number, gid: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function fchown(fd: number, uid: number, gid: number): Promise<void>;
export function fdatasync(fd: number, callback: () => void): void;
export function fdatasync(fd: number): Promise<void>;
export function fstat(fd: number, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
export function fstat(fd: number): Promise<Stats>;
export function fsync(fd: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function fsync(fd: number): Promise<void>;
export function ftruncate(fd: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function ftruncate(fd: number, len: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function ftruncate(fd: number, len?: number): Promise<void>;
export function futimes(fd: number, atime: number, mtime: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function futimes(fd: number, atime: Date, mtime: Date, callback: (err?: NodeJS.ErrnoException) => void): void;
export function futimes(fd: number, atime: number, mtime: number): Promise<void>;
export function futimes(fd: number, atime: Date, mtime: Date): Promise<void>;
export function lchown(path: string | Buffer, uid: number, gid: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function lchown(path: string | Buffer, uid: number, gid: number): Promise<void>;
export function link(srcpath: string | Buffer, dstpath: string | Buffer, callback: (err?: NodeJS.ErrnoException) => void): void;
export function link(srcpath: string | Buffer, dstpath: string | Buffer): Promise<void>;
export function lstat(path: string | Buffer, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
export function lstat(path: string | Buffer): Promise<Stats>;
/**
* Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
*
* @param path
* @param callback No arguments other than a possible exception are given to the completion callback.
*/
export function mkdir(path: string | Buffer, callback: (err?: NodeJS.ErrnoException) => void): void;
/**
* Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
*
* @param path
* @param mode
* @param callback No arguments other than a possible exception are given to the completion callback.
*/
export function mkdir(path: string | Buffer, mode: number | string, callback: (err?: NodeJS.ErrnoException) => void): void;
export function mkdir(path: string | Buffer): Promise<void>;
export function open(path: string | Buffer, flags: string | number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void;
export function open(path: string | Buffer, flags: string | number, mode: number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void;
export function open(path: string | Buffer, flags: string | number, mode?: number): Promise<number>;
export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number | null, callback: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void;
export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number | null): Promise<[number, Buffer]>;
export function readFile(file: string | Buffer | number, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
export function readFile(file: string | Buffer | number, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void;
export function readFile(file: string | Buffer | number, options: { flag?: string; } | { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
export function readFile(file: string | Buffer | number, options: { flag?: string; } | { encoding: string; flag?: string; }): Promise<string>;
// tslint:disable-next-line:unified-signatures
export function readFile(file: string | Buffer | number, encoding: string): Promise<string>;
export function readFile(file: string | Buffer | number): Promise<Buffer>;
export function readdir(path: string | Buffer, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void;
export function readdir(path: string | Buffer): Promise<string[]>;
export function readlink(path: string | Buffer, callback: (err: NodeJS.ErrnoException, linkString: string) => any): void;
export function readlink(path: string | Buffer): Promise<string>;
export function realpath(path: string | Buffer, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void;
export function realpath(path: string | Buffer, cache: { [path: string]: string }, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void;
export function realpath(path: string | Buffer, cache?: { [path: string]: string }): Promise<string>;
export function rename(oldPath: string, newPath: string, callback: (err?: NodeJS.ErrnoException) => void): void;
export function rename(oldPath: string, newPath: string): Promise<void>;
/**
* Asynchronous rmdir - removes the directory specified in {path}
*
* @param path
* @param callback No arguments other than a possible exception are given to the completion callback.
*/
export function rmdir(path: string | Buffer, callback: (err?: NodeJS.ErrnoException) => void): void;
export function rmdir(path: string | Buffer): Promise<void>;
export function stat(path: string | Buffer, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
export function stat(path: string | Buffer): Promise<Stats>;
export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type: string, callback: (err?: NodeJS.ErrnoException) => void): void;
export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type?: string): Promise<void>;
export function truncate(path: string | Buffer, callback: (err?: NodeJS.ErrnoException) => void): void;
export function truncate(path: string | Buffer, len: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function truncate(path: string | Buffer, len?: number): Promise<void>;
/**
* Asynchronous unlink - deletes the file specified in {path}
*
* @param path
* @param callback No arguments other than a possible exception are given to the completion callback.
*/
export function unlink(path: string | Buffer, callback: (err?: NodeJS.ErrnoException) => void): void;
export function unlink(path: string | Buffer): Promise<void>;
export function utimes(path: string | Buffer, atime: number, mtime: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function utimes(path: string | Buffer, atime: Date, mtime: Date, callback: (err?: NodeJS.ErrnoException) => void): void;
export function utimes(path: string | Buffer, atime: number, mtime: number): Promise<void>;
export function utimes(path: string | Buffer, atime: Date, mtime: Date): Promise<void>;
export function write(fd: number, buffer: Buffer, offset: number, length: number, position: number | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void;
export function write(fd: number, buffer: Buffer, offset: number, length: number, callback: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void;
export function write(fd: number, data: any, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
export function write(fd: number, data: any, offset: number, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
export function write(fd: number, data: any, offset: number, encoding: string, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
export function write(fd: number, buffer: Buffer, offset: number, length: number, position?: number | null): Promise<[number, Buffer]>;
export function write(fd: number, data: any, offset: number, encoding?: string): Promise<[number, string]>;
export function writeFile(file: string | Buffer | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void;
export function writeFile(file: string | Buffer | number, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): Promise<void>;
export function writeFile(file: string | Buffer | number, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback: (err: NodeJS.ErrnoException) => void): void;
/**
* Asynchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
*
* @param prefix
* @param callback The created folder path is passed as a string to the callback's second parameter.
*/
export function mkdtemp(prefix: string): Promise<string>;
export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException, folder: string) => void): void;
export interface PathEntry {
path: string;
stats: Stats;
}
export interface PathEntryStream {
read(): PathEntry | null;
}
export type CopyFilterFunction = (src: string) => boolean;
export type CopyFilter = CopyFilterFunction | RegExp;
export interface CopyOptions {
dereference?: boolean;
overwrite?: boolean;
preserveTimestamps?: boolean;
errorOnExist?: boolean;
filter?: CopyFilter;
recursive?: boolean;
}
export interface MoveOptions {
overwrite?: boolean;
limit?: number;
}
export interface ReadOptions {
throws?: boolean;
fs?: object;
reviver?: any;
encoding?: string;
flag?: string;
}
export interface WriteOptions {
fs?: object;
replacer?: any;
spaces?: number;
encoding?: string;
flag?: string;
mode?: number;
}
// Type definitions for fs-extra 4.0
// Project: https://github.com/jprichardson/node-fs-extra
// Definitions by: Alan Agius <https://github.com/alan-agius4>,
// midknight41 <https://github.com/midknight41>,
// Brendan Forster <https://github.com/shiftkey>,
// Mees van Dijk <https://github.com/mees->
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="node" />
import { Stats } from "fs";
export * from "fs";
export function copy(src: string, dest: string, options?: CopyOptions): Promise<void>;
export function copy(src: string, dest: string, callback: (err: Error) => void): void;
export function copy(src: string, dest: string, options: CopyOptions, callback: (err: Error) => void): void;
export function copySync(src: string, dest: string, options?: CopyOptions): void;
export function move(src: string, dest: string, options?: MoveOptions): Promise<void>;
export function move(src: string, dest: string, callback: (err: Error) => void): void;
export function move(src: string, dest: string, options: MoveOptions, callback: (err: Error) => void): void;
export function moveSync(src: string, dest: string, options?: MoveOptions): void;
export function createFile(file: string): Promise<void>;
export function createFile(file: string, callback: (err: Error) => void): void;
export function createFileSync(file: string): void;
export function ensureDir(path: string): Promise<void>;
export function ensureDir(path: string, callback: (err: Error) => void): void;
export function ensureDirSync(path: string): void;
export function mkdirs(dir: string): Promise<void>;
export function mkdirs(dir: string, callback: (err: Error) => void): void;
export function mkdirp(dir: string): Promise<void>;
export function mkdirp(dir: string, callback: (err: Error) => void): void;
export function mkdirsSync(dir: string): void;
export function mkdirpSync(dir: string): void;
export function outputFile(file: string, data: any): Promise<void>;
export function outputFile(file: string, data: any, callback: (err: Error) => void): void;
export function outputFileSync(file: string, data: any): void;
export function readJson(file: string, options?: ReadOptions): Promise<any>;
export function readJson(file: string, callback: (err: Error, jsonObject: any) => void): void;
export function readJson(file: string, options: ReadOptions, callback: (err: Error, jsonObject: any) => void): void;
export function readJSON(file: string, options?: ReadOptions): Promise<any>;
export function readJSON(file: string, callback: (err: Error, jsonObject: any) => void): void;
export function readJSON(file: string, options: ReadOptions, callback: (err: Error, jsonObject: any) => void): void;
export function readJsonSync(file: string, options?: ReadOptions): any;
export function readJSONSync(file: string, options?: ReadOptions): any;
export function remove(dir: string): Promise<void>;
export function remove(dir: string, callback: (err: Error) => void): void;
export function removeSync(dir: string): void;
export function outputJSON(file: string, data: any, options?: WriteOptions): Promise<void>;
export function outputJSON(file: string, data: any, options: WriteOptions, callback: (err: Error) => void): void;
export function outputJSON(file: string, data: any, callback: (err: Error) => void): void;
export function outputJson(file: string, data: any, options?: WriteOptions): Promise<void>;
export function outputJson(file: string, data: any, options: WriteOptions, callback: (err: Error) => void): void;
export function outputJson(file: string, data: any, callback: (err: Error) => void): void;
export function outputJsonSync(file: string, data: any, options?: WriteOptions): void;
export function outputJSONSync(file: string, data: any, options?: WriteOptions): void;
export function writeJSON(file: string, object: any, options?: WriteOptions): Promise<void>;
export function writeJSON(file: string, object: any, callback: (err: Error) => void): void;
export function writeJSON(file: string, object: any, options: WriteOptions, callback: (err: Error) => void): void;
export function writeJson(file: string, object: any, options?: WriteOptions): Promise<void>;
export function writeJson(file: string, object: any, callback: (err: Error) => void): void;
export function writeJson(file: string, object: any, options: WriteOptions, callback: (err: Error) => void): void;
export function writeJsonSync(file: string, object: any, options?: WriteOptions): void;
export function writeJSONSync(file: string, object: any, options?: WriteOptions): void;
export function ensureFile(path: string): Promise<void>;
export function ensureFile(path: string, callback: (err: Error) => void): void;
export function ensureFileSync(path: string): void;
export function ensureLink(src: string, dest: string): Promise<void>;
export function ensureLink(src: string, dest: string, callback: (err: Error) => void): void;
export function ensureLinkSync(src: string, dest: string): void;
export function ensureSymlink(src: string, dest: string, type?: SymlinkType): Promise<void>;
export function ensureSymlink(src: string, dest: string, type: SymlinkType, callback: (err: Error) => void): void;
export function ensureSymlink(src: string, dest: string, callback: (err: Error) => void): void;
export function ensureSymlinkSync(src: string, dest: string, type?: SymlinkType): void;
export function emptyDir(path: string): Promise<void>;
export function emptyDir(path: string, callback: (err: Error) => void): void;
export function emptyDirSync(path: string): void;
export function pathExists(path: string): Promise<boolean>;
export function pathExists(path: string, callback: (err: Error, exists: boolean) => void): void;
export function pathExistsSync(path: string): boolean;
// fs async methods
// copied from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/v6/index.d.ts
/** Tests a user's permissions for the file specified by path. */
export function access(path: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void;
export function access(path: string | Buffer, mode: number, callback: (err: NodeJS.ErrnoException) => void): void;
export function access(path: string | Buffer, mode?: number): Promise<void>;
export function appendFile(file: string | Buffer | number, data: any, options: { encoding?: string; mode?: number | string; flag?: string; }, callback: (err: NodeJS.ErrnoException) => void): void;
export function appendFile(file: string | Buffer | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void;
export function appendFile(file: string | Buffer | number, data: any, options?: { encoding?: string; mode?: number | string; flag?: string; }): Promise<void>;
export function chmod(path: string | Buffer, mode: string | number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function chmod(path: string | Buffer, mode: string | number): Promise<void>;
export function chown(path: string | Buffer, uid: number, gid: number): Promise<void>;
export function chown(path: string | Buffer, uid: number, gid: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function close(fd: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function close(fd: number): Promise<void>;
export function fchmod(fd: number, mode: string | number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function fchmod(fd: number, mode: string | number): Promise<void>;
export function fchown(fd: number, uid: number, gid: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function fchown(fd: number, uid: number, gid: number): Promise<void>;
export function fdatasync(fd: number, callback: () => void): void;
export function fdatasync(fd: number): Promise<void>;
export function fstat(fd: number, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
export function fstat(fd: number): Promise<Stats>;
export function fsync(fd: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function fsync(fd: number): Promise<void>;
export function ftruncate(fd: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function ftruncate(fd: number, len: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function ftruncate(fd: number, len?: number): Promise<void>;
export function futimes(fd: number, atime: number, mtime: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function futimes(fd: number, atime: Date, mtime: Date, callback: (err?: NodeJS.ErrnoException) => void): void;
export function futimes(fd: number, atime: number, mtime: number): Promise<void>;
export function futimes(fd: number, atime: Date, mtime: Date): Promise<void>;
export function lchown(path: string | Buffer, uid: number, gid: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function lchown(path: string | Buffer, uid: number, gid: number): Promise<void>;
export function link(srcpath: string | Buffer, dstpath: string | Buffer, callback: (err?: NodeJS.ErrnoException) => void): void;
export function link(srcpath: string | Buffer, dstpath: string | Buffer): Promise<void>;
export function lstat(path: string | Buffer, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
export function lstat(path: string | Buffer): Promise<Stats>;
/**
* Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
*
* @param path
* @param callback No arguments other than a possible exception are given to the completion callback.
*/
export function mkdir(path: string | Buffer, callback: (err?: NodeJS.ErrnoException) => void): void;
/**
* Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777.
*
* @param path
* @param mode
* @param callback No arguments other than a possible exception are given to the completion callback.
*/
export function mkdir(path: string | Buffer, mode: number | string, callback: (err?: NodeJS.ErrnoException) => void): void;
export function mkdir(path: string | Buffer): Promise<void>;
export function open(path: string | Buffer, flags: string | number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void;
export function open(path: string | Buffer, flags: string | number, mode: number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void;
export function open(path: string | Buffer, flags: string | number, mode?: number): Promise<number>;
export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number | null, callback: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void;
export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number | null): Promise<ReadResult>;
export function readFile(file: string | Buffer | number, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
export function readFile(file: string | Buffer | number, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void;
export function readFile(file: string | Buffer | number, options: { flag?: string; } | { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;
export function readFile(file: string | Buffer | number, options: { flag?: string; } | { encoding: string; flag?: string; }): Promise<string>;
// tslint:disable-next-line:unified-signatures
export function readFile(file: string | Buffer | number, encoding: string): Promise<string>;
export function readFile(file: string | Buffer | number): Promise<Buffer>;
export function readdir(path: string | Buffer, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void;
export function readdir(path: string | Buffer): Promise<string[]>;
export function readlink(path: string | Buffer, callback: (err: NodeJS.ErrnoException, linkString: string) => any): void;
export function readlink(path: string | Buffer): Promise<string>;
export function realpath(path: string | Buffer, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void;
export function realpath(path: string | Buffer, cache: { [path: string]: string }, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void;
export function realpath(path: string | Buffer, cache?: { [path: string]: string }): Promise<string>;
export function rename(oldPath: string, newPath: string, callback: (err?: NodeJS.ErrnoException) => void): void;
export function rename(oldPath: string, newPath: string): Promise<void>;
/**
* Asynchronous rmdir - removes the directory specified in {path}
*
* @param path
* @param callback No arguments other than a possible exception are given to the completion callback.
*/
export function rmdir(path: string | Buffer, callback: (err?: NodeJS.ErrnoException) => void): void;
export function rmdir(path: string | Buffer): Promise<void>;
export function stat(path: string | Buffer, callback: (err: NodeJS.ErrnoException, stats: Stats) => any): void;
export function stat(path: string | Buffer): Promise<Stats>;
export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type: string, callback: (err?: NodeJS.ErrnoException) => void): void;
export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type?: string): Promise<void>;
export function truncate(path: string | Buffer, callback: (err?: NodeJS.ErrnoException) => void): void;
export function truncate(path: string | Buffer, len: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function truncate(path: string | Buffer, len?: number): Promise<void>;
/**
* Asynchronous unlink - deletes the file specified in {path}
*
* @param path
* @param callback No arguments other than a possible exception are given to the completion callback.
*/
export function unlink(path: string | Buffer, callback: (err?: NodeJS.ErrnoException) => void): void;
export function unlink(path: string | Buffer): Promise<void>;
export function utimes(path: string | Buffer, atime: number, mtime: number, callback: (err?: NodeJS.ErrnoException) => void): void;
export function utimes(path: string | Buffer, atime: Date, mtime: Date, callback: (err?: NodeJS.ErrnoException) => void): void;
export function utimes(path: string | Buffer, atime: number, mtime: number): Promise<void>;
export function utimes(path: string | Buffer, atime: Date, mtime: Date): Promise<void>;
export function write(fd: number, buffer: Buffer, offset: number, length: number, position: number | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void;
export function write(fd: number, buffer: Buffer, offset: number, length: number, callback: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void;
export function write(fd: number, data: any, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
export function write(fd: number, data: any, offset: number, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
export function write(fd: number, data: any, offset: number, encoding: string, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;
export function write(fd: number, buffer: Buffer, offset: number, length: number, position?: number | null): Promise<WriteResult>;
export function write(fd: number, data: any, offset: number, encoding?: string): Promise<WriteResult>;
export function writeFile(file: string | Buffer | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void;
export function writeFile(file: string | Buffer | number, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): Promise<void>;
export function writeFile(file: string | Buffer | number, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback: (err: NodeJS.ErrnoException) => void): void;
/**
* Asynchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
*
* @param prefix
* @param callback The created folder path is passed as a string to the callback's second parameter.
*/
export function mkdtemp(prefix: string): Promise<string>;
export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException, folder: string) => void): void;
export interface PathEntry {
path: string;
stats: Stats;
}
export interface PathEntryStream {
read(): PathEntry | null;
}
export type CopyFilter = ((src: string) => boolean) | RegExp;
export type SymlinkType = "dir" | "file";
export interface CopyOptions {
dereference?: boolean;
overwrite?: boolean;
preserveTimestamps?: boolean;
errorOnExist?: boolean;
filter?: CopyFilter;
recursive?: boolean;
}
export interface MoveOptions {
overwrite?: boolean;
limit?: number;
}
export interface ReadOptions {
throws?: boolean;
fs?: object;
reviver?: any;
encoding?: string;
flag?: string;
}
export interface WriteOptions {
fs?: object;
replacer?: any;
spaces?: number;
encoding?: string;
flag?: string;
mode?: number;
}
export interface ReadResult {
bytesRead: number;
buffer: Buffer;
}
export interface WriteResult {
bytesWritten: number;
buffer: Buffer;
}

View File

@ -1,6 +1,6 @@
{
"name": "@types/fs-extra",
"version": "3.0.2",
"version": "4.0.0",
"description": "TypeScript definitions for fs-extra",
"license": "MIT",
"contributors": [
@ -31,6 +31,6 @@
"@types/node": "*"
},
"peerDependencies": {},
"typesPublisherContentHash": "37438ad45d22ae7e6bac52924874154799724fb330d2ef23effa63ffcde59fc2",
"typesPublisherContentHash": "aab6022d89adf9b5efda4b3aec638f53db29551411847523b25bed9da9297b2b",
"typeScriptVersion": "2.2"
}

18
node_modules/@types/glob/README.md generated vendored Normal file
View File

@ -0,0 +1,18 @@
# Installation
> `npm install --save @types/glob`
# Summary
This package contains type definitions for Glob 5.0.10 (https://github.com/isaacs/node-glob).
# Details
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/glob
Additional Details
* Last updated: Mon, 19 Sep 2016 17:28:59 GMT
* File structure: ProperModule
* Library Dependencies: minimatch, node
* Module Dependencies: events, fs, minimatch
* Global values: G
# Credits
These definitions were written by vvakame <https://github.com/vvakame/>.

109
node_modules/@types/glob/index.d.ts generated vendored Normal file
View File

@ -0,0 +1,109 @@
// Type definitions for Glob 5.0.10
// Project: https://github.com/isaacs/node-glob
// Definitions by: vvakame <https://github.com/vvakame/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
/// <reference types="minimatch" />
import events = require("events");
import fs = require('fs');
import minimatch = require("minimatch");
declare function G(pattern: string, cb: (err: Error, matches: string[]) => void): void;
declare function G(pattern: string, options: G.IOptions, cb: (err: Error, matches: string[]) => void): void;
declare namespace G {
function sync(pattern: string, options?: IOptions): string[];
function hasMagic(pattern: string, options?: IOptions): boolean;
var Glob: IGlobStatic;
var GlobSync: IGlobSyncStatic;
interface IOptions extends minimatch.IOptions {
cwd?: string;
root?: string;
dot?: boolean;
nomount?: boolean;
mark?: boolean;
nosort?: boolean;
stat?: boolean;
silent?: boolean;
strict?: boolean;
cache?: { [path: string]: any /* boolean | string | string[] */ };
statCache?: { [path: string]: fs.Stats };
symlinks?: any;
sync?: boolean;
nounique?: boolean;
nonull?: boolean;
debug?: boolean;
nobrace?: boolean;
noglobstar?: boolean;
noext?: boolean;
nocase?: boolean;
matchBase?: any;
nodir?: boolean;
ignore?: any; /* string | string[] */
follow?: boolean;
realpath?: boolean;
nonegate?: boolean;
nocomment?: boolean;
/** Deprecated. */
globDebug?: boolean;
}
interface IGlobStatic extends events.EventEmitter {
new (pattern: string, cb?: (err: Error, matches: string[]) => void): IGlob;
new (pattern: string, options: IOptions, cb?: (err: Error, matches: string[]) => void): IGlob;
prototype: IGlob;
}
interface IGlobSyncStatic {
new (pattern: string, options?: IOptions): IGlobBase
prototype: IGlobBase;
}
interface IGlobBase {
minimatch: minimatch.IMinimatch;
options: IOptions;
aborted: boolean;
cache: { [path: string]: any /* boolean | string | string[] */ };
statCache: { [path: string]: fs.Stats };
symlinks: { [path: string]: boolean };
realpathCache: { [path: string]: string };
found: string[];
}
interface IGlob extends IGlobBase, events.EventEmitter {
pause(): void;
resume(): void;
abort(): void;
/** Deprecated. */
EOF: any;
/** Deprecated. */
paused: boolean;
/** Deprecated. */
maxDepth: number;
/** Deprecated. */
maxLength: number;
/** Deprecated. */
changedCwd: boolean;
/** Deprecated. */
cwd: string;
/** Deprecated. */
root: string;
/** Deprecated. */
error: any;
/** Deprecated. */
matches: string[];
/** Deprecated. */
log(...args: any[]): void;
/** Deprecated. */
emitMatch(m: any): void;
}
}
export = G;

19
node_modules/@types/glob/package.json generated vendored Normal file
View File

@ -0,0 +1,19 @@
{
"name": "@types/glob",
"version": "5.0.30",
"description": "TypeScript definitions for Glob 5.0.10",
"license": "MIT",
"author": "vvakame <https://github.com/vvakame/>",
"main": "",
"repository": {
"type": "git",
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git"
},
"scripts": {},
"dependencies": {
"@types/minimatch": "*",
"@types/node": "*"
},
"typings": "index.d.ts",
"typesPublisherContentHash": "8c143641642f0e205786502b11aa75903aa26780b026607ed34de6e0836fe815"
}

32
node_modules/@types/glob/types-metadata.json generated vendored Normal file
View File

@ -0,0 +1,32 @@
{
"authors": "vvakame <https://github.com/vvakame/>",
"definitionFilename": "index.d.ts",
"libraryDependencies": [
"minimatch",
"node"
],
"moduleDependencies": [
"events",
"fs",
"minimatch"
],
"libraryMajorVersion": "5",
"libraryMinorVersion": "0",
"libraryName": "Glob 5.0.10",
"typingsPackageName": "glob",
"projectName": "https://github.com/isaacs/node-glob",
"sourceRepoURL": "https://www.github.com/DefinitelyTyped/DefinitelyTyped",
"sourceBranch": "types-2.0",
"kind": "ProperModule",
"globals": [
"G"
],
"declaredModules": [
"glob"
],
"files": [
"index.d.ts"
],
"hasPackageJson": false,
"contentHash": "8c143641642f0e205786502b11aa75903aa26780b026607ed34de6e0836fe815"
}

21
node_modules/@types/handlebars/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
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

View File

@ -5,10 +5,10 @@
This package contains type definitions for Handlebars (http://handlebarsjs.com/).
# Details
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/handlebars
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/handlebars
Additional Details
* Last updated: Fri, 10 Mar 2017 07:28:34 GMT
* Last updated: Mon, 24 Jul 2017 18:01:45 GMT
* Dependencies: none
* Global values: Handlebars, hbs

View File

@ -1,300 +1,314 @@
// Type definitions for Handlebars v4.0.5
// Project: http://handlebarsjs.com/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace Handlebars {
export function registerHelper(name: string, fn: Function, inverse?: boolean): void;
export function registerHelper(name: Object): void;
export function registerPartial(name: string, str: any): void;
export function unregisterHelper(name: string): void;
export function unregisterPartial(name: string): void;
export function registerDecorator(name: string, fn: Function): void;
export function unregisterDecorator(name: string): void;
export function K(): void;
export function createFrame(object: any): any;
export function Exception(message: string): void;
export function log(level: number, obj: any): void;
export function parse(input: string): hbs.AST.Program;
export function compile(input: any, options?: CompileOptions): HandlebarsTemplateDelegate;
export function precompile(input: any, options?: PrecompileOptions): TemplateSpecification;
export function template(precompilation: TemplateSpecification): HandlebarsTemplateDelegate;
export function create(): typeof Handlebars;
export var SafeString: typeof hbs.SafeString;
export var escapeExpression: typeof hbs.Utils.escapeExpression;
export var Utils: typeof hbs.Utils;
export var logger: Logger;
export var templates: HandlebarsTemplates;
export var helpers: { [name: string]: Function };
export var partials: { [name: string]: any };
export var decorators: { [name: string]: Function };
export function registerDecorator(name: string, fn: Function): void;
export function registerDecorator(obj: {[name: string] : Function}): void;
export function unregisterDecorator(name: string): void;
export function noConflict(): typeof Handlebars;
export module AST {
export var helpers: hbs.AST.helpers;
}
interface ICompiler {
accept(node: hbs.AST.Node): void;
Program(program: hbs.AST.Program): void;
BlockStatement(block: hbs.AST.BlockStatement): void;
PartialStatement(partial: hbs.AST.PartialStatement): void;
PartialBlockStatement(partial: hbs.AST.PartialBlockStatement): void;
DecoratorBlock(decorator: hbs.AST.DecoratorBlock): void;
Decorator(decorator: hbs.AST.Decorator): void;
MustacheStatement(mustache: hbs.AST.MustacheStatement): void;
ContentStatement(content: hbs.AST.ContentStatement): void;
CommentStatement(comment?: hbs.AST.CommentStatement): void;
SubExpression(sexpr: hbs.AST.SubExpression): void;
PathExpression(path: hbs.AST.PathExpression): void;
StringLiteral(str: hbs.AST.StringLiteral): void;
NumberLiteral(num: hbs.AST.NumberLiteral): void;
BooleanLiteral(bool: hbs.AST.BooleanLiteral): void;
UndefinedLiteral(): void;
NullLiteral(): void;
Hash(hash: hbs.AST.Hash): void;
}
export class Visitor implements ICompiler {
accept(node: hbs.AST.Node): void;
acceptKey(node: hbs.AST.Node, name: string): void;
acceptArray(arr: hbs.AST.Expression[]): void;
Program(program: hbs.AST.Program): void;
BlockStatement(block: hbs.AST.BlockStatement): void;
PartialStatement(partial: hbs.AST.PartialStatement): void;
PartialBlockStatement(partial: hbs.AST.PartialBlockStatement): void;
DecoratorBlock(decorator: hbs.AST.DecoratorBlock): void;
Decorator(decorator: hbs.AST.Decorator): void;
MustacheStatement(mustache: hbs.AST.MustacheStatement): void;
ContentStatement(content: hbs.AST.ContentStatement): void;
CommentStatement(comment?: hbs.AST.CommentStatement): void;
SubExpression(sexpr: hbs.AST.SubExpression): void;
PathExpression(path: hbs.AST.PathExpression): void;
StringLiteral(str: hbs.AST.StringLiteral): void;
NumberLiteral(num: hbs.AST.NumberLiteral): void;
BooleanLiteral(bool: hbs.AST.BooleanLiteral): void;
UndefinedLiteral(): void;
NullLiteral(): void;
Hash(hash: hbs.AST.Hash): void;
}
}
/**
* Implement this interface on your MVW/MVVM/MVC views such as Backbone.View
**/
interface HandlebarsTemplatable {
template: HandlebarsTemplateDelegate;
}
interface HandlebarsTemplateDelegate {
(context: any, options?: any): string;
}
interface HandlebarsTemplates {
[index: string]: HandlebarsTemplateDelegate;
}
interface TemplateSpecification {
}
interface CompileOptions {
data?: boolean;
compat?: boolean;
knownHelpers?: {
helperMissing?: boolean;
blockHelperMissing?: boolean;
each?: boolean;
if?: boolean;
unless?: boolean;
with?: boolean;
log?: boolean;
lookup?: boolean;
}
knownHelpersOnly?: boolean;
noEscape?: boolean;
strict?: boolean;
assumeObjects?: boolean;
preventIndent?: boolean;
ignoreStandalone?: boolean;
explicitPartialContext?: boolean;
}
interface PrecompileOptions extends CompileOptions {
srcName?: string;
destName?: string;
}
declare namespace hbs {
class SafeString {
constructor(str: string);
static toString(): string;
}
namespace Utils {
function escapeExpression(str: string): string;
function createFrame(obj: Object): Object;
function isEmpty(obj: any) : boolean;
function extend(obj: any, ...source: any[]): any;
function toString(obj: any): string;
function isArray(obj: any): boolean;
function isFunction(obj: any): boolean;
}
}
interface Logger {
DEBUG: number;
INFO: number;
WARN: number;
ERROR: number;
level: number;
methodMap: { [level: number]: string };
log(level: number, obj: string): void;
}
declare namespace hbs {
namespace AST {
interface Node {
type: string;
loc: SourceLocation;
}
interface SourceLocation {
source: string;
start: Position;
end: Position;
}
interface Position {
line: number;
column: number;
}
interface Program extends Node {
body: Statement[];
blockParams: string[];
}
interface Statement extends Node {}
interface MustacheStatement extends Statement {
path: PathExpression | Literal;
params: Expression[];
hash: Hash;
escaped: boolean;
strip: StripFlags;
}
interface Decorator extends MustacheStatement { }
interface BlockStatement extends Statement {
path: PathExpression;
params: Expression[];
hash: Hash;
program: Program;
inverse: Program;
openStrip: StripFlags;
inverseStrip: StripFlags;
closeStrip: StripFlags;
}
interface DecoratorBlock extends BlockStatement { }
interface PartialStatement extends Statement {
name: PathExpression | SubExpression;
params: Expression[];
hash: Hash;
indent: string;
strip: StripFlags;
}
interface PartialBlockStatement extends Statement {
name: PathExpression | SubExpression;
params: Expression[],
hash: Hash,
program: Program,
openStrip: StripFlags,
closeStrip: StripFlags
}
interface ContentStatement extends Statement {
value: string;
original: StripFlags;
}
interface CommentStatement extends Statement {
value: string;
strip: StripFlags;
}
interface Expression extends Node {}
interface SubExpression extends Expression {
path: PathExpression;
params: Expression[];
hash: Hash;
}
interface PathExpression extends Expression {
data: boolean;
depth: number;
parts: string[];
original: string;
}
interface Literal extends Expression {}
interface StringLiteral extends Literal {
value: string;
original: string;
}
interface BooleanLiteral extends Literal {
value: boolean;
original: boolean;
}
interface NumberLiteral extends Literal {
value: number;
original: number;
}
interface UndefinedLiteral extends Literal {}
interface NullLiteral extends Literal {}
interface Hash extends Node {
pairs: HashPair[];
}
interface HashPair extends Node {
key: string;
value: Expression;
}
interface StripFlags {
open: boolean;
close: boolean;
}
interface helpers {
helperExpression(node: Node): boolean;
scopeId(path: PathExpression): boolean;
simpleId(path: PathExpression): boolean;
}
}
}
declare module "handlebars" {
export = Handlebars;
}
// Type definitions for Handlebars v4.0.5
// Project: http://handlebarsjs.com/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
declare namespace Handlebars {
export function registerHelper(name: string, fn: Function, inverse?: boolean): void;
export function registerHelper(name: Object): void;
export function registerPartial(name: string, str: any): void;
export function unregisterHelper(name: string): void;
export function unregisterPartial(name: string): void;
export function registerDecorator(name: string, fn: Function): void;
export function unregisterDecorator(name: string): void;
export function K(): void;
export function createFrame(object: any): any;
export function blockParams(obj: any[], ids: any[]): any[];
export function Exception(message: string): void;
export function log(level: number, obj: any): void;
export function parse(input: string): hbs.AST.Program;
export function compile<T = any>(input: any, options?: CompileOptions): HandlebarsTemplateDelegate<T>;
export function precompile(input: any, options?: PrecompileOptions): TemplateSpecification;
export function template<T = any>(precompilation: TemplateSpecification): HandlebarsTemplateDelegate<T>;
export function create(): typeof Handlebars;
export var SafeString: typeof hbs.SafeString;
export var escapeExpression: typeof hbs.Utils.escapeExpression;
export var Utils: typeof hbs.Utils;
export var logger: Logger;
export var templates: HandlebarsTemplates;
export var helpers: { [name: string]: Function };
export var partials: { [name: string]: any };
export var decorators: { [name: string]: Function };
export function registerDecorator(name: string, fn: Function): void;
export function registerDecorator(obj: {[name: string] : Function}): void;
export function unregisterDecorator(name: string): void;
export function noConflict(): typeof Handlebars;
export module AST {
export var helpers: hbs.AST.helpers;
}
interface ICompiler {
accept(node: hbs.AST.Node): void;
Program(program: hbs.AST.Program): void;
BlockStatement(block: hbs.AST.BlockStatement): void;
PartialStatement(partial: hbs.AST.PartialStatement): void;
PartialBlockStatement(partial: hbs.AST.PartialBlockStatement): void;
DecoratorBlock(decorator: hbs.AST.DecoratorBlock): void;
Decorator(decorator: hbs.AST.Decorator): void;
MustacheStatement(mustache: hbs.AST.MustacheStatement): void;
ContentStatement(content: hbs.AST.ContentStatement): void;
CommentStatement(comment?: hbs.AST.CommentStatement): void;
SubExpression(sexpr: hbs.AST.SubExpression): void;
PathExpression(path: hbs.AST.PathExpression): void;
StringLiteral(str: hbs.AST.StringLiteral): void;
NumberLiteral(num: hbs.AST.NumberLiteral): void;
BooleanLiteral(bool: hbs.AST.BooleanLiteral): void;
UndefinedLiteral(): void;
NullLiteral(): void;
Hash(hash: hbs.AST.Hash): void;
}
export class Visitor implements ICompiler {
accept(node: hbs.AST.Node): void;
acceptKey(node: hbs.AST.Node, name: string): void;
acceptArray(arr: hbs.AST.Expression[]): void;
Program(program: hbs.AST.Program): void;
BlockStatement(block: hbs.AST.BlockStatement): void;
PartialStatement(partial: hbs.AST.PartialStatement): void;
PartialBlockStatement(partial: hbs.AST.PartialBlockStatement): void;
DecoratorBlock(decorator: hbs.AST.DecoratorBlock): void;
Decorator(decorator: hbs.AST.Decorator): void;
MustacheStatement(mustache: hbs.AST.MustacheStatement): void;
ContentStatement(content: hbs.AST.ContentStatement): void;
CommentStatement(comment?: hbs.AST.CommentStatement): void;
SubExpression(sexpr: hbs.AST.SubExpression): void;
PathExpression(path: hbs.AST.PathExpression): void;
StringLiteral(str: hbs.AST.StringLiteral): void;
NumberLiteral(num: hbs.AST.NumberLiteral): void;
BooleanLiteral(bool: hbs.AST.BooleanLiteral): void;
UndefinedLiteral(): void;
NullLiteral(): void;
Hash(hash: hbs.AST.Hash): void;
}
}
/**
* Implement this interface on your MVW/MVVM/MVC views such as Backbone.View
**/
interface HandlebarsTemplatable {
template: HandlebarsTemplateDelegate;
}
interface HandlebarsTemplateDelegate<T = any> {
(context: T, options?: RuntimeOptions): string;
}
interface HandlebarsTemplates {
[index: string]: HandlebarsTemplateDelegate;
}
interface TemplateSpecification {
}
interface RuntimeOptions {
partial?: boolean;
depths?: any[];
helpers?: { [name: string]: Function }
partials?: { [name: string]: HandlebarsTemplateDelegate }
decorators?: { [name: string]: Function }
}
interface CompileOptions {
data?: boolean;
compat?: boolean;
knownHelpers?: {
helperMissing?: boolean;
blockHelperMissing?: boolean;
each?: boolean;
if?: boolean;
unless?: boolean;
with?: boolean;
log?: boolean;
lookup?: boolean;
}
knownHelpersOnly?: boolean;
noEscape?: boolean;
strict?: boolean;
assumeObjects?: boolean;
preventIndent?: boolean;
ignoreStandalone?: boolean;
explicitPartialContext?: boolean;
}
interface PrecompileOptions extends CompileOptions {
srcName?: string;
destName?: string;
}
declare namespace hbs {
class SafeString {
constructor(str: string);
static toString(): string;
}
namespace Utils {
function escapeExpression(str: string): string;
function createFrame(object: any): any;
function blockParams(obj: any[], ids: any[]): any[];
function isEmpty(obj: any) : boolean;
function extend(obj: any, ...source: any[]): any;
function toString(obj: any): string;
function isArray(obj: any): boolean;
function isFunction(obj: any): boolean;
}
}
interface Logger {
DEBUG: number;
INFO: number;
WARN: number;
ERROR: number;
level: number;
methodMap: { [level: number]: string };
log(level: number, obj: string): void;
}
declare namespace hbs {
namespace AST {
interface Node {
type: string;
loc: SourceLocation;
}
interface SourceLocation {
source: string;
start: Position;
end: Position;
}
interface Position {
line: number;
column: number;
}
interface Program extends Node {
body: Statement[];
blockParams: string[];
}
interface Statement extends Node {}
interface MustacheStatement extends Statement {
path: PathExpression | Literal;
params: Expression[];
hash: Hash;
escaped: boolean;
strip: StripFlags;
}
interface Decorator extends MustacheStatement { }
interface BlockStatement extends Statement {
path: PathExpression;
params: Expression[];
hash: Hash;
program: Program;
inverse: Program;
openStrip: StripFlags;
inverseStrip: StripFlags;
closeStrip: StripFlags;
}
interface DecoratorBlock extends BlockStatement { }
interface PartialStatement extends Statement {
name: PathExpression | SubExpression;
params: Expression[];
hash: Hash;
indent: string;
strip: StripFlags;
}
interface PartialBlockStatement extends Statement {
name: PathExpression | SubExpression;
params: Expression[],
hash: Hash,
program: Program,
openStrip: StripFlags,
closeStrip: StripFlags
}
interface ContentStatement extends Statement {
value: string;
original: StripFlags;
}
interface CommentStatement extends Statement {
value: string;
strip: StripFlags;
}
interface Expression extends Node {}
interface SubExpression extends Expression {
path: PathExpression;
params: Expression[];
hash: Hash;
}
interface PathExpression extends Expression {
data: boolean;
depth: number;
parts: string[];
original: string;
}
interface Literal extends Expression {}
interface StringLiteral extends Literal {
value: string;
original: string;
}
interface BooleanLiteral extends Literal {
value: boolean;
original: boolean;
}
interface NumberLiteral extends Literal {
value: number;
original: number;
}
interface UndefinedLiteral extends Literal {}
interface NullLiteral extends Literal {}
interface Hash extends Node {
pairs: HashPair[];
}
interface HashPair extends Node {
key: string;
value: Expression;
}
interface StripFlags {
open: boolean;
close: boolean;
}
interface helpers {
helperExpression(node: Node): boolean;
scopeId(path: PathExpression): boolean;
simpleId(path: PathExpression): boolean;
}
}
}
declare module "handlebars" {
export = Handlebars;
}
declare module "handlebars/handlebars.runtime" {
export = Handlebars;
}

View File

@ -1,6 +1,6 @@
{
"name": "@types/handlebars",
"version": "4.0.32",
"version": "4.0.35",
"description": "TypeScript definitions for Handlebars",
"license": "MIT",
"contributors": [
@ -17,6 +17,6 @@
"scripts": {},
"dependencies": {},
"peerDependencies": {},
"typesPublisherContentHash": "acb29e806e6b4bd283e8ac6d34f2a437d48ef822884b4b009302f8a6df48b281",
"typeScriptVersion": "2.0"
"typesPublisherContentHash": "03ffb79cf0eee8482a5b5a2660eed0ebf7060e817aa247fdf3dae868c62fc57f",
"typeScriptVersion": "2.3"
}

42
node_modules/@types/lodash/LICENSE generated vendored
View File

@ -1,21 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
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
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
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

View File

@ -8,9 +8,9 @@ This package contains type definitions for Lo-Dash (http://lodash.com/).
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lodash
Additional Details
* Last updated: Fri, 05 May 2017 16:07:17 GMT
* Last updated: Tue, 08 Aug 2017 21:39:34 GMT
* Dependencies: none
* Global values: _
# Credits
These definitions were written by Brian Zengel <https://github.com/bczengel>, Ilya Mochalov <https://github.com/chrootsu>, Stepan Mikhaylyuk <https://github.com/stepancar>, Eric L Anderson <https://github.com/ericanderson>.
These definitions were written by Brian Zengel <https://github.com/bczengel>, Ilya Mochalov <https://github.com/chrootsu>, Stepan Mikhaylyuk <https://github.com/stepancar>, Eric L Anderson <https://github.com/ericanderson>, AJ Richardson <https://github.com/aj-r>, Junyoung Clare Jang <https://github.com/ailrun>.

2
node_modules/@types/lodash/add.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { add } from "./index";
export = add;

View File

@ -1,2 +0,0 @@
import { add } from "../index";
export = add;

2
node_modules/@types/lodash/after.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { after } from "./index";
export = after;

View File

@ -1,2 +0,0 @@
import { after } from "../index";
export = after;

2
node_modules/@types/lodash/ary.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { ary } from "./index";
export = ary;

View File

@ -1,2 +0,0 @@
import { ary } from "../index";
export = ary;

2
node_modules/@types/lodash/assign.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { assign } from "./index";
export = assign;

View File

@ -1,2 +0,0 @@
import { assign } from "../index";
export = assign;

2
node_modules/@types/lodash/assignIn.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { assignIn } from "./index";
export = assignIn;

View File

@ -1,2 +0,0 @@
import { assignIn } from "../index";
export = assignIn;

2
node_modules/@types/lodash/assignInWith.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { assignInWith } from "./index";
export = assignInWith;

View File

@ -1,2 +0,0 @@
import { assignInWith } from "../index";
export = assignInWith;

2
node_modules/@types/lodash/assignWith.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { assignWith } from "./index";
export = assignWith;

View File

@ -1,2 +0,0 @@
import { assignWith } from "../index";
export = assignWith;

2
node_modules/@types/lodash/at.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { at } from "./index";
export = at;

View File

@ -1,2 +0,0 @@
import { at } from "../index";
export = at;

2
node_modules/@types/lodash/attempt.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { attempt } from "./index";
export = attempt;

View File

@ -1,2 +0,0 @@
import { attempt } from "../index";
export = attempt;

2
node_modules/@types/lodash/before.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { before } from "./index";
export = before;

View File

@ -1,2 +0,0 @@
import { before } from "../index";
export = before;

2
node_modules/@types/lodash/bind.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { bind } from "./index";
export = bind;

View File

@ -1,2 +0,0 @@
import { bind } from "../index";
export = bind;

2
node_modules/@types/lodash/bindAll.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { bindAll } from "./index";
export = bindAll;

View File

@ -1,2 +0,0 @@
import { bindAll } from "../index";
export = bindAll;

2
node_modules/@types/lodash/bindKey.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { bindKey } from "./index";
export = bindKey;

View File

@ -1,2 +0,0 @@
import { bindKey } from "../index";
export = bindKey;

2
node_modules/@types/lodash/camelCase.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { camelCase } from "./index";
export = camelCase;

View File

@ -1,2 +0,0 @@
import { camelCase } from "../index";
export = camelCase;

2
node_modules/@types/lodash/capitalize.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { capitalize } from "./index";
export = capitalize;

View File

@ -1,2 +0,0 @@
import { capitalize } from "../index";
export = capitalize;

2
node_modules/@types/lodash/castArray.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { castArray } from "./index";
export = castArray;

View File

@ -1,2 +0,0 @@
import { castArray } from "../index";
export = castArray;

2
node_modules/@types/lodash/ceil.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { ceil } from "./index";
export = ceil;

View File

@ -1,2 +0,0 @@
import { ceil } from "../index";
export = ceil;

2
node_modules/@types/lodash/chain.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { chain } from "./index";
export = chain;

View File

@ -1,2 +0,0 @@
import { chain } from "../index";
export = chain;

2
node_modules/@types/lodash/chunk.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { chunk } from "./index";
export = chunk;

View File

@ -1,2 +0,0 @@
import { chunk } from "../index";
export = chunk;

2
node_modules/@types/lodash/clamp.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { clamp } from "./index";
export = clamp;

View File

@ -1,2 +0,0 @@
import { clamp } from "../index";
export = clamp;

2
node_modules/@types/lodash/clone.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { clone } from "./index";
export = clone;

View File

@ -1,2 +0,0 @@
import { clone } from "../index";
export = clone;

2
node_modules/@types/lodash/cloneDeep.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { cloneDeep } from "./index";
export = cloneDeep;

View File

@ -1,2 +0,0 @@
import { cloneDeep } from "../index";
export = cloneDeep;

2
node_modules/@types/lodash/cloneDeepWith.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { cloneDeepWith } from "./index";
export = cloneDeepWith;

View File

@ -1,2 +0,0 @@
import { cloneDeepWith } from "../index";
export = cloneDeepWith;

2
node_modules/@types/lodash/cloneWith.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { cloneWith } from "./index";
export = cloneWith;

View File

@ -1,2 +0,0 @@
import { cloneWith } from "../index";
export = cloneWith;

2
node_modules/@types/lodash/compact.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
import { compact } from "./index";
export = compact;

Some files were not shown because too many files have changed in this diff Show More