WhiteDog

studying partials, section

Showing 1000 changed files with 97 additions and 3330 deletions

Too many changes to show.

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

node_modules
*~
\ No newline at end of file
......
{
"git.ignoreLimitWarning": true
}
\ No newline at end of file
exports.getWeatherData= function () {
return {
locations: [
{
name: 'Portland',
forecastUrl: 'http://www.wunderground.com/US/OR/Portland.html',
iconUrl: 'http://icons-ak.wxug.com/i/c/k/cloudy.gif',
weather: 'Overcast',
temp: '54.1 F(12.3C',
},
{
name: 'Bend',
forecastUrl: 'http://www.wunderground.com/US/OR/Portland.html',
iconUrl: 'http://icons-ak.wxug.com/i/c/k/partlycloudy.gif',
weather: 'Partly Cloudy',
temp: '55.0 F(12.3C',
},
{
name: 'Manzanita',
forecastUrl: 'http://www.wunderground.com/US/OR/Portland.html',
iconUrl: 'http://icons-ak.wxug.com/i/c/k/rain.gif',
weather: 'Light Rain',
temp: '55.0 F(12.3C',
},
],
};
}
\ No newline at end of file
......@@ -6,43 +6,83 @@ var express = require('express');
//기본적으로 node_modules 디렉토리에서 찾는다
// ./를 붙이면 거기서 찾지 않는다.
var fortune = require('./lib/fortune.js');
var getWeather = require('./lib/getWeather.js');
//if(app.thing ====null) console.log('bleat');
var app = express();
app.use(express.static(__dirname + '/public'));
var handlebars = require('express-handlebars').create({ defaultLayout: 'main' });
//뷰를 렌더링 할때 사용할 기본 레이아웃
//기본적으로 익스프레스는 views 에서 뷰를 찾고, views/layouts에서 레이아웃을 찾는다.
var handlebars = require('express-handlebars').create({
defaultLayout: 'main',
helpers: {
section: function (name, options) {
if (!this._sections) this._sections = {};
this._sections[name] = options.fn(this);
return null;
}
}
});
app.engine('handlebars', handlebars.engine);
app.set('view engine', 'handlebars');
app.set('port', process.env.PORT || 3000);
//쿼리스트링 감지하는 미들웨어는 이것을 사용할 라우터 보다 앞에 있어야함.
app.use(function(req,res,next){
res.locals.showTests = app.get('env') !=='production' && req.query.test === '1';
next();
app.use(function (req, res, next) {
res.locals.showTests = app.get('env') !== 'production' && req.query.test === '1';
next();
});
//파셜 쓰기.
//여러페이지에 나타나지만 모든 페이지에 나타나지 않는다면 이 방법 고려.
app.use(function (req, res, next) {
if (!res.locals.partials) res.locals.partials = {};
res.locals.partials.weatherContext = getWeather.getWeatherData();
next();
});
app.get('/', function (req, res) {
res.render('home');
//변수를 만들고!~!!
var product =
{
currency: {
name: 'United States dollars',
abbrev: 'USD',
},
tours: [
{ name: 'Hood River', price: '$99.95' },
{ name: 'Oregon Coast', price: '$159.95' },],
specialsUrl: '/about',
currencies: ['USD', 'GBP', 'BTC'],
};
res.render('home', {
//http에 전달해야하는 변수 이름을 알고있으니까 그 변수에다가 내가 값을넣어준다.
tours: product.tours,
currency: product.currency,
specialsUrl: product.specialsUrl,
currencies: product.currencies
});
});
app.get('/tours/hood-river', function(req,res){
res.render('tours/hood-river');
app.get('/tours/hood-river', function (req, res) {
//레이아웃을 쓰지 않으려면 layout:null 넘김
//null 말고 layouts 서브디렉토리에 있는 다른 레이아웃을 써도됨.
res.render('tours/hood-river', { layout: null });
});
app.get('/tours/oregon-coast', function(req,res){
app.get('/tours/oregon-coast', function (req, res) {
res.render('tours/oregon-coast');
});
app.get('/tours/request-group-rate',function(req,res){
app.get('/tours/request-group-rate', function (req, res) {
res.render('tours/request-group-rate');
});
app.get('/about', function (req, res) {
// var randomFortune = fortunes[Math.floor(Math.random() * fortunes.length)];
res.render('about', {
fortune : fortune.getFortune(),
fortune: fortune.getFortune(),
pageTestScript: '/qa/tests-about.js'
});
});
......
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../babel/bin/babel.js" "$@"
ret=$?
else
node "$basedir/../babel/bin/babel.js" "$@"
ret=$?
fi
exit $ret
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../babel/bin/babel-external-helpers.js" "$@"
ret=$?
else
node "$basedir/../babel/bin/babel-external-helpers.js" "$@"
ret=$?
fi
exit $ret
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\babel\bin\babel-external-helpers.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\babel\bin\babel-external-helpers.js" %*
)
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../babel/bin/babel-node.js" "$@"
ret=$?
else
node "$basedir/../babel/bin/babel-node.js" "$@"
ret=$?
fi
exit $ret
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\babel\bin\babel-node.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\babel\bin\babel-node.js" %*
)
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../babel/bin/babel-plugin.js" "$@"
ret=$?
else
node "$basedir/../babel/bin/babel-plugin.js" "$@"
ret=$?
fi
exit $ret
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\babel\bin\babel-plugin.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\babel\bin\babel-plugin.js" %*
)
\ No newline at end of file
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\babel\bin\babel.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\babel\bin\babel.js" %*
)
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../commoner/bin/commonize" "$@"
ret=$?
else
node "$basedir/../commoner/bin/commonize" "$@"
ret=$?
fi
exit $ret
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\commoner\bin\commonize" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\commoner\bin\commonize" %*
)
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../defs/build/es5/defs" "$@"
ret=$?
else
node "$basedir/../defs/build/es5/defs" "$@"
ret=$?
fi
exit $ret
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\defs\build\es5\defs" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\defs\build\es5\defs" %*
)
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../detect-indent/cli.js" "$@"
ret=$?
else
node "$basedir/../detect-indent/cli.js" "$@"
ret=$?
fi
exit $ret
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\detect-indent\cli.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\detect-indent\cli.js" %*
)
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../jsesc/bin/jsesc" "$@"
ret=$?
else
node "$basedir/../jsesc/bin/jsesc" "$@"
ret=$?
fi
exit $ret
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\jsesc\bin\jsesc" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\jsesc\bin\jsesc" %*
)
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../json5/lib/cli.js" "$@"
ret=$?
else
node "$basedir/../json5/lib/cli.js" "$@"
ret=$?
fi
exit $ret
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\json5\lib\cli.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\json5\lib\cli.js" %*
)
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../leven/cli.js" "$@"
ret=$?
else
node "$basedir/../leven/cli.js" "$@"
ret=$?
fi
exit $ret
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\leven\cli.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\leven\cli.js" %*
)
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../linkchecker/index.js" "$@"
ret=$?
else
node "$basedir/../linkchecker/index.js" "$@"
ret=$?
fi
exit $ret
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\linkchecker\index.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\linkchecker\index.js" %*
)
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../os-name/cli.js" "$@"
ret=$?
else
node "$basedir/../os-name/cli.js" "$@"
ret=$?
fi
exit $ret
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\os-name\cli.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\os-name\cli.js" %*
)
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../osx-release/cli.js" "$@"
ret=$?
else
node "$basedir/../osx-release/cli.js" "$@"
ret=$?
fi
exit $ret
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\osx-release\cli.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\osx-release\cli.js" %*
)
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../regenerator/bin/regenerator" "$@"
ret=$?
else
node "$basedir/../regenerator/bin/regenerator" "$@"
ret=$?
fi
exit $ret
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\regenerator\bin\regenerator" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\regenerator\bin\regenerator" %*
)
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../regexpu/bin/regexpu" "$@"
ret=$?
else
node "$basedir/../regexpu/bin/regexpu" "$@"
ret=$?
fi
exit $ret
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\regexpu\bin\regexpu" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\regexpu\bin\regexpu" %*
)
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../regjsparser/bin/parser" "$@"
ret=$?
else
node "$basedir/../regjsparser/bin/parser" "$@"
ret=$?
fi
exit $ret
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\regjsparser\bin\parser" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\regjsparser\bin\parser" %*
)
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../user-home/cli.js" "$@"
ret=$?
else
node "$basedir/../user-home/cli.js" "$@"
ret=$?
fi
exit $ret
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\user-home\cli.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\user-home\cli.js" %*
)
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../window-size/cli.js" "$@"
ret=$?
else
node "$basedir/../window-size/cli.js" "$@"
ret=$?
fi
exit $ret
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\window-size\cli.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\window-size\cli.js" %*
)
\ No newline at end of file
......@@ -21,7 +21,7 @@
"_resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz",
"_shasum": "5faad9c2c07f60dd76770f71cf025b62a63cfd4e",
"_spec": "abab@^1.0.0",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\jsdom",
"_where": "D:\\w\\project\\comnetprj\\node_modules\\jsdom",
"author": {
"name": "Jeff Carpenter",
"email": "gcarpenterv@gmail.com"
......
......@@ -21,7 +21,7 @@
"_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"_shasum": "f8f2c887ad10bf67f634f005b6987fed3179aac8",
"_spec": "abbrev@1",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\nopt",
"_where": "D:\\w\\project\\comnetprj\\node_modules\\nopt",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me"
......
......@@ -21,7 +21,7 @@
"_resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-1.0.9.tgz",
"_shasum": "55bb5e98691507b74579d0513413217c380c54cf",
"_spec": "acorn-globals@^1.0.4",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\jsdom",
"_where": "D:\\w\\project\\comnetprj\\node_modules\\jsdom",
"author": {
"name": "ForbesLindesay"
},
......
......@@ -22,7 +22,7 @@
"_resolved": "https://registry.npmjs.org/acorn/-/acorn-2.7.0.tgz",
"_shasum": "ab6e7d9d886aaca8b085bc3312b79a198433f0e7",
"_spec": "acorn@^2.4.0",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\jsdom",
"_where": "D:\\w\\project\\comnetprj\\node_modules\\jsdom",
"bin": {
"acorn": "./bin/acorn"
},
......
......@@ -21,7 +21,7 @@
"_resolved": "https://registry.npmjs.org/ajv/-/ajv-5.3.0.tgz",
"_shasum": "4414ff74a50879c208ee5fdc826e32c303549eda",
"_spec": "ajv@^5.1.0",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\har-validator",
"_where": "D:\\w\\project\\comnetprj\\node_modules\\har-validator",
"author": {
"name": "Evgeny Poberezkin"
},
......
......@@ -22,7 +22,7 @@
"_resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
"_shasum": "0cd90a561093f35d0a99256c22b7069433fad117",
"_spec": "align-text@^0.1.3",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\center-align",
"_where": "D:\\W\\project\\comnetprj\\node_modules\\center-align",
"author": {
"name": "Jon Schlinkert",
"url": "https://github.com/jonschlinkert"
......
Copyright (c) 2013 Olov Lassus <olov.lassus@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
# alter.js
Alters a string by replacing multiple range fragments in one fast pass.
Works in node and browsers.
## Usage
```javascript
var alter = require("alter");
alter("0123456789", [
{start: 1, end: 3, str: "first"},
{start: 5, end: 9, str: "second"},
]); // => "0first34second9"
```
The fragments does not need to be sorted but must not overlap. More examples in `test/alter-tests.js`
## Installation
### Node
Install using npm
npm install alter
```javascript
var alter = require("alter");
```
### Browser
Clone the repo and include it in a script tag
git clone https://github.com/olov/alter.git
```html
<script src="alter/alter.js"></script>
```
// alter.js
// MIT licensed, see LICENSE file
// Copyright (c) 2013 Olov Lassus <olov.lassus@gmail.com>
var assert = require("assert");
var stableSort = require("stable");
// fragments is a list of {start: index, end: index, str: string to replace with}
function alter(str, fragments) {
"use strict";
var isArray = Array.isArray || function(v) {
return Object.prototype.toString.call(v) === "[object Array]";
};;
assert(typeof str === "string");
assert(isArray(fragments));
// stableSort isn't in-place so no need to copy array first
var sortedFragments = stableSort(fragments, function(a, b) {
return a.start - b.start;
});
var outs = [];
var pos = 0;
for (var i = 0; i < sortedFragments.length; i++) {
var frag = sortedFragments[i];
assert(pos <= frag.start);
assert(frag.start <= frag.end);
outs.push(str.slice(pos, frag.start));
outs.push(frag.str);
pos = frag.end;
}
if (pos < str.length) {
outs.push(str.slice(pos));
}
return outs.join("");
}
if (typeof module !== "undefined" && typeof module.exports !== "undefined") {
module.exports = alter;
}
{
"_from": "alter@~0.2.0",
"_id": "alter@0.2.0",
"_inBundle": false,
"_integrity": "sha1-x1iICGF1cgNKrmJICvJrHU0cs80=",
"_location": "/alter",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "alter@~0.2.0",
"name": "alter",
"escapedName": "alter",
"rawSpec": "~0.2.0",
"saveSpec": null,
"fetchSpec": "~0.2.0"
},
"_requiredBy": [
"/defs"
],
"_resolved": "https://registry.npmjs.org/alter/-/alter-0.2.0.tgz",
"_shasum": "c7588808617572034aae62480af26b1d4d1cb3cd",
"_spec": "alter@~0.2.0",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\defs",
"author": {
"name": "Olov Lassus",
"email": "olov.lassus@gmail.com"
},
"bugs": {
"url": "https://github.com/olov/alter/issues"
},
"bundleDependencies": false,
"dependencies": {
"stable": "~0.1.3"
},
"deprecated": false,
"description": "alters a string by replacing multiple range fragments in one fast pass",
"devDependencies": {
"tap": "~0.4.0"
},
"homepage": "https://github.com/olov/alter#readme",
"keywords": [
"string",
"manipulation",
"replace",
"alter",
"modify"
],
"license": "MIT",
"main": "alter.js",
"name": "alter",
"repository": {
"type": "git",
"url": "git+https://github.com/olov/alter.git"
},
"scripts": {
"test": "tap test/*.js"
},
"version": "0.2.0"
}
"use strict";
var test = require("tap").test;
var alter = require("../");
test("simple", function(t) {
t.equal(alter("0123456789", [
{start: 1, end: 3, str: "first"},
{start: 5, end: 9, str: "second"},
]), "0first34second9");
t.end();
});
test("not-sorted-order", function(t) {
t.equal(alter("0123456789", [
{start: 5, end: 9, str: "second"},
{start: 1, end: 3, str: "first"},
]), "0first34second9");
t.end();
});
test("insert", function(t) {
t.equal(alter("0123456789", [
{start: 5, end: 5, str: "xyz"},
]), "01234xyz56789");
t.end();
});
test("delete", function(t) {
t.equal(alter("0123456789", [
{start: 5, end: 6, str: ""},
]), "012346789");
t.end();
});
test("nop1", function(t) {
t.equal(alter("0123456789", [
]), "0123456789");
t.end();
});
test("nop2", function(t) {
t.equal(alter("0123456789", [
{start: 5, end: 5, str: ""},
]), "0123456789");
t.end();
});
test("orderedinsert-stable", function(t) {
t.equal(alter("0123456789", [
{start: 5, end: 5, str: "a"},
{start: 5, end: 5, str: "b"},
{start: 5, end: 5, str: "c"},
{start: 5, end: 6, str: "d"},
]), "01234abcd6789");
t.end();
});
......@@ -16,12 +16,12 @@
"fetchSpec": ">=0.0.4"
},
"_requiredBy": [
"/source-map-support/source-map"
"/source-map"
],
"_resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
"_shasum": "4a5282ac164729e93619bcfd3ad151f817ce91f5",
"_spec": "amdefine@>=0.0.4",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\source-map-support\\node_modules\\source-map",
"_where": "D:\\W\\project\\comnetprj\\node_modules\\source-map",
"author": {
"name": "James Burke",
"email": "jrburke@gmail.com",
......
......@@ -22,7 +22,7 @@
"_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"_shasum": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df",
"_spec": "ansi-regex@^2.0.0",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\has-ansi",
"_where": "D:\\w\\project\\comnetprj\\node_modules\\has-ansi",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
......
......@@ -21,7 +21,7 @@
"_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
"_shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe",
"_spec": "ansi-styles@^2.2.1",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\chalk",
"_where": "D:\\w\\project\\comnetprj\\node_modules\\chalk",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
......
The ISC License
Copyright (c) 2014 Elan Shanker
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.
anymatch [![Build Status](https://travis-ci.org/es128/anymatch.svg?branch=master)](https://travis-ci.org/es128/anymatch) [![Coverage Status](https://img.shields.io/coveralls/es128/anymatch.svg?branch=master)](https://coveralls.io/r/es128/anymatch?branch=master)
======
Javascript module to match a string against a regular expression, glob, string,
or function that takes the string as an argument and returns a truthy or falsy
value. The matcher can also be an array of any or all of these. Useful for
allowing a very flexible user-defined config to define things like file paths.
[![NPM](https://nodei.co/npm/anymatch.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/anymatch/)
[![NPM](https://nodei.co/npm-dl/anymatch.png?height=3&months=9)](https://nodei.co/npm-dl/anymatch/)
Usage
-----
```sh
npm install anymatch --save
```
#### anymatch (matchers, testString, [returnIndex], [startIndex], [endIndex])
* __matchers__: (_Array|String|RegExp|Function_)
String to be directly matched, string with glob patterns, regular expression
test, function that takes the testString as an argument and returns a truthy
value if it should be matched, or an array of any number and mix of these types.
* __testString__: (_String|Array_) The string to test against the matchers. If
passed as an array, the first element of the array will be used as the
`testString` for non-function matchers, while the entire array will be applied
as the arguments for function matchers.
* __returnIndex__: (_Boolean [optional]_) If true, return the array index of
the first matcher that that testString matched, or -1 if no match, instead of a
boolean result.
* __startIndex, endIndex__: (_Integer [optional]_) Can be used to define a
subset out of the array of provided matchers to test against. Can be useful
with bound matcher functions (see below). When used with `returnIndex = true`
preserves original indexing. Behaves the same as `Array.prototype.slice` (i.e.
includes array members up to, but not including endIndex).
```js
var anymatch = require('anymatch');
var matchers = [
'path/to/file.js',
'path/anyjs/**/*.js',
/foo\.js$/,
function (string) {
return string.indexOf('bar') !== -1 && string.length > 10
}
];
anymatch(matchers, 'path/to/file.js'); // true
anymatch(matchers, 'path/anyjs/baz.js'); // true
anymatch(matchers, 'path/to/foo.js'); // true
anymatch(matchers, 'path/to/bar.js'); // true
anymatch(matchers, 'bar.js'); // false
// returnIndex = true
anymatch(matchers, 'foo.js', true); // 2
anymatch(matchers, 'path/anyjs/foo.js', true); // 1
// skip matchers
anymatch(matchers, 'path/to/file.js', false, 1); // false
anymatch(matchers, 'path/anyjs/foo.js', true, 2, 3); // 2
anymatch(matchers, 'path/to/bar.js', true, 0, 3); // -1
// using globs to match directories and their children
anymatch('node_modules', 'node_modules'); // true
anymatch('node_modules', 'node_modules/somelib/index.js'); // false
anymatch('node_modules/**', 'node_modules/somelib/index.js'); // true
anymatch('node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // false
anymatch('**/node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // true
```
#### anymatch (matchers)
You can also pass in only your matcher(s) to get a curried function that has
already been bound to the provided matching criteria. This can be used as an
`Array.prototype.filter` callback.
```js
var matcher = anymatch(matchers);
matcher('path/to/file.js'); // true
matcher('path/anyjs/baz.js', true); // 1
matcher('path/anyjs/baz.js', true, 2); // -1
['foo.js', 'bar.js'].filter(matcher); // ['foo.js']
```
Change Log
----------
[See release notes page on GitHub](https://github.com/es128/anymatch/releases)
NOTE: As of v1.2.0, anymatch uses [micromatch](https://github.com/jonschlinkert/micromatch)
for glob pattern matching. The glob matching behavior should be functionally
equivalent to the commonly used [minimatch](https://github.com/isaacs/minimatch)
library (aside from some fixed bugs and greater performance), so a major
version bump wasn't merited. Issues with glob pattern matching should be
reported directly to the [micromatch issue tracker](https://github.com/jonschlinkert/micromatch/issues).
License
-------
[ISC](https://raw.github.com/es128/anymatch/master/LICENSE)
'use strict';
var micromatch = require('micromatch');
var normalize = require('normalize-path');
var path = require('path'); // required for tests.
var arrify = function(a) { return a == null ? [] : (Array.isArray(a) ? a : [a]); };
var anymatch = function(criteria, value, returnIndex, startIndex, endIndex) {
criteria = arrify(criteria);
value = arrify(value);
if (arguments.length === 1) {
return anymatch.bind(null, criteria.map(function(criterion) {
return typeof criterion === 'string' && criterion[0] !== '!' ?
micromatch.matcher(criterion) : criterion;
}));
}
startIndex = startIndex || 0;
var string = value[0];
var altString, altValue;
var matched = false;
var matchIndex = -1;
function testCriteria(criterion, index) {
var result;
switch (Object.prototype.toString.call(criterion)) {
case '[object String]':
result = string === criterion || altString && altString === criterion;
result = result || micromatch.isMatch(string, criterion);
break;
case '[object RegExp]':
result = criterion.test(string) || altString && criterion.test(altString);
break;
case '[object Function]':
result = criterion.apply(null, value);
result = result || altValue && criterion.apply(null, altValue);
break;
default:
result = false;
}
if (result) {
matchIndex = index + startIndex;
}
return result;
}
var crit = criteria;
var negGlobs = crit.reduce(function(arr, criterion, index) {
if (typeof criterion === 'string' && criterion[0] === '!') {
if (crit === criteria) {
// make a copy before modifying
crit = crit.slice();
}
crit[index] = null;
arr.push(criterion.substr(1));
}
return arr;
}, []);
if (!negGlobs.length || !micromatch.any(string, negGlobs)) {
if (path.sep === '\\' && typeof string === 'string') {
altString = normalize(string);
altString = altString === string ? null : altString;
if (altString) altValue = [altString].concat(value.slice(1));
}
matched = crit.slice(startIndex, endIndex).some(testCriteria);
}
return returnIndex === true ? matchIndex : matched;
};
module.exports = anymatch;
{
"_from": "anymatch@^1.3.0",
"_id": "anymatch@1.3.2",
"_inBundle": false,
"_integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==",
"_location": "/anymatch",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "anymatch@^1.3.0",
"name": "anymatch",
"escapedName": "anymatch",
"rawSpec": "^1.3.0",
"saveSpec": null,
"fetchSpec": "^1.3.0"
},
"_requiredBy": [
"/chokidar"
],
"_resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz",
"_shasum": "553dcb8f91e3c889845dfdba34c77721b90b9d7a",
"_spec": "anymatch@^1.3.0",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\chokidar",
"author": {
"name": "Elan Shanker",
"url": "http://github.com/es128"
},
"bugs": {
"url": "https://github.com/es128/anymatch/issues"
},
"bundleDependencies": false,
"dependencies": {
"micromatch": "^2.1.5",
"normalize-path": "^2.0.0"
},
"deprecated": false,
"description": "Matches strings against configurable strings, globs, regular expressions, and/or functions",
"devDependencies": {
"coveralls": "^2.11.2",
"istanbul": "^0.3.13",
"mocha": "^2.2.4"
},
"files": [
"index.js"
],
"homepage": "https://github.com/es128/anymatch",
"keywords": [
"match",
"any",
"string",
"file",
"fs",
"list",
"glob",
"regex",
"regexp",
"regular",
"expression",
"function"
],
"license": "ISC",
"name": "anymatch",
"repository": {
"type": "git",
"url": "git+https://github.com/es128/anymatch.git"
},
"scripts": {
"test": "istanbul cover _mocha && cat ./coverage/lcov.info | coveralls"
},
"version": "1.3.2"
}
......@@ -21,7 +21,7 @@
"_resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz",
"_shasum": "73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86",
"_spec": "argparse@^1.0.2",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\js-yaml",
"_where": "D:\\w\\project\\comnetprj\\node_modules\\js-yaml",
"bugs": {
"url": "https://github.com/nodeca/argparse/issues"
},
......
The MIT License (MIT)
Copyright (c) 2014-2015, Jon Schlinkert.
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.
# arr-diff [![NPM version](https://img.shields.io/npm/v/arr-diff.svg)](https://www.npmjs.com/package/arr-diff) [![Build Status](https://img.shields.io/travis/jonschlinkert/base.svg)](https://travis-ci.org/jonschlinkert/base)
> Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.
## Install
Install with [npm](https://www.npmjs.com/)
```sh
$ npm i arr-diff --save
```
Install with [bower](http://bower.io/)
```sh
$ bower install arr-diff --save
```
## API
### [diff](index.js#L33)
Return the difference between the first array and additional arrays.
**Params**
* `a` **{Array}**
* `b` **{Array}**
* `returns` **{Array}**
**Example**
```js
var diff = require('arr-diff');
var a = ['a', 'b', 'c', 'd'];
var b = ['b', 'c'];
console.log(diff(a, b))
//=> ['a', 'd']
```
## Related projects
* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten)
* [array-filter](https://www.npmjs.com/package/array-filter): Array#filter for older browsers. | [homepage](https://github.com/juliangruber/array-filter)
* [array-intersection](https://www.npmjs.com/package/array-intersection): Return an array with the unique values present in _all_ given arrays using strict equality… [more](https://www.npmjs.com/package/array-intersection) | [homepage](https://github.com/jonschlinkert/array-intersection)
## Running tests
Install dev dependencies:
```sh
$ npm i -d && npm test
```
## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/arr-diff/issues/new).
## Author
**Jon Schlinkert**
+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
## License
Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)
Released under the MIT license.
***
_This file was generated by [verb](https://github.com/verbose/verb) on Sat Dec 05 2015 23:24:53 GMT-0500 (EST)._
/*!
* arr-diff <https://github.com/jonschlinkert/arr-diff>
*
* Copyright (c) 2014 Jon Schlinkert, contributors.
* Licensed under the MIT License
*/
'use strict';
var flatten = require('arr-flatten');
var slice = [].slice;
/**
* Return the difference between the first array and
* additional arrays.
*
* ```js
* var diff = require('{%= name %}');
*
* var a = ['a', 'b', 'c', 'd'];
* var b = ['b', 'c'];
*
* console.log(diff(a, b))
* //=> ['a', 'd']
* ```
*
* @param {Array} `a`
* @param {Array} `b`
* @return {Array}
* @api public
*/
function diff(arr, arrays) {
var argsLen = arguments.length;
var len = arr.length, i = -1;
var res = [], arrays;
if (argsLen === 1) {
return arr;
}
if (argsLen > 2) {
arrays = flatten(slice.call(arguments, 1));
}
while (++i < len) {
if (!~arrays.indexOf(arr[i])) {
res.push(arr[i]);
}
}
return res;
}
/**
* Expose `diff`
*/
module.exports = diff;
{
"_from": "arr-diff@^2.0.0",
"_id": "arr-diff@2.0.0",
"_inBundle": false,
"_integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=",
"_location": "/arr-diff",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "arr-diff@^2.0.0",
"name": "arr-diff",
"escapedName": "arr-diff",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/micromatch"
],
"_resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz",
"_shasum": "8f3b827f955a8bd669697e4a4256ac3ceae356cf",
"_spec": "arr-diff@^2.0.0",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\micromatch",
"author": {
"name": "Jon Schlinkert",
"url": "https://github.com/jonschlinkert"
},
"bugs": {
"url": "https://github.com/jonschlinkert/arr-diff/issues"
},
"bundleDependencies": false,
"dependencies": {
"arr-flatten": "^1.0.1"
},
"deprecated": false,
"description": "Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.",
"devDependencies": {
"array-differ": "^1.0.0",
"array-slice": "^0.2.3",
"benchmarked": "^0.1.4",
"chalk": "^1.1.1",
"mocha": "*",
"should": "*"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"homepage": "https://github.com/jonschlinkert/arr-diff",
"keywords": [
"arr",
"array",
"diff",
"differ",
"difference"
],
"license": "MIT",
"main": "index.js",
"name": "arr-diff",
"repository": {
"type": "git",
"url": "git+https://github.com/jonschlinkert/arr-diff.git"
},
"scripts": {
"test": "mocha"
},
"verb": {
"related": {
"list": [
"arr-flatten",
"array-filter",
"array-intersection"
]
}
},
"version": "2.0.0"
}
The MIT License (MIT)
Copyright (c) 2014-2017, Jon Schlinkert.
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.
# arr-flatten [![NPM version](https://img.shields.io/npm/v/arr-flatten.svg?style=flat)](https://www.npmjs.com/package/arr-flatten) [![NPM monthly downloads](https://img.shields.io/npm/dm/arr-flatten.svg?style=flat)](https://npmjs.org/package/arr-flatten) [![NPM total downloads](https://img.shields.io/npm/dt/arr-flatten.svg?style=flat)](https://npmjs.org/package/arr-flatten) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/arr-flatten.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/arr-flatten) [![Windows Build Status](https://img.shields.io/appveyor/ci/jonschlinkert/arr-flatten.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/jonschlinkert/arr-flatten)
> Recursively flatten an array or arrays.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save arr-flatten
```
## Install
Install with [bower](https://bower.io/)
```sh
$ bower install arr-flatten --save
```
## Usage
```js
var flatten = require('arr-flatten');
flatten(['a', ['b', ['c']], 'd', ['e']]);
//=> ['a', 'b', 'c', 'd', 'e']
```
## Why another flatten utility?
I wanted the fastest implementation I could find, with implementation choices that should work for 95% of use cases, but no cruft to cover the other 5%.
## About
### Related projects
* [arr-filter](https://www.npmjs.com/package/arr-filter): Faster alternative to javascript's native filter method. | [homepage](https://github.com/jonschlinkert/arr-filter "Faster alternative to javascript's native filter method.")
* [arr-union](https://www.npmjs.com/package/arr-union): Combines a list of arrays, returning a single array with unique values, using strict equality… [more](https://github.com/jonschlinkert/arr-union) | [homepage](https://github.com/jonschlinkert/arr-union "Combines a list of arrays, returning a single array with unique values, using strict equality for comparisons.")
* [array-each](https://www.npmjs.com/package/array-each): Loop over each item in an array and call the given function on every element. | [homepage](https://github.com/jonschlinkert/array-each "Loop over each item in an array and call the given function on every element.")
* [array-unique](https://www.npmjs.com/package/array-unique): Remove duplicate values from an array. Fastest ES5 implementation. | [homepage](https://github.com/jonschlinkert/array-unique "Remove duplicate values from an array. Fastest ES5 implementation.")
### Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
### Contributors
| **Commits** | **Contributor** |
| --- | --- |
| 20 | [jonschlinkert](https://github.com/jonschlinkert) |
| 1 | [lukeed](https://github.com/lukeed) |
### Building docs
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
To generate the readme, run the following command:
```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```
### Running tests
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
```sh
$ npm install && npm test
```
### Author
**Jon Schlinkert**
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
### License
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 05, 2017._
\ No newline at end of file
/*!
* arr-flatten <https://github.com/jonschlinkert/arr-flatten>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
'use strict';
module.exports = function (arr) {
return flat(arr, []);
};
function flat(arr, res) {
var i = 0, cur;
var len = arr.length;
for (; i < len; i++) {
cur = arr[i];
Array.isArray(cur) ? flat(cur, res) : res.push(cur);
}
return res;
}
{
"_from": "arr-flatten@^1.0.1",
"_id": "arr-flatten@1.1.0",
"_inBundle": false,
"_integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==",
"_location": "/arr-flatten",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "arr-flatten@^1.0.1",
"name": "arr-flatten",
"escapedName": "arr-flatten",
"rawSpec": "^1.0.1",
"saveSpec": null,
"fetchSpec": "^1.0.1"
},
"_requiredBy": [
"/arr-diff"
],
"_resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
"_shasum": "36048bbff4e7b47e136644316c99669ea5ae91f1",
"_spec": "arr-flatten@^1.0.1",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\arr-diff",
"author": {
"name": "Jon Schlinkert",
"url": "https://github.com/jonschlinkert"
},
"bugs": {
"url": "https://github.com/jonschlinkert/arr-flatten/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Jon Schlinkert",
"url": "http://twitter.com/jonschlinkert"
},
{
"name": "Luke Edwards",
"url": "https://lukeed.com"
}
],
"deprecated": false,
"description": "Recursively flatten an array or arrays.",
"devDependencies": {
"ansi-bold": "^0.1.1",
"array-flatten": "^2.1.1",
"array-slice": "^1.0.0",
"benchmarked": "^1.0.0",
"compute-flatten": "^1.0.0",
"flatit": "^1.1.1",
"flatten": "^1.0.2",
"flatten-array": "^1.0.0",
"glob": "^7.1.1",
"gulp-format-md": "^0.1.12",
"just-flatten-it": "^1.1.23",
"lodash.flattendeep": "^4.4.0",
"m_flattened": "^1.0.1",
"mocha": "^3.2.0",
"utils-flatten": "^1.0.0",
"write": "^0.3.3"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"homepage": "https://github.com/jonschlinkert/arr-flatten",
"keywords": [
"arr",
"array",
"elements",
"flat",
"flatten",
"nested",
"recurse",
"recursive",
"recursively"
],
"license": "MIT",
"main": "index.js",
"name": "arr-flatten",
"repository": {
"type": "git",
"url": "git+https://github.com/jonschlinkert/arr-flatten.git"
},
"scripts": {
"test": "mocha"
},
"verb": {
"toc": false,
"layout": "default",
"tasks": [
"readme"
],
"plugins": [
"gulp-format-md"
],
"related": {
"list": [
"arr-filter",
"arr-union",
"array-each",
"array-unique"
]
},
"lint": {
"reflinks": true
}
},
"version": "1.1.0"
}
......@@ -21,7 +21,7 @@
"_resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz",
"_shasum": "df010aa1287e164bbda6f9723b0a96a1ec4187a1",
"_spec": "array-find-index@^1.0.1",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\currently-unhandled",
"_where": "D:\\w\\project\\comnetprj\\node_modules\\currently-unhandled",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
......
The MIT License (MIT)
Copyright (c) 2014-2015, Jon Schlinkert.
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.
# array-unique [![NPM version](https://badge.fury.io/js/array-unique.svg)](http://badge.fury.io/js/array-unique) [![Build Status](https://travis-ci.org/jonschlinkert/array-unique.svg)](https://travis-ci.org/jonschlinkert/array-unique)
> Return an array free of duplicate values. Fastest ES5 implementation.
## Install with [npm](npmjs.org)
```bash
npm i array-unique --save
```
## Usage
```js
var unique = require('array-unique');
unique(['a', 'b', 'c', 'c']);
//=> ['a', 'b', 'c']
```
## Related
* [arr-diff](https://github.com/jonschlinkert/arr-diff): Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.
* [arr-union](https://github.com/jonschlinkert/arr-union): Returns an array of unique values using strict equality for comparisons.
* [arr-flatten](https://github.com/jonschlinkert/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten.
* [arr-reduce](https://github.com/jonschlinkert/arr-reduce): Fast array reduce that also loops over sparse elements.
* [arr-map](https://github.com/jonschlinkert/arr-map): Faster, node.js focused alternative to JavaScript's native array map.
* [arr-pluck](https://github.com/jonschlinkert/arr-pluck): Retrieves the value of a specified property from all elements in the collection.
## Run tests
Install dev dependencies.
```bash
npm i -d && npm test
```
## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/array-unique/issues)
## Author
**Jon Schlinkert**
+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
## License
Copyright (c) 2015 Jon Schlinkert
Released under the MIT license
***
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 24, 2015._
\ No newline at end of file
/*!
* array-unique <https://github.com/jonschlinkert/array-unique>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
*/
'use strict';
module.exports = function unique(arr) {
if (!Array.isArray(arr)) {
throw new TypeError('array-unique expects an array.');
}
var len = arr.length;
var i = -1;
while (i++ < len) {
var j = i + 1;
for (; j < arr.length; ++j) {
if (arr[i] === arr[j]) {
arr.splice(j--, 1);
}
}
}
return arr;
};
{
"_from": "array-unique@^0.2.1",
"_id": "array-unique@0.2.1",
"_inBundle": false,
"_integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=",
"_location": "/array-unique",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "array-unique@^0.2.1",
"name": "array-unique",
"escapedName": "array-unique",
"rawSpec": "^0.2.1",
"saveSpec": null,
"fetchSpec": "^0.2.1"
},
"_requiredBy": [
"/micromatch"
],
"_resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz",
"_shasum": "a1d97ccafcbc2625cc70fadceb36a50c58b01a53",
"_spec": "array-unique@^0.2.1",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\micromatch",
"author": {
"name": "Jon Schlinkert",
"url": "https://github.com/jonschlinkert"
},
"bugs": {
"url": "https://github.com/jonschlinkert/array-unique/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Return an array free of duplicate values. Fastest ES5 implementation.",
"devDependencies": {
"array-uniq": "^1.0.2",
"benchmarked": "^0.1.3",
"mocha": "*",
"should": "*"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"homepage": "https://github.com/jonschlinkert/array-unique",
"license": {
"type": "MIT",
"url": "https://github.com/jonschlinkert/array-unique/blob/master/LICENSE"
},
"main": "index.js",
"name": "array-unique",
"repository": {
"type": "git",
"url": "git://github.com/jonschlinkert/array-unique.git"
},
"scripts": {
"test": "mocha"
},
"version": "0.2.1"
}
......@@ -21,7 +21,7 @@
"_resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz",
"_shasum": "dac8787713c9966849fc8180777ebe9c1ddf3b86",
"_spec": "asn1@~0.2.3",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\sshpk",
"_where": "D:\\w\\project\\comnetprj\\node_modules\\sshpk",
"author": {
"name": "Mark Cavage",
"email": "mcavage@gmail.com"
......
......@@ -26,7 +26,7 @@
"_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
"_shasum": "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525",
"_spec": "assert-plus@^1.0.0",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\http-signature",
"_where": "D:\\w\\project\\comnetprj\\node_modules\\http-signature",
"author": {
"name": "Mark Cavage",
"email": "mcavage@gmail.com"
......
......@@ -21,7 +21,7 @@
"_resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.2.tgz",
"_shasum": "13ca515d86206da0bac66e834dd397d87581094c",
"_spec": "assertion-error@^1.0.1",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\chai",
"_where": "D:\\w\\project\\comnetprj\\node_modules\\chai",
"author": {
"name": "Jake Luer",
"email": "jake@qualiancy.com",
......
Copyright (c) 2013 Olov Lassus <olov.lassus@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
# ast-traverse.js
Simple but flexible AST traversal with pre and post visitors.
Works in node and browsers.
## Usage
```javascript
// ast is a Mozilla Parser API compatible structure
// generated by Esprima or another parser
var ast = require("esprima").parse("f(1, x) + 2");
var traverse = require("ast-traverse");
// print AST node types, pre-order (node first, then its children)
traverse(ast, {pre: function(node, parent, prop, idx) {
console.log(node.type + (parent ? " from parent " + parent.type +
" via " + prop + (idx !== undefined ? "[" + idx + "]" : "") : ""));
}});
console.log();
/*
=>
Program
ExpressionStatement from parent Program via body[0]
BinaryExpression from parent ExpressionStatement via expression
CallExpression from parent BinaryExpression via left
Identifier from parent CallExpression via callee
Literal from parent CallExpression via arguments[0]
Identifier from parent CallExpression via arguments[1]
Literal from parent BinaryExpression via right
*/
// you can also visit post-order, or both
// all four arguments are provided to both visitors (left out unused below)
var indent = 0;
traverse(ast, {
pre: function(node) {
console.log(Array(indent + 1).join(" ") + node.type);
indent += 4;
},
post: function() {
indent -= 4;
}
});
console.log();
/*
=>
Program
ExpressionStatement
BinaryExpression
CallExpression
Identifier
Literal
Identifier
Literal
*/
// return false from the pre-visitor to skip traversing its children
// throw an exception to abort traversal
// by default node property names beginning with $ are skipped
// but you can supply your own skipProperty function instead
traverse(ast, {
pre: function(node) {
console.log(node.type);
},
skipProperty: function(prop, node) {
return prop === "parent" || prop === "expression";
}
});
/*
=>
Program
ExpressionStatement
*/
```
## Installation
### Node
Install using npm
npm install ast-traverse
```javascript
var traverse = require("ast-traverse");
```
### Browser
Clone the repo and include it in a script tag
git clone https://github.com/olov/ast-traverse.git
```html
<script src="ast-traverse/ast-traverse.js"></script>
```
function traverse(root, options) {
"use strict";
options = options || {};
var pre = options.pre;
var post = options.post;
var skipProperty = options.skipProperty;
function visit(node, parent, prop, idx) {
if (!node || typeof node.type !== "string") {
return;
}
var res = undefined;
if (pre) {
res = pre(node, parent, prop, idx);
}
if (res !== false) {
for (var prop in node) {
if (skipProperty ? skipProperty(prop, node) : prop[0] === "$") {
continue;
}
var child = node[prop];
if (Array.isArray(child)) {
for (var i = 0; i < child.length; i++) {
visit(child[i], node, prop, i);
}
} else {
visit(child, node, prop);
}
}
}
if (post) {
post(node, parent, prop, idx);
}
}
visit(root, null);
};
if (typeof module !== "undefined" && typeof module.exports !== "undefined") {
module.exports = traverse;
}
{
"_from": "ast-traverse@~0.1.1",
"_id": "ast-traverse@0.1.1",
"_inBundle": false,
"_integrity": "sha1-ac8rg4bxnc2hux4F1o/jWdiJfeY=",
"_location": "/ast-traverse",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "ast-traverse@~0.1.1",
"name": "ast-traverse",
"escapedName": "ast-traverse",
"rawSpec": "~0.1.1",
"saveSpec": null,
"fetchSpec": "~0.1.1"
},
"_requiredBy": [
"/defs"
],
"_resolved": "https://registry.npmjs.org/ast-traverse/-/ast-traverse-0.1.1.tgz",
"_shasum": "69cf2b8386f19dcda1bb1e05d68fe359d8897de6",
"_spec": "ast-traverse@~0.1.1",
"_where": "C:\\Users\\User\\desktop\\HJW\\meadowlark\\site\\node_modules\\defs",
"author": {
"name": "Olov Lassus",
"email": "olov.lassus@gmail.com"
},
"bugs": {
"url": "https://github.com/olov/ast-traverse/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "simple but flexible AST traversal with pre and post visitors",
"homepage": "https://github.com/olov/ast-traverse#readme",
"keywords": [
"ast",
"traverse",
"traversal",
"walk",
"visit",
"visitor",
"esprima"
],
"license": "MIT",
"main": "ast-traverse.js",
"name": "ast-traverse",
"repository": {
"type": "git",
"url": "git+https://github.com/olov/ast-traverse.git"
},
"version": "0.1.1"
}
{
"type": "Program",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "BinaryExpression",
"operator": "+",
"left": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "f"
},
"arguments": [
{
"type": "Literal",
"value": 1
},
{
"type": "Identifier",
"name": "x"
}
]
},
"right": {
"type": "Literal",
"value": 2
}
}
}
]
}
// ast is a Mozilla Parser API compatible structure
// generated by Esprima or another parser
var ast = require("./tst-ast.json");
// or: var ast = require("esprima").parse("f(1, x) + 2");
var traverse = require("../ast-traverse");
// print AST node types, pre-order (node first, then its children)
traverse(ast, {pre: function(node, parent, prop, idx) {
console.log(node.type + (parent ? " from parent " + parent.type +
" via " + prop + (idx !== undefined ? "[" + idx + "]" : "") : ""));
}});
console.log();
/*
=>
Program
ExpressionStatement from parent Program via body[0]
BinaryExpression from parent ExpressionStatement via expression
CallExpression from parent BinaryExpression via left
Identifier from parent CallExpression via callee
Literal from parent CallExpression via arguments[0]
Identifier from parent CallExpression via arguments[1]
Literal from parent BinaryExpression via right
*/
// you can also visit post-order, or both
// all four arguments are provided to both visitors (left out unused below)
var indent = 0;
traverse(ast, {
pre: function(node) {
console.log(Array(indent + 1).join(" ") + node.type);
indent += 4;
},
post: function() {
indent -= 4;
}
});
console.log();
/*
=>
Program
ExpressionStatement
BinaryExpression
CallExpression
Identifier
Literal
Identifier
Literal
*/
// return false from the pre-visitor to skip traversing its children
// throw an exception to abort traversal
// by default node property names beginning with $ are skipped
// but you can supply your own skipProperty function instead
traverse(ast, {
pre: function(node) {
console.log(node.type);
},
skipProperty: function(prop, node) {
return prop === "parent" || prop === "expression";
}
});
/*
=>
Program
ExpressionStatement
*/
language: node_js
node_js:
- "6.0"
- "5.0"
- "4.0"
- "iojs"
- "0.12"
- "0.11"
- "0.10"
- "0.8"
- "0.6"
sudo: false
before_install:
npm install -g npm@'>=1.4.3'
matrix:
allow_failures:
- node_js: "0.8"
- node_js: "0.6"
Copyright (c) 2013 Ben Newman <bn@cs.stanford.edu>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This diff is collapsed. Click to expand it.
module.exports = function (fork) {
fork.use(require("./es7"));
var types = fork.use(require("../lib/types"));
var defaults = fork.use(require("../lib/shared")).defaults;
var def = types.Type.def;
var or = types.Type.or;
def("Noop")
.bases("Node")
.build();
def("DoExpression")
.bases("Expression")
.build("body")
.field("body", [def("Statement")]);
def("Super")
.bases("Expression")
.build();
def("BindExpression")
.bases("Expression")
.build("object", "callee")
.field("object", or(def("Expression"), null))
.field("callee", def("Expression"));
def("Decorator")
.bases("Node")
.build("expression")
.field("expression", def("Expression"));
def("Property")
.field("decorators",
or([def("Decorator")], null),
defaults["null"]);
def("MethodDefinition")
.field("decorators",
or([def("Decorator")], null),
defaults["null"]);
def("MetaProperty")
.bases("Expression")
.build("meta", "property")
.field("meta", def("Identifier"))
.field("property", def("Identifier"));
def("ParenthesizedExpression")
.bases("Expression")
.build("expression")
.field("expression", def("Expression"));
def("ImportSpecifier")
.bases("ModuleSpecifier")
.build("imported", "local")
.field("imported", def("Identifier"));
def("ImportDefaultSpecifier")
.bases("ModuleSpecifier")
.build("local");
def("ImportNamespaceSpecifier")
.bases("ModuleSpecifier")
.build("local");
def("ExportDefaultDeclaration")
.bases("Declaration")
.build("declaration")
.field("declaration", or(def("Declaration"), def("Expression")));
def("ExportNamedDeclaration")
.bases("Declaration")
.build("declaration", "specifiers", "source")
.field("declaration", or(def("Declaration"), null))
.field("specifiers", [def("ExportSpecifier")], defaults.emptyArray)
.field("source", or(def("Literal"), null), defaults["null"]);
def("ExportSpecifier")
.bases("ModuleSpecifier")
.build("local", "exported")
.field("exported", def("Identifier"));
def("ExportNamespaceSpecifier")
.bases("Specifier")
.build("exported")
.field("exported", def("Identifier"));
def("ExportDefaultSpecifier")
.bases("Specifier")
.build("exported")
.field("exported", def("Identifier"));
def("ExportAllDeclaration")
.bases("Declaration")
.build("exported", "source")
.field("exported", or(def("Identifier"), null))
.field("source", def("Literal"));
def("CommentBlock")
.bases("Comment")
.build("value", /*optional:*/ "leading", "trailing");
def("CommentLine")
.bases("Comment")
.build("value", /*optional:*/ "leading", "trailing");
};
\ No newline at end of file
module.exports = function (fork) {
fork.use(require("./babel"));
fork.use(require("./flow"));
// var types = fork.types;
var types = fork.use(require("../lib/types"));
// var defaults = fork.shared.defaults;
var defaults = fork.use(require("../lib/shared")).defaults;
var def = types.Type.def;
var or = types.Type.or;
def("Directive")
.bases("Node")
.build("value")
.field("value", def("DirectiveLiteral"));
def("DirectiveLiteral")
.bases("Node", "Expression")
.build("value")
.field("value", String, defaults["use strict"]);
def("BlockStatement")
.bases("Statement")
.build("body")
.field("body", [def("Statement")])
.field("directives", [def("Directive")], defaults.emptyArray);
def("Program")
.bases("Node")
.build("body")
.field("body", [def("Statement")])
.field("directives", [def("Directive")], defaults.emptyArray);
// Split Literal
def("StringLiteral")
.bases("Literal")
.build("value")
.field("value", String);
def("NumericLiteral")
.bases("Literal")
.build("value")
.field("value", Number);
def("NullLiteral")
.bases("Literal")
.build();
def("BooleanLiteral")
.bases("Literal")
.build("value")
.field("value", Boolean);
def("RegExpLiteral")
.bases("Literal")
.build("pattern", "flags")
.field("pattern", String)
.field("flags", String);
var ObjectExpressionProperty = or(
def("Property"),
def("ObjectMethod"),
def("ObjectProperty"),
def("SpreadProperty")
);
// Split Property -> ObjectProperty and ObjectMethod
def("ObjectExpression")
.bases("Expression")
.build("properties")
.field("properties", [ObjectExpressionProperty]);
// ObjectMethod hoist .value properties to own properties
def("ObjectMethod")
.bases("Node", "Function")
.build("kind", "key", "params", "body", "computed")
.field("kind", or("method", "get", "set"))
.field("key", or(def("Literal"), def("Identifier"), def("Expression")))
.field("params", [def("Pattern")])
.field("body", def("BlockStatement"))
.field("computed", Boolean, defaults["false"])
.field("generator", Boolean, defaults["false"])
.field("async", Boolean, defaults["false"])
.field("decorators",
or([def("Decorator")], null),
defaults["null"]);
def("ObjectProperty")
.bases("Node")
.build("key", "value")
.field("key", or(def("Literal"), def("Identifier"), def("Expression")))
.field("value", or(def("Expression"), def("Pattern")))
.field("computed", Boolean, defaults["false"]);
var ClassBodyElement = or(
def("MethodDefinition"),
def("VariableDeclarator"),
def("ClassPropertyDefinition"),
def("ClassProperty"),
def("ClassMethod")
);
// MethodDefinition -> ClassMethod
def("ClassBody")
.bases("Declaration")
.build("body")
.field("body", [ClassBodyElement]);
def("ClassMethod")
.bases("Declaration", "Function")
.build("kind", "key", "params", "body", "computed", "static")
.field("kind", or("get", "set", "method", "constructor"))
.field("key", or(def("Literal"), def("Identifier"), def("Expression")))
.field("params", [def("Pattern")])
.field("body", def("BlockStatement"))
.field("computed", Boolean, defaults["false"])
.field("static", Boolean, defaults["false"])
.field("generator", Boolean, defaults["false"])
.field("async", Boolean, defaults["false"])
.field("decorators",
or([def("Decorator")], null),
defaults["null"]);
var ObjectPatternProperty = or(
def("Property"),
def("PropertyPattern"),
def("SpreadPropertyPattern"),
def("SpreadProperty"), // Used by Esprima
def("ObjectProperty"), // Babel 6
def("RestProperty") // Babel 6
);
// Split into RestProperty and SpreadProperty
def("ObjectPattern")
.bases("Pattern")
.build("properties")
.field("properties", [ObjectPatternProperty])
.field("decorators",
or([def("Decorator")], null),
defaults["null"]);
def("SpreadProperty")
.bases("Node")
.build("argument")
.field("argument", def("Expression"));
def("RestProperty")
.bases("Node")
.build("argument")
.field("argument", def("Expression"));
def("ForAwaitStatement")
.bases("Statement")
.build("left", "right", "body")
.field("left", or(
def("VariableDeclaration"),
def("Expression")))
.field("right", def("Expression"))
.field("body", def("Statement"));
// The callee node of a dynamic import(...) expression.
def("Import")
.bases("Expression")
.build();
};
This diff is collapsed. Click to expand it.
module.exports = function (fork) {
fork.use(require("./core"));
var types = fork.use(require("../lib/types"));
var def = types.Type.def;
var or = types.Type.or;
// Note that none of these types are buildable because the Mozilla Parser
// API doesn't specify any builder functions, and nobody uses E4X anymore.
def("XMLDefaultDeclaration")
.bases("Declaration")
.field("namespace", def("Expression"));
def("XMLAnyName").bases("Expression");
def("XMLQualifiedIdentifier")
.bases("Expression")
.field("left", or(def("Identifier"), def("XMLAnyName")))
.field("right", or(def("Identifier"), def("Expression")))
.field("computed", Boolean);
def("XMLFunctionQualifiedIdentifier")
.bases("Expression")
.field("right", or(def("Identifier"), def("Expression")))
.field("computed", Boolean);
def("XMLAttributeSelector")
.bases("Expression")
.field("attribute", def("Expression"));
def("XMLFilterExpression")
.bases("Expression")
.field("left", def("Expression"))
.field("right", def("Expression"));
def("XMLElement")
.bases("XML", "Expression")
.field("contents", [def("XML")]);
def("XMLList")
.bases("XML", "Expression")
.field("contents", [def("XML")]);
def("XML").bases("Node");
def("XMLEscape")
.bases("XML")
.field("expression", def("Expression"));
def("XMLText")
.bases("XML")
.field("text", String);
def("XMLStartTag")
.bases("XML")
.field("contents", [def("XML")]);
def("XMLEndTag")
.bases("XML")
.field("contents", [def("XML")]);
def("XMLPointTag")
.bases("XML")
.field("contents", [def("XML")]);
def("XMLName")
.bases("XML")
.field("contents", or(String, [def("XML")]));
def("XMLAttribute")
.bases("XML")
.field("value", String);
def("XMLCdata")
.bases("XML")
.field("contents", String);
def("XMLComment")
.bases("XML")
.field("contents", String);
def("XMLProcessingInstruction")
.bases("XML")
.field("target", String)
.field("contents", or(String, null));
};
\ No newline at end of file
module.exports = function (fork) {
fork.use(require("./core"));
var types = fork.use(require("../lib/types"));
var def = types.Type.def;
var or = types.Type.or;
var defaults = fork.use(require("../lib/shared")).defaults;
def("Function")
.field("generator", Boolean, defaults["false"])
.field("expression", Boolean, defaults["false"])
.field("defaults", [or(def("Expression"), null)], defaults.emptyArray)
// TODO This could be represented as a RestElement in .params.
.field("rest", or(def("Identifier"), null), defaults["null"]);
// The ESTree way of representing a ...rest parameter.
def("RestElement")
.bases("Pattern")
.build("argument")
.field("argument", def("Pattern"));
def("SpreadElementPattern")
.bases("Pattern")
.build("argument")
.field("argument", def("Pattern"));
def("FunctionDeclaration")
.build("id", "params", "body", "generator", "expression");
def("FunctionExpression")
.build("id", "params", "body", "generator", "expression");
// The Parser API calls this ArrowExpression, but Esprima and all other
// actual parsers use ArrowFunctionExpression.
def("ArrowFunctionExpression")
.bases("Function", "Expression")
.build("params", "body", "expression")
// The forced null value here is compatible with the overridden
// definition of the "id" field in the Function interface.
.field("id", null, defaults["null"])
// Arrow function bodies are allowed to be expressions.
.field("body", or(def("BlockStatement"), def("Expression")))
// The current spec forbids arrow generators, so I have taken the
// liberty of enforcing that. TODO Report this.
.field("generator", false, defaults["false"]);
def("YieldExpression")
.bases("Expression")
.build("argument", "delegate")
.field("argument", or(def("Expression"), null))
.field("delegate", Boolean, defaults["false"]);
def("GeneratorExpression")
.bases("Expression")
.build("body", "blocks", "filter")
.field("body", def("Expression"))
.field("blocks", [def("ComprehensionBlock")])
.field("filter", or(def("Expression"), null));
def("ComprehensionExpression")
.bases("Expression")
.build("body", "blocks", "filter")
.field("body", def("Expression"))
.field("blocks", [def("ComprehensionBlock")])
.field("filter", or(def("Expression"), null));
def("ComprehensionBlock")
.bases("Node")
.build("left", "right", "each")
.field("left", def("Pattern"))
.field("right", def("Expression"))
.field("each", Boolean);
def("Property")
.field("key", or(def("Literal"), def("Identifier"), def("Expression")))
.field("value", or(def("Expression"), def("Pattern")))
.field("method", Boolean, defaults["false"])
.field("shorthand", Boolean, defaults["false"])
.field("computed", Boolean, defaults["false"]);
def("PropertyPattern")
.bases("Pattern")
.build("key", "pattern")
.field("key", or(def("Literal"), def("Identifier"), def("Expression")))
.field("pattern", def("Pattern"))
.field("computed", Boolean, defaults["false"]);
def("ObjectPattern")
.bases("Pattern")
.build("properties")
.field("properties", [or(def("PropertyPattern"), def("Property"))]);
def("ArrayPattern")
.bases("Pattern")
.build("elements")
.field("elements", [or(def("Pattern"), null)]);
def("MethodDefinition")
.bases("Declaration")
.build("kind", "key", "value", "static")
.field("kind", or("constructor", "method", "get", "set"))
.field("key", or(def("Literal"), def("Identifier"), def("Expression")))
.field("value", def("Function"))
.field("computed", Boolean, defaults["false"])
.field("static", Boolean, defaults["false"]);
def("SpreadElement")
.bases("Node")
.build("argument")
.field("argument", def("Expression"));
def("ArrayExpression")
.field("elements", [or(
def("Expression"),
def("SpreadElement"),
def("RestElement"),
null
)]);
def("NewExpression")
.field("arguments", [or(def("Expression"), def("SpreadElement"))]);
def("CallExpression")
.field("arguments", [or(def("Expression"), def("SpreadElement"))]);
// Note: this node type is *not* an AssignmentExpression with a Pattern on
// the left-hand side! The existing AssignmentExpression type already
// supports destructuring assignments. AssignmentPattern nodes may appear
// wherever a Pattern is allowed, and the right-hand side represents a
// default value to be destructured against the left-hand side, if no
// value is otherwise provided. For example: default parameter values.
def("AssignmentPattern")
.bases("Pattern")
.build("left", "right")
.field("left", def("Pattern"))
.field("right", def("Expression"));
var ClassBodyElement = or(
def("MethodDefinition"),
def("VariableDeclarator"),
def("ClassPropertyDefinition"),
def("ClassProperty")
);
def("ClassProperty")
.bases("Declaration")
.build("key")
.field("key", or(def("Literal"), def("Identifier"), def("Expression")))
.field("computed", Boolean, defaults["false"]);
def("ClassPropertyDefinition") // static property
.bases("Declaration")
.build("definition")
// Yes, Virginia, circular definitions are permitted.
.field("definition", ClassBodyElement);
def("ClassBody")
.bases("Declaration")
.build("body")
.field("body", [ClassBodyElement]);
def("ClassDeclaration")
.bases("Declaration")
.build("id", "body", "superClass")
.field("id", or(def("Identifier"), null))
.field("body", def("ClassBody"))
.field("superClass", or(def("Expression"), null), defaults["null"]);
def("ClassExpression")
.bases("Expression")
.build("id", "body", "superClass")
.field("id", or(def("Identifier"), null), defaults["null"])
.field("body", def("ClassBody"))
.field("superClass", or(def("Expression"), null), defaults["null"])
.field("implements", [def("ClassImplements")], defaults.emptyArray);
def("ClassImplements")
.bases("Node")
.build("id")
.field("id", def("Identifier"))
.field("superClass", or(def("Expression"), null), defaults["null"]);
// Specifier and ModuleSpecifier are abstract non-standard types
// introduced for definitional convenience.
def("Specifier").bases("Node");
// This supertype is shared/abused by both def/babel.js and
// def/esprima.js. In the future, it will be possible to load only one set
// of definitions appropriate for a given parser, but until then we must
// rely on default functions to reconcile the conflicting AST formats.
def("ModuleSpecifier")
.bases("Specifier")
// This local field is used by Babel/Acorn. It should not technically
// be optional in the Babel/Acorn AST format, but it must be optional
// in the Esprima AST format.
.field("local", or(def("Identifier"), null), defaults["null"])
// The id and name fields are used by Esprima. The id field should not
// technically be optional in the Esprima AST format, but it must be
// optional in the Babel/Acorn AST format.
.field("id", or(def("Identifier"), null), defaults["null"])
.field("name", or(def("Identifier"), null), defaults["null"]);
def("TaggedTemplateExpression")
.bases("Expression")
.build("tag", "quasi")
.field("tag", def("Expression"))
.field("quasi", def("TemplateLiteral"));
def("TemplateLiteral")
.bases("Expression")
.build("quasis", "expressions")
.field("quasis", [def("TemplateElement")])
.field("expressions", [def("Expression")]);
def("TemplateElement")
.bases("Node")
.build("value", "tail")
.field("value", {"cooked": String, "raw": String})
.field("tail", Boolean);
};
module.exports = function (fork) {
fork.use(require('./es6'));
var types = fork.use(require("../lib/types"));
var def = types.Type.def;
var or = types.Type.or;
var builtin = types.builtInTypes;
var defaults = fork.use(require("../lib/shared")).defaults;
def("Function")
.field("async", Boolean, defaults["false"]);
def("SpreadProperty")
.bases("Node")
.build("argument")
.field("argument", def("Expression"));
def("ObjectExpression")
.field("properties", [or(def("Property"), def("SpreadProperty"))]);
def("SpreadPropertyPattern")
.bases("Pattern")
.build("argument")
.field("argument", def("Pattern"));
def("ObjectPattern")
.field("properties", [or(
def("Property"),
def("PropertyPattern"),
def("SpreadPropertyPattern")
)]);
def("AwaitExpression")
.bases("Expression")
.build("argument", "all")
.field("argument", or(def("Expression"), null))
.field("all", Boolean, defaults["false"]);
};
\ No newline at end of file
module.exports = function (fork) {
fork.use(require("./es7"));
var types = fork.use(require("../lib/types"));
var defaults = fork.use(require("../lib/shared")).defaults;
var def = types.Type.def;
var or = types.Type.or;
def("VariableDeclaration")
.field("declarations", [or(
def("VariableDeclarator"),
def("Identifier") // Esprima deviation.
)]);
def("Property")
.field("value", or(
def("Expression"),
def("Pattern") // Esprima deviation.
));
def("ArrayPattern")
.field("elements", [or(
def("Pattern"),
def("SpreadElement"),
null
)]);
def("ObjectPattern")
.field("properties", [or(
def("Property"),
def("PropertyPattern"),
def("SpreadPropertyPattern"),
def("SpreadProperty") // Used by Esprima.
)]);
// Like ModuleSpecifier, except type:"ExportSpecifier" and buildable.
// export {<id [as name]>} [from ...];
def("ExportSpecifier")
.bases("ModuleSpecifier")
.build("id", "name");
// export <*> from ...;
def("ExportBatchSpecifier")
.bases("Specifier")
.build();
// Like ModuleSpecifier, except type:"ImportSpecifier" and buildable.
// import {<id [as name]>} from ...;
def("ImportSpecifier")
.bases("ModuleSpecifier")
.build("id", "name");
// import <* as id> from ...;
def("ImportNamespaceSpecifier")
.bases("ModuleSpecifier")
.build("id");
// import <id> from ...;
def("ImportDefaultSpecifier")
.bases("ModuleSpecifier")
.build("id");
def("ExportDeclaration")
.bases("Declaration")
.build("default", "declaration", "specifiers", "source")
.field("default", Boolean)
.field("declaration", or(
def("Declaration"),
def("Expression"), // Implies default.
null
))
.field("specifiers", [or(
def("ExportSpecifier"),
def("ExportBatchSpecifier")
)], defaults.emptyArray)
.field("source", or(
def("Literal"),
null
), defaults["null"]);
def("ImportDeclaration")
.bases("Declaration")
.build("specifiers", "source", "importKind")
.field("specifiers", [or(
def("ImportSpecifier"),
def("ImportNamespaceSpecifier"),
def("ImportDefaultSpecifier")
)], defaults.emptyArray)
.field("source", def("Literal"))
.field("importKind", or(
"value",
"type"
), function() {
return "value";
});
def("Block")
.bases("Comment")
.build("value", /*optional:*/ "leading", "trailing");
def("Line")
.bases("Comment")
.build("value", /*optional:*/ "leading", "trailing");
};
\ No newline at end of file
module.exports = function (fork) {
fork.use(require("./es7"));
var types = fork.use(require("../lib/types"));
var def = types.Type.def;
var or = types.Type.or;
var defaults = fork.use(require("../lib/shared")).defaults;
// Type Annotations
def("Type").bases("Node");
def("AnyTypeAnnotation")
.bases("Type")
.build();
def("EmptyTypeAnnotation")
.bases("Type")
.build();
def("MixedTypeAnnotation")
.bases("Type")
.build();
def("VoidTypeAnnotation")
.bases("Type")
.build();
def("NumberTypeAnnotation")
.bases("Type")
.build();
def("NumberLiteralTypeAnnotation")
.bases("Type")
.build("value", "raw")
.field("value", Number)
.field("raw", String);
// Babylon 6 differs in AST from Flow
// same as NumberLiteralTypeAnnotation
def("NumericLiteralTypeAnnotation")
.bases("Type")
.build("value", "raw")
.field("value", Number)
.field("raw", String);
def("StringTypeAnnotation")
.bases("Type")
.build();
def("StringLiteralTypeAnnotation")
.bases("Type")
.build("value", "raw")
.field("value", String)
.field("raw", String);
def("BooleanTypeAnnotation")
.bases("Type")
.build();
def("BooleanLiteralTypeAnnotation")
.bases("Type")
.build("value", "raw")
.field("value", Boolean)
.field("raw", String);
def("TypeAnnotation")
.bases("Node")
.build("typeAnnotation")
.field("typeAnnotation", def("Type"));
def("NullableTypeAnnotation")
.bases("Type")
.build("typeAnnotation")
.field("typeAnnotation", def("Type"));
def("NullLiteralTypeAnnotation")
.bases("Type")
.build();
def("NullTypeAnnotation")
.bases("Type")
.build();
def("ThisTypeAnnotation")
.bases("Type")
.build();
def("ExistsTypeAnnotation")
.bases("Type")
.build();
def("ExistentialTypeParam")
.bases("Type")
.build();
def("FunctionTypeAnnotation")
.bases("Type")
.build("params", "returnType", "rest", "typeParameters")
.field("params", [def("FunctionTypeParam")])
.field("returnType", def("Type"))
.field("rest", or(def("FunctionTypeParam"), null))
.field("typeParameters", or(def("TypeParameterDeclaration"), null));
def("FunctionTypeParam")
.bases("Node")
.build("name", "typeAnnotation", "optional")
.field("name", def("Identifier"))
.field("typeAnnotation", def("Type"))
.field("optional", Boolean);
def("ArrayTypeAnnotation")
.bases("Type")
.build("elementType")
.field("elementType", def("Type"));
def("ObjectTypeAnnotation")
.bases("Type")
.build("properties", "indexers", "callProperties")
.field("properties", [def("ObjectTypeProperty")])
.field("indexers", [def("ObjectTypeIndexer")], defaults.emptyArray)
.field("callProperties",
[def("ObjectTypeCallProperty")],
defaults.emptyArray)
.field("exact", Boolean, defaults["false"]);
def("ObjectTypeProperty")
.bases("Node")
.build("key", "value", "optional")
.field("key", or(def("Literal"), def("Identifier")))
.field("value", def("Type"))
.field("optional", Boolean)
.field("variance",
or("plus", "minus", null),
defaults["null"]);
def("ObjectTypeIndexer")
.bases("Node")
.build("id", "key", "value")
.field("id", def("Identifier"))
.field("key", def("Type"))
.field("value", def("Type"))
.field("variance",
or("plus", "minus", null),
defaults["null"]);
def("ObjectTypeCallProperty")
.bases("Node")
.build("value")
.field("value", def("FunctionTypeAnnotation"))
.field("static", Boolean, defaults["false"]);
def("QualifiedTypeIdentifier")
.bases("Node")
.build("qualification", "id")
.field("qualification",
or(def("Identifier"),
def("QualifiedTypeIdentifier")))
.field("id", def("Identifier"));
def("GenericTypeAnnotation")
.bases("Type")
.build("id", "typeParameters")
.field("id", or(def("Identifier"), def("QualifiedTypeIdentifier")))
.field("typeParameters", or(def("TypeParameterInstantiation"), null));
def("MemberTypeAnnotation")
.bases("Type")
.build("object", "property")
.field("object", def("Identifier"))
.field("property",
or(def("MemberTypeAnnotation"),
def("GenericTypeAnnotation")));
def("UnionTypeAnnotation")
.bases("Type")
.build("types")
.field("types", [def("Type")]);
def("IntersectionTypeAnnotation")
.bases("Type")
.build("types")
.field("types", [def("Type")]);
def("TypeofTypeAnnotation")
.bases("Type")
.build("argument")
.field("argument", def("Type"));
def("Identifier")
.field("typeAnnotation", or(def("TypeAnnotation"), null), defaults["null"]);
def("TypeParameterDeclaration")
.bases("Node")
.build("params")
.field("params", [def("TypeParameter")]);
def("TypeParameterInstantiation")
.bases("Node")
.build("params")
.field("params", [def("Type")]);
def("TypeParameter")
.bases("Type")
.build("name", "variance", "bound")
.field("name", String)
.field("variance",
or("plus", "minus", null),
defaults["null"])
.field("bound",
or(def("TypeAnnotation"), null),
defaults["null"]);
def("Function")
.field("returnType",
or(def("TypeAnnotation"), null),
defaults["null"])
.field("typeParameters",
or(def("TypeParameterDeclaration"), null),
defaults["null"]);
def("ClassProperty")
.build("key", "value", "typeAnnotation", "static")
.field("value", or(def("Expression"), null))
.field("typeAnnotation", or(def("TypeAnnotation"), null))
.field("static", Boolean, defaults["false"])
.field("variance",
or("plus", "minus", null),
defaults["null"]);
def("ClassImplements")
.field("typeParameters",
or(def("TypeParameterInstantiation"), null),
defaults["null"]);
def("InterfaceDeclaration")
.bases("Declaration")
.build("id", "body", "extends")
.field("id", def("Identifier"))
.field("typeParameters",
or(def("TypeParameterDeclaration"), null),
defaults["null"])
.field("body", def("ObjectTypeAnnotation"))
.field("extends", [def("InterfaceExtends")]);
def("DeclareInterface")
.bases("InterfaceDeclaration")
.build("id", "body", "extends");
def("InterfaceExtends")
.bases("Node")
.build("id")
.field("id", def("Identifier"))
.field("typeParameters", or(def("TypeParameterInstantiation"), null));
def("TypeAlias")
.bases("Declaration")
.build("id", "typeParameters", "right")
.field("id", def("Identifier"))
.field("typeParameters", or(def("TypeParameterDeclaration"), null))
.field("right", def("Type"));
def("DeclareTypeAlias")
.bases("TypeAlias")
.build("id", "typeParameters", "right");
def("TypeCastExpression")
.bases("Expression")
.build("expression", "typeAnnotation")
.field("expression", def("Expression"))
.field("typeAnnotation", def("TypeAnnotation"));
def("TupleTypeAnnotation")
.bases("Type")
.build("types")
.field("types", [def("Type")]);
def("DeclareVariable")
.bases("Statement")
.build("id")
.field("id", def("Identifier"));
def("DeclareFunction")
.bases("Statement")
.build("id")
.field("id", def("Identifier"));
def("DeclareClass")
.bases("InterfaceDeclaration")
.build("id");
def("DeclareModule")
.bases("Statement")
.build("id", "body")
.field("id", or(def("Identifier"), def("Literal")))
.field("body", def("BlockStatement"));
def("DeclareModuleExports")
.bases("Statement")
.build("typeAnnotation")
.field("typeAnnotation", def("Type"));
def("DeclareExportDeclaration")
.bases("Declaration")
.build("default", "declaration", "specifiers", "source")
.field("default", Boolean)
.field("declaration", or(
def("DeclareVariable"),
def("DeclareFunction"),
def("DeclareClass"),
def("Type"), // Implies default.
null
))
.field("specifiers", [or(
def("ExportSpecifier"),
def("ExportBatchSpecifier")
)], defaults.emptyArray)
.field("source", or(
def("Literal"),
null
), defaults["null"]);
def("DeclareExportAllDeclaration")
.bases("Declaration")
.build("source")
.field("source", or(
def("Literal"),
null
), defaults["null"]);
};
module.exports = function (fork) {
fork.use(require("./es7"));
var types = fork.use(require("../lib/types"));
var def = types.Type.def;
var or = types.Type.or;
var defaults = fork.use(require("../lib/shared")).defaults;
def("JSXAttribute")
.bases("Node")
.build("name", "value")
.field("name", or(def("JSXIdentifier"), def("JSXNamespacedName")))
.field("value", or(
def("Literal"), // attr="value"
def("JSXExpressionContainer"), // attr={value}
null // attr= or just attr
), defaults["null"]);
def("JSXIdentifier")
.bases("Identifier")
.build("name")
.field("name", String);
def("JSXNamespacedName")
.bases("Node")
.build("namespace", "name")
.field("namespace", def("JSXIdentifier"))
.field("name", def("JSXIdentifier"));
def("JSXMemberExpression")
.bases("MemberExpression")
.build("object", "property")
.field("object", or(def("JSXIdentifier"), def("JSXMemberExpression")))
.field("property", def("JSXIdentifier"))
.field("computed", Boolean, defaults.false);
var JSXElementName = or(
def("JSXIdentifier"),
def("JSXNamespacedName"),
def("JSXMemberExpression")
);
def("JSXSpreadAttribute")
.bases("Node")
.build("argument")
.field("argument", def("Expression"));
var JSXAttributes = [or(
def("JSXAttribute"),
def("JSXSpreadAttribute")
)];
def("JSXExpressionContainer")
.bases("Expression")
.build("expression")
.field("expression", def("Expression"));
def("JSXElement")
.bases("Expression")
.build("openingElement", "closingElement", "children")
.field("openingElement", def("JSXOpeningElement"))
.field("closingElement", or(def("JSXClosingElement"), null), defaults["null"])
.field("children", [or(
def("JSXElement"),
def("JSXExpressionContainer"),
def("JSXText"),
def("Literal") // TODO Esprima should return JSXText instead.
)], defaults.emptyArray)
.field("name", JSXElementName, function () {
// Little-known fact: the `this` object inside a default function
// is none other than the partially-built object itself, and any
// fields initialized directly from builder function arguments
// (like openingElement, closingElement, and children) are
// guaranteed to be available.
return this.openingElement.name;
}, true) // hidden from traversal
.field("selfClosing", Boolean, function () {
return this.openingElement.selfClosing;
}, true) // hidden from traversal
.field("attributes", JSXAttributes, function () {
return this.openingElement.attributes;
}, true); // hidden from traversal
def("JSXOpeningElement")
.bases("Node") // TODO Does this make sense? Can't really be an JSXElement.
.build("name", "attributes", "selfClosing")
.field("name", JSXElementName)
.field("attributes", JSXAttributes, defaults.emptyArray)
.field("selfClosing", Boolean, defaults["false"]);
def("JSXClosingElement")
.bases("Node") // TODO Same concern.
.build("name")
.field("name", JSXElementName);
def("JSXText")
.bases("Literal")
.build("value")
.field("value", String);
def("JSXEmptyExpression").bases("Expression").build();
};
\ No newline at end of file
module.exports = function (fork) {
fork.use(require("./core"));
var types = fork.use(require("../lib/types"));
var def = types.Type.def;
var or = types.Type.or;
var shared = fork.use(require("../lib/shared"));
var geq = shared.geq;
var defaults = shared.defaults;
def("Function")
// SpiderMonkey allows expression closures: function(x) x+1
.field("body", or(def("BlockStatement"), def("Expression")));
def("ForInStatement")
.build("left", "right", "body", "each")
.field("each", Boolean, defaults["false"]);
def("ForOfStatement")
.bases("Statement")
.build("left", "right", "body")
.field("left", or(
def("VariableDeclaration"),
def("Expression")))
.field("right", def("Expression"))
.field("body", def("Statement"));
def("LetStatement")
.bases("Statement")
.build("head", "body")
// TODO Deviating from the spec by reusing VariableDeclarator here.
.field("head", [def("VariableDeclarator")])
.field("body", def("Statement"));
def("LetExpression")
.bases("Expression")
.build("head", "body")
// TODO Deviating from the spec by reusing VariableDeclarator here.
.field("head", [def("VariableDeclarator")])
.field("body", def("Expression"));
def("GraphExpression")
.bases("Expression")
.build("index", "expression")
.field("index", geq(0))
.field("expression", def("Literal"));
def("GraphIndexExpression")
.bases("Expression")
.build("index")
.field("index", geq(0));
};
\ No newline at end of file
module.exports = function (defs) {
var used = [];
var usedResult = [];
var fork = {};
function use(plugin) {
var idx = used.indexOf(plugin);
if (idx === -1) {
idx = used.length;
used.push(plugin);
usedResult[idx] = plugin(fork);
}
return usedResult[idx];
}
fork.use = use;
var types = use(require('./lib/types'));
defs.forEach(use);
types.finalize();
var exports = {
Type: types.Type,
builtInTypes: types.builtInTypes,
namedTypes: types.namedTypes,
builders: types.builders,
defineMethod: types.defineMethod,
getFieldNames: types.getFieldNames,
getFieldValue: types.getFieldValue,
eachField: types.eachField,
someField: types.someField,
getSupertypeNames: types.getSupertypeNames,
astNodesAreEquivalent: use(require("./lib/equiv")),
finalize: types.finalize,
Path: use(require('./lib/path')),
NodePath: use(require("./lib/node-path")),
PathVisitor: use(require("./lib/path-visitor")),
use: use
};
exports.visit = exports.PathVisitor.visit;
return exports;
};
\ No newline at end of file
module.exports = function (fork) {
var types = fork.use(require('../lib/types'));
var getFieldNames = types.getFieldNames;
var getFieldValue = types.getFieldValue;
var isArray = types.builtInTypes.array;
var isObject = types.builtInTypes.object;
var isDate = types.builtInTypes.Date;
var isRegExp = types.builtInTypes.RegExp;
var hasOwn = Object.prototype.hasOwnProperty;
function astNodesAreEquivalent(a, b, problemPath) {
if (isArray.check(problemPath)) {
problemPath.length = 0;
} else {
problemPath = null;
}
return areEquivalent(a, b, problemPath);
}
astNodesAreEquivalent.assert = function (a, b) {
var problemPath = [];
if (!astNodesAreEquivalent(a, b, problemPath)) {
if (problemPath.length === 0) {
if (a !== b) {
throw new Error("Nodes must be equal");
}
} else {
throw new Error(
"Nodes differ in the following path: " +
problemPath.map(subscriptForProperty).join("")
);
}
}
};
function subscriptForProperty(property) {
if (/[_$a-z][_$a-z0-9]*/i.test(property)) {
return "." + property;
}
return "[" + JSON.stringify(property) + "]";
}
function areEquivalent(a, b, problemPath) {
if (a === b) {
return true;
}
if (isArray.check(a)) {
return arraysAreEquivalent(a, b, problemPath);
}
if (isObject.check(a)) {
return objectsAreEquivalent(a, b, problemPath);
}
if (isDate.check(a)) {
return isDate.check(b) && (+a === +b);
}
if (isRegExp.check(a)) {
return isRegExp.check(b) && (
a.source === b.source &&
a.global === b.global &&
a.multiline === b.multiline &&
a.ignoreCase === b.ignoreCase
);
}
return a == b;
}
function arraysAreEquivalent(a, b, problemPath) {
isArray.assert(a);
var aLength = a.length;
if (!isArray.check(b) || b.length !== aLength) {
if (problemPath) {
problemPath.push("length");
}
return false;
}
for (var i = 0; i < aLength; ++i) {
if (problemPath) {
problemPath.push(i);
}
if (i in a !== i in b) {
return false;
}
if (!areEquivalent(a[i], b[i], problemPath)) {
return false;
}
if (problemPath) {
var problemPathTail = problemPath.pop();
if (problemPathTail !== i) {
throw new Error("" + problemPathTail);
}
}
}
return true;
}
function objectsAreEquivalent(a, b, problemPath) {
isObject.assert(a);
if (!isObject.check(b)) {
return false;
}
// Fast path for a common property of AST nodes.
if (a.type !== b.type) {
if (problemPath) {
problemPath.push("type");
}
return false;
}
var aNames = getFieldNames(a);
var aNameCount = aNames.length;
var bNames = getFieldNames(b);
var bNameCount = bNames.length;
if (aNameCount === bNameCount) {
for (var i = 0; i < aNameCount; ++i) {
var name = aNames[i];
var aChild = getFieldValue(a, name);
var bChild = getFieldValue(b, name);
if (problemPath) {
problemPath.push(name);
}
if (!areEquivalent(aChild, bChild, problemPath)) {
return false;
}
if (problemPath) {
var problemPathTail = problemPath.pop();
if (problemPathTail !== name) {
throw new Error("" + problemPathTail);
}
}
}
return true;
}
if (!problemPath) {
return false;
}
// Since aNameCount !== bNameCount, we need to find some name that's
// missing in aNames but present in bNames, or vice-versa.
var seenNames = Object.create(null);
for (i = 0; i < aNameCount; ++i) {
seenNames[aNames[i]] = true;
}
for (i = 0; i < bNameCount; ++i) {
name = bNames[i];
if (!hasOwn.call(seenNames, name)) {
problemPath.push(name);
return false;
}
delete seenNames[name];
}
for (name in seenNames) {
problemPath.push(name);
break;
}
return false;
}
return astNodesAreEquivalent;
};
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.