Plugin Idiomas configurado con template en Angular
This commit is contained in:
parent
dc992dd9e5
commit
b4a43e6796
25
Gruntfile.js
Normal file
25
Gruntfile.js
Normal file
@ -0,0 +1,25 @@
|
||||
module.exports = function(grunt) {
|
||||
grunt.loadNpmTasks('grunt-angular-gettext');
|
||||
grunt.initConfig({
|
||||
nggettext_extract: {
|
||||
pot: {
|
||||
files: {
|
||||
'po/template.pot': ['partials/*.html']
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
grunt.initConfig({
|
||||
nggettext_compile: {
|
||||
all: {
|
||||
files: {
|
||||
'src/js/translations.js': ['po/*.po']
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
// Default task(s).
|
||||
grunt.registerTask('default', ['nggettext_compile']);
|
||||
};
|
@ -4,7 +4,10 @@ angular.
|
||||
templateUrl : localized.partials + 'catalog.template.html',
|
||||
//'<a ng-repeat="item in $ctrl.catalog" class="square" style="background-image:url(\'{{item.img}}\');" ng-href="#!/catalog/{{item.id}}"></a>',
|
||||
controller :
|
||||
function($scope, $http, $routeParams) {
|
||||
function($scope, $http, $routeParams, $rootScope) {
|
||||
$rootScope.lanEs = "http://es.anorgatarrak.eus/catalog/";
|
||||
$rootScope.lanEu = "http://anorgatarrak.eus/catalog2/";
|
||||
|
||||
$http.get('wp-json/wp/v2/entrevista/?per_page=100').then(function(res) {
|
||||
$scope.entrevistas = res.data;
|
||||
console.log(res);
|
||||
@ -18,6 +21,8 @@ angular.
|
||||
component('anHome',{
|
||||
templateUrl: localized.partials + 'home.template.html',
|
||||
controller: function($scope, $rootScope, $http, $routeParams) {
|
||||
$rootScope.lanEs = "http://es.anorgatarrak.eus";
|
||||
$rootScope.lanEu = "http://anorgatarrak.eus";
|
||||
console.log($rootScope.loading);
|
||||
$scope.loading = true;
|
||||
window.scrollTo(0,0);
|
||||
@ -37,7 +42,35 @@ angular.
|
||||
angular.
|
||||
module('catalog').
|
||||
component('anInfo',{
|
||||
templateUrl: localized.partials + 'info.template.html'
|
||||
templateUrl: localized.partials + 'info.template.html',
|
||||
controller: function($rootScope) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
angular.
|
||||
module('catalog').
|
||||
component('anLanguage', {
|
||||
templateUrl: localized.partials + 'language.template.html',
|
||||
controller: function($scope,$http,$routeParams,$sce,$rootScope,$location) {
|
||||
|
||||
console.log($rootScope);
|
||||
$scope.lan = function (l) {
|
||||
|
||||
if (l=='es') {
|
||||
window.location.assign($rootScope.lanEs);
|
||||
} else {
|
||||
window.location.assign($rootScope.lanEu);
|
||||
}
|
||||
};
|
||||
//console.log("anLanguage:"+$routeParams);
|
||||
//$http.get('wp-json/anorgatarrak/v1/link/'+$routeParams.slug).then(function(res) {
|
||||
// data = res.data;
|
||||
// console.log(data);
|
||||
//jQuery('#lan_link_eus').attr('href',data[1][1]);
|
||||
//jQuery('#lan_link_es').attr('href',data[0][1]);
|
||||
//});
|
||||
}
|
||||
});
|
||||
|
||||
angular
|
||||
@ -50,7 +83,13 @@ angular
|
||||
window.scrollTo(0,0);
|
||||
$http.get('wp-json/wp/v2/pages/?slug='+$routeParams.slug).then(function(res) {
|
||||
$scope.post = res.data[0];
|
||||
console.log($scope.post.link_es);
|
||||
$scope.content = $sce.trustAsHtml($scope.post.content.rendered);
|
||||
//console.log('llamamos el cambi ode idioma');
|
||||
$rootScope.lanEs = $scope.post.link_es;
|
||||
$rootScope.lanEu = $scope.post.link_eu;
|
||||
//jQuery('#lan_link_eus').attr('href',"/"+$scope.post.link_eu); //.on('click',function() { alert('sss'); });
|
||||
//jQuery('#lan_link_es').attr('href',"/"+$scope.post.link_es);
|
||||
$rootScope.stopLoading();
|
||||
});
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ angular.
|
||||
cfpLoadingBarProvider.includeSpinner = false;
|
||||
cfpLoadingBarProvider.parentSelector = 'header';
|
||||
$locationProvider.html5Mode(true);
|
||||
var a = window.location.host.split('.')[0];
|
||||
//var a = window.location.host.split('.')[0];
|
||||
$routeProvider
|
||||
.when('/',{ template: '<an-home></an-home>'})
|
||||
.when('/catalog2', { redirectTo: '/catalog'})
|
||||
@ -15,15 +15,17 @@ angular.
|
||||
.when('/catalog/:slug', {
|
||||
template: '<an-detail></an-detail>'
|
||||
})
|
||||
.when('/info', {template: '<an-info></an-info>'})
|
||||
//.when('/info', {template: '<an-info></an-info>'})
|
||||
.when('/:slug',{template: '<an-content></an-content>'})
|
||||
.otherwise({ redirectTo: '/'});
|
||||
|
||||
}
|
||||
]).
|
||||
run(function($rootScope) {
|
||||
run(function($rootScope,$http,$routeParams,gettextCatalog) {
|
||||
$rootScope.$on('$stateChangeStart',
|
||||
function(event,toState,toParams,fromState,fromParams) { console.log('statechangestart'); });
|
||||
$rootScope.lanEs = "";
|
||||
$rootScope.lanEu = "";
|
||||
$rootScope.loading = false;
|
||||
$rootScope.startLoading = function() {
|
||||
console.log('start');
|
||||
@ -31,4 +33,14 @@ angular.
|
||||
$rootScope.stopLoading = function() {
|
||||
console.log('stop');
|
||||
}
|
||||
//gettextCatalog.setCurrentLanguage('eu_ES');
|
||||
gettextCatalog.debug = true;
|
||||
|
||||
/*$http.get('wp-json/anorgatarrak/v1/link/'+window.location.pathname).then(function(res) {
|
||||
data = res.data;
|
||||
console.log(data);
|
||||
jQuery('#lan_link_eus').attr('href',data[1][1]);
|
||||
jQuery('#lan_link_es').attr('href',data[0][1]);
|
||||
});*/
|
||||
|
||||
});
|
||||
|
@ -1,3 +1,3 @@
|
||||
angular.module('catalog', [
|
||||
'ngRoute','angular-loading-bar']);
|
||||
'ngRoute','angular-loading-bar','gettext']);
|
||||
|
||||
|
@ -2,12 +2,18 @@ angular.
|
||||
module('item').
|
||||
component('anDetail', {
|
||||
templateUrl: localized.partials + '/item-detail.template.html',
|
||||
controller: function($scope, $http, $routeParams, $sce, SubdomainService) {
|
||||
controller: function($scope, $rootScope, $http, $routeParams, $sce, SubdomainService, gettextCatalog) {
|
||||
//console.log($routeParams.slug);
|
||||
$scope.lang = SubdomainService.subdomain;
|
||||
console.log($scope.lang);
|
||||
if ($scope.lang=='eus') { gettextCatalog.setCurrentLanguage('eu_ES');}
|
||||
//else { gettextCatalog.setCurrentLanguage('es');}
|
||||
$http.get('wp-json/wp/v2/entrevista/?slug='+$routeParams.slug).then(function(res) {
|
||||
console.log(res.data[0]);
|
||||
$scope.post = res.data[0];
|
||||
$rootScope.lanEs = $scope.post.link_es;
|
||||
$rootScope.lanEu = $scope.post.link_eu;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
angular.module('item',['ngRoute']);
|
||||
|
||||
angular.module('item').factory('SubdomainService', [
|
||||
'$location', function($location) {
|
||||
var service = {};
|
||||
|
@ -116,3 +116,9 @@ h2 {font-weight:bold; color: rgba(255,153,51.255);}
|
||||
}
|
||||
|
||||
div.post-header div.row { background:rgba(0,0,0,0.8);}
|
||||
|
||||
li.anor-list-items { width:100%;float:right;}
|
||||
li.anor-list-items ul {list-style:none;}
|
||||
li.anor-list-items ul li {float:left;margin:2px;}
|
||||
|
||||
.lan_link { cursor:pointer;}
|
||||
|
@ -19,6 +19,8 @@ function anorgatarrak_scripts() {
|
||||
wp_enqueue_script('angularjs-route', get_template_directory_uri() .'/node_modules/angular-route/angular-route.js');
|
||||
wp_enqueue_script('angularjs-sanitize', get_stylesheet_directory_uri() . '/node_modules/angular-sanitize/angular-sanitize.min.js');
|
||||
wp_enqueue_script('angular-loading-bar', get_stylesheet_directory_uri() . '/node_modules/angular-loading-bar/src/loading-bar.js');
|
||||
wp_enqueue_script('angular-gettext', get_template_directory_uri() . '/node_modules/angular-gettext/dist/angular-gettext.min.js');
|
||||
wp_enqueue_script('angular-translation', get_template_directory_uri() . '/src/js/translations.js');
|
||||
wp_enqueue_script('anorgatarrak', get_template_directory_uri() .'/app/anorgatarrak.js');
|
||||
wp_enqueue_script('catalog-module', get_template_directory_uri() .'/app/catalog/catalog.module.js');
|
||||
wp_enqueue_script('catalog-config', get_template_directory_uri() .'/app/catalog/catalog.config.js');
|
||||
@ -81,6 +83,9 @@ function my_rest_prepare_slideshow($data,$post,$request) {
|
||||
$thumbnail = wp_get_attachment_image_src ($thumbnail_id,'full',false);
|
||||
$_data['featured_image_thumbnail_url'] = $thumbnail[0];
|
||||
$_data['excerpt_clean'] = strip_tags(get_the_excerpt($post->ID));
|
||||
$_data['link_eu'] = str_replace('http://es.','http://',get_permalink(pll_get_post($post->ID,'eu')));
|
||||
$_data['link_es'] = str_replace('http://','http://es.',get_permalink(pll_get_post($post->ID,'es')));
|
||||
//$data = array(array('es',get_permalink(pll_get_post($id,'es'))),array('eus',get_permalink(pll_get_post($id,'eu'))));
|
||||
$data->data = $_data;
|
||||
return $data;
|
||||
}
|
||||
@ -99,6 +104,9 @@ function my_rest_prepare_entrevista($data,$post,$request) {
|
||||
$_data['e_audiovisual'] = get_field('audiovisual',$post->ID);
|
||||
$_data['e_transcripcion'] = get_field('transcripcion',$post->ID);
|
||||
$_data['e_fecha_de_entrevista'] = get_field('fecha_de_entrevista',$post->ID);
|
||||
$find = array('http://','https://');
|
||||
$_data['link_eu'] = str_replace('http://es.','http://',get_permalink(pll_get_post($post->ID,'eu')));
|
||||
$_data['link_es'] = str_replace($find,'http://es.',get_permalink(pll_get_post($post->ID,'es')));
|
||||
$_data['e_localizacion'] = get_field('lugar',$post->ID);
|
||||
$data->data = $_data;
|
||||
return $data;
|
||||
@ -119,6 +127,17 @@ function remove_menus(){
|
||||
remove_menu_page( 'edit.php' ); //Posts
|
||||
}
|
||||
|
||||
function anorgatarrak_get_lan_id(WP_REST_Request $request) {
|
||||
$url = $request['url'];
|
||||
$id = url_to_postid($url);
|
||||
$data = array(array('es',get_permalink(pll_get_post($id,'es'))),array('eus',get_permalink(pll_get_post($id,'eu'))));
|
||||
$response = new WP_REST_Response( $data );
|
||||
// $postid = url_to_postid( $url );
|
||||
// https://developer.wordpress.org/reference/functions/register_rest_route/
|
||||
// get_page_by_path()
|
||||
// return new WP_Error( 'no_author', 'Invalid author', array( 'status' => 404 ) );
|
||||
return $response;
|
||||
}
|
||||
|
||||
function create_anorgatarrak_tesaurus() {
|
||||
register_taxonomy(
|
||||
@ -184,4 +203,11 @@ function my_acf_google_map_api( $api ){
|
||||
|
||||
add_filter('acf/fields/google_map/api', 'my_acf_google_map_api');
|
||||
|
||||
add_action( 'rest_api_init', function () {
|
||||
register_rest_route( 'anorgatarrak/v1', '/link/(?P<url>[a-zA-Z0-9-]+)', array(
|
||||
'methods' => 'GET',
|
||||
'callback' => 'anorgatarrak_get_lan_id',
|
||||
) );
|
||||
} );
|
||||
|
||||
?>
|
||||
|
12
index.php
12
index.php
@ -37,12 +37,9 @@
|
||||
<li class="breadcrumb-item active">Entrevista a Kontxi y María Dolores Elizegi</li>
|
||||
</ol>
|
||||
</header>
|
||||
<div class="" style="float:right;margin-right:30px;position:absolute;z-index:100;right:30px;">
|
||||
<ul class="nav navbar-nav navbar-right" style="background:rgba(255,153,51,255);">
|
||||
<li><a style="color:#000;" href="http://anorgatarrak.eus">EUS</a></li>
|
||||
<li><a style="color:#000;" href="http://es.anorgatarrak.eus">ESP</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="" style="float:right;margin-right:30px;position:absolute;z-index:100;right:30px;">
|
||||
<an-language></an-language>
|
||||
</div>
|
||||
<!-- <an-list></an-list> -->
|
||||
<div ng-view style="padding-bottom:0px;"></div>
|
||||
|
||||
@ -53,7 +50,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php //if (is_front_page() ) :?>
|
||||
<!-- front-page -->
|
||||
<div class="container" style="padding:30px 0;" ng-hide>
|
||||
<div class="row">
|
||||
@ -76,8 +72,6 @@ $args = array (
|
||||
</a>
|
||||
<?php echo $page->post_excerpt; ?>
|
||||
</div>
|
||||
<!-- <div class="col-md-4"><h2>Entrevistas del proyecto</h2><p>This example is a quick exercise to illustrate how the default, static and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device. To see the difference between static and fixed top navbars, just scroll.</p><p><a class="btn" ng-href="#!/catalog/">Mostrar más</a></p></div>
|
||||
<div class="col-md-4"><h2>Información relevante</h2><p>This example is a quick exercise to illustrate how the default, static and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device. To see the difference between static and fixed top navbars, just scroll.</p><p><a class="btn" ng-href="#!/contact">Mostrar más</a></p></div>-->
|
||||
<?php endforeach; ?>
|
||||
</div> <!-- row -->
|
||||
</div><!-- container -->
|
||||
|
22
m.pot
Normal file
22
m.pot
Normal file
@ -0,0 +1,22 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-02-15 20:19+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: functions.php:139
|
||||
msgid "Etapas del proyecto"
|
||||
msgstr ""
|
1
node_modules/.bin/babylon
generated
vendored
Symbolic link
1
node_modules/.bin/babylon
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../babylon/bin/babylon.js
|
1
node_modules/.bin/cake
generated
vendored
Symbolic link
1
node_modules/.bin/cake
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../coffeescript/bin/cake
|
1
node_modules/.bin/coffee
generated
vendored
Symbolic link
1
node_modules/.bin/coffee
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../coffeescript/bin/coffee
|
1
node_modules/.bin/dateformat
generated
vendored
Symbolic link
1
node_modules/.bin/dateformat
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../dateformat/bin/cli.js
|
1
node_modules/.bin/esparse
generated
vendored
Symbolic link
1
node_modules/.bin/esparse
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../esprima/bin/esparse.js
|
1
node_modules/.bin/esvalidate
generated
vendored
Symbolic link
1
node_modules/.bin/esvalidate
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../esprima/bin/esvalidate.js
|
1
node_modules/.bin/grunt
generated
vendored
Symbolic link
1
node_modules/.bin/grunt
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../grunt/bin/grunt
|
1
node_modules/.bin/js-yaml
generated
vendored
Symbolic link
1
node_modules/.bin/js-yaml
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../js-yaml/bin/js-yaml.js
|
1
node_modules/.bin/nopt
generated
vendored
Symbolic link
1
node_modules/.bin/nopt
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../nopt/bin/nopt.js
|
1
node_modules/.bin/rimraf
generated
vendored
Symbolic link
1
node_modules/.bin/rimraf
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../rimraf/bin.js
|
1
node_modules/.bin/semver
generated
vendored
Symbolic link
1
node_modules/.bin/semver
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../semver/bin/semver
|
1
node_modules/.bin/strip-indent
generated
vendored
Symbolic link
1
node_modules/.bin/strip-indent
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../strip-indent/cli.js
|
1
node_modules/.bin/tsc
generated
vendored
Symbolic link
1
node_modules/.bin/tsc
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../typescript/bin/tsc
|
1
node_modules/.bin/tsserver
generated
vendored
Symbolic link
1
node_modules/.bin/tsserver
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../typescript/bin/tsserver
|
1
node_modules/.bin/which
generated
vendored
Symbolic link
1
node_modules/.bin/which
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
||||
../which/bin/which
|
46
node_modules/abbrev/LICENSE
generated
vendored
Normal file
46
node_modules/abbrev/LICENSE
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
This software is dual-licensed under the ISC and MIT licenses.
|
||||
You may use this software under EITHER of the following licenses.
|
||||
|
||||
----------
|
||||
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
----------
|
||||
|
||||
Copyright Isaac Z. Schlueter and Contributors
|
||||
All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
23
node_modules/abbrev/README.md
generated
vendored
Normal file
23
node_modules/abbrev/README.md
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
# abbrev-js
|
||||
|
||||
Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).
|
||||
|
||||
Usage:
|
||||
|
||||
var abbrev = require("abbrev");
|
||||
abbrev("foo", "fool", "folding", "flop");
|
||||
|
||||
// returns:
|
||||
{ fl: 'flop'
|
||||
, flo: 'flop'
|
||||
, flop: 'flop'
|
||||
, fol: 'folding'
|
||||
, fold: 'folding'
|
||||
, foldi: 'folding'
|
||||
, foldin: 'folding'
|
||||
, folding: 'folding'
|
||||
, foo: 'foo'
|
||||
, fool: 'fool'
|
||||
}
|
||||
|
||||
This is handy for command-line scripts, or other cases where you want to be able to accept shorthands.
|
61
node_modules/abbrev/abbrev.js
generated
vendored
Normal file
61
node_modules/abbrev/abbrev.js
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
module.exports = exports = abbrev.abbrev = abbrev
|
||||
|
||||
abbrev.monkeyPatch = monkeyPatch
|
||||
|
||||
function monkeyPatch () {
|
||||
Object.defineProperty(Array.prototype, 'abbrev', {
|
||||
value: function () { return abbrev(this) },
|
||||
enumerable: false, configurable: true, writable: true
|
||||
})
|
||||
|
||||
Object.defineProperty(Object.prototype, 'abbrev', {
|
||||
value: function () { return abbrev(Object.keys(this)) },
|
||||
enumerable: false, configurable: true, writable: true
|
||||
})
|
||||
}
|
||||
|
||||
function abbrev (list) {
|
||||
if (arguments.length !== 1 || !Array.isArray(list)) {
|
||||
list = Array.prototype.slice.call(arguments, 0)
|
||||
}
|
||||
for (var i = 0, l = list.length, args = [] ; i < l ; i ++) {
|
||||
args[i] = typeof list[i] === "string" ? list[i] : String(list[i])
|
||||
}
|
||||
|
||||
// sort them lexicographically, so that they're next to their nearest kin
|
||||
args = args.sort(lexSort)
|
||||
|
||||
// walk through each, seeing how much it has in common with the next and previous
|
||||
var abbrevs = {}
|
||||
, prev = ""
|
||||
for (var i = 0, l = args.length ; i < l ; i ++) {
|
||||
var current = args[i]
|
||||
, next = args[i + 1] || ""
|
||||
, nextMatches = true
|
||||
, prevMatches = true
|
||||
if (current === next) continue
|
||||
for (var j = 0, cl = current.length ; j < cl ; j ++) {
|
||||
var curChar = current.charAt(j)
|
||||
nextMatches = nextMatches && curChar === next.charAt(j)
|
||||
prevMatches = prevMatches && curChar === prev.charAt(j)
|
||||
if (!nextMatches && !prevMatches) {
|
||||
j ++
|
||||
break
|
||||
}
|
||||
}
|
||||
prev = current
|
||||
if (j === cl) {
|
||||
abbrevs[current] = current
|
||||
continue
|
||||
}
|
||||
for (var a = current.substr(0, j) ; j <= cl ; j ++) {
|
||||
abbrevs[a] = current
|
||||
a += current.charAt(j)
|
||||
}
|
||||
}
|
||||
return abbrevs
|
||||
}
|
||||
|
||||
function lexSort (a, b) {
|
||||
return a === b ? 0 : a > b ? 1 : -1
|
||||
}
|
56
node_modules/abbrev/package.json
generated
vendored
Normal file
56
node_modules/abbrev/package.json
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
{
|
||||
"_from": "abbrev@1",
|
||||
"_id": "abbrev@1.1.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
|
||||
"_location": "/abbrev",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "abbrev@1",
|
||||
"name": "abbrev",
|
||||
"escapedName": "abbrev",
|
||||
"rawSpec": "1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/nopt"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
|
||||
"_shasum": "f8f2c887ad10bf67f634f005b6987fed3179aac8",
|
||||
"_spec": "abbrev@1",
|
||||
"_where": "/home/lrullo/httpdocs/anorgatarrak.eus/wp-content/themes/anorgatarrak/node_modules/nopt",
|
||||
"author": {
|
||||
"name": "Isaac Z. Schlueter",
|
||||
"email": "i@izs.me"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/isaacs/abbrev-js/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Like ruby's abbrev module, but in js",
|
||||
"devDependencies": {
|
||||
"tap": "^10.1"
|
||||
},
|
||||
"files": [
|
||||
"abbrev.js"
|
||||
],
|
||||
"homepage": "https://github.com/isaacs/abbrev-js#readme",
|
||||
"license": "ISC",
|
||||
"main": "abbrev.js",
|
||||
"name": "abbrev",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/isaacs/abbrev-js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postpublish": "git push origin --all; git push origin --tags",
|
||||
"postversion": "npm publish",
|
||||
"preversion": "npm test",
|
||||
"test": "tap test.js --100"
|
||||
},
|
||||
"version": "1.1.1"
|
||||
}
|
36
node_modules/angular-gettext-tools/.jscs.json
generated
vendored
Normal file
36
node_modules/angular-gettext-tools/.jscs.json
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
|
||||
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
|
||||
"requireParenthesesAroundIIFE": true,
|
||||
"requireSpacesInFunctionExpression": {
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"requireSpacesInAnonymousFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowSpacesInNamedFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowSpacesInFunctionDeclaration": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowMixedSpacesAndTabs": true,
|
||||
"disallowMultipleVarDecl": true,
|
||||
"requireSpacesInsideObjectBrackets": "all",
|
||||
"disallowDanglingUnderscores": true,
|
||||
"disallowSpaceAfterObjectKeys": true,
|
||||
"requireCommaBeforeLineBreak": true,
|
||||
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
|
||||
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
|
||||
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
|
||||
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
|
||||
"requireSpacesInConditionalExpression": true,
|
||||
"validateQuoteMarks": { "mark": true, "escape": true },
|
||||
"validateIndentation": 4,
|
||||
"disallowTrailingWhitespace": true,
|
||||
"disallowKeywordsOnNewLine": ["else"],
|
||||
"requireCapitalizedConstructors": true,
|
||||
"safeContextKeyword": "self",
|
||||
"requireDotNotation": true,
|
||||
"disallowYodaConditions": true
|
||||
}
|
26
node_modules/angular-gettext-tools/.jshintrc
generated
vendored
Normal file
26
node_modules/angular-gettext-tools/.jshintrc
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"immed": true,
|
||||
"latedef": true,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"sub": true,
|
||||
"undef": true,
|
||||
"boss": true,
|
||||
"eqnull": true,
|
||||
"node": true,
|
||||
"strict": true,
|
||||
"white": true,
|
||||
"indent": 4,
|
||||
"predef": [
|
||||
"$",
|
||||
"angular",
|
||||
"describe",
|
||||
"it",
|
||||
"before",
|
||||
"beforeEach",
|
||||
"after",
|
||||
"afterEach"
|
||||
]
|
||||
}
|
7
node_modules/angular-gettext-tools/.travis.yml
generated
vendored
Normal file
7
node_modules/angular-gettext-tools/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
sudo: false
|
||||
language: node_js
|
||||
node_js:
|
||||
- "node"
|
||||
|
||||
before_script:
|
||||
- npm install -g grunt-cli
|
59
node_modules/angular-gettext-tools/Gruntfile.js
generated
vendored
Normal file
59
node_modules/angular-gettext-tools/Gruntfile.js
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
module.exports = function (grunt) {
|
||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-jscs');
|
||||
grunt.loadNpmTasks('grunt-mocha-cli');
|
||||
grunt.loadNpmTasks('grunt-bump');
|
||||
|
||||
grunt.initConfig({
|
||||
jshint: {
|
||||
all: ['{lib,test}/**/*.js', 'index.js', '!test/fixtures/*.js'],
|
||||
options: {
|
||||
jshintrc: '.jshintrc'
|
||||
}
|
||||
},
|
||||
|
||||
jscs: {
|
||||
src: {
|
||||
options: {
|
||||
config: '.jscs.json'
|
||||
},
|
||||
files: {
|
||||
src: ['*.js', '{lib,test}/**/*.js', '!test/fixtures/*.js']
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
clean: {
|
||||
tmp: ['tmp']
|
||||
},
|
||||
|
||||
watch: {
|
||||
test: {
|
||||
files: ['lib/**.js', 'test/**/*.{js,coffee}'],
|
||||
tasks: ['test']
|
||||
}
|
||||
},
|
||||
|
||||
mochacli: {
|
||||
spec: {
|
||||
options: {
|
||||
reporter: 'spec'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
bump: {
|
||||
options: {
|
||||
files: ['package.json'],
|
||||
commitFiles: ['-a'],
|
||||
pushTo: 'origin'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
grunt.registerTask('default', ['test']);
|
||||
grunt.registerTask('build', ['clean', 'jshint', 'jscs']);
|
||||
grunt.registerTask('test', ['build', 'mochacli']);
|
||||
};
|
22
node_modules/angular-gettext-tools/LICENSE
generated
vendored
Normal file
22
node_modules/angular-gettext-tools/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
Copyright (c) 2013-2015 Ruben Vermeersch
|
||||
|
||||
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.
|
63
node_modules/angular-gettext-tools/README.md
generated
vendored
Normal file
63
node_modules/angular-gettext-tools/README.md
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
# angular-gettext-tools
|
||||
|
||||
> Tools for extracting/compiling angular-gettext strings.
|
||||
|
||||
Used to construct build tools for [`angular-gettext`](https://github.com/rubenv/angular-gettext).
|
||||
|
||||
[![Build Status](https://travis-ci.org/rubenv/grunt-angular-gettext.png?branch=master)](https://travis-ci.org/rubenv/angular-gettext-tools)
|
||||
|
||||
Implementations:
|
||||
|
||||
* [Grunt plugin](https://github.com/rubenv/grunt-angular-gettext)
|
||||
* [Gulp plugin](https://github.com/gabegorelick/gulp-angular-gettext)
|
||||
* [CLI utility](https://github.com/huston007/angular-gettext-cli)
|
||||
* [Webpack loader (compilation)](https://github.com/princed/angular-gettext-loader)
|
||||
* [Webpack plugin (compilation and extraction)](https://github.com/augusto-altman/angular-gettext-plugin)
|
||||
|
||||
Check the website for usage instructions: [http://angular-gettext.rocketeer.be/](http://angular-gettext.rocketeer.be/).
|
||||
|
||||
## Options
|
||||
|
||||
All options and defaults are displayed below:
|
||||
|
||||
```JSON
|
||||
{
|
||||
"startDelim": "{{",
|
||||
"endDelim": "}}",
|
||||
"markerName": "gettext",
|
||||
"markerNames": [],
|
||||
"moduleName": "gettextCatalog",
|
||||
"moduleMethodString": "getString",
|
||||
"moduleMethodPlural": "getPlural",
|
||||
"attribute": "translate",
|
||||
"attributes": [],
|
||||
"lineNumbers": true,
|
||||
"format": "javascript",
|
||||
"defaultLanguage": false,
|
||||
"requirejs": false
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (C) 2013-2015 by Ruben Vermeersch <ruben@rocketeer.be>
|
||||
|
||||
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.
|
4
node_modules/angular-gettext-tools/index.js
generated
vendored
Normal file
4
node_modules/angular-gettext-tools/index.js
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
module.exports = {
|
||||
Compiler: require('./lib/compile'),
|
||||
Extractor: require('./lib/extract')
|
||||
};
|
162
node_modules/angular-gettext-tools/lib/compile.js
generated
vendored
Normal file
162
node_modules/angular-gettext-tools/lib/compile.js
generated
vendored
Normal file
@ -0,0 +1,162 @@
|
||||
'use strict';
|
||||
|
||||
var po = require('pofile');
|
||||
var _ = require('lodash');
|
||||
|
||||
var formats = {
|
||||
javascript: {
|
||||
addLocale: function (locale, strings) {
|
||||
return ' gettextCatalog.setStrings(\'' + locale + '\', ' + JSON.stringify(strings) + ');\n';
|
||||
},
|
||||
format: function (locales, options) {
|
||||
var angular = 'angular';
|
||||
if (options.browserify) {
|
||||
angular = 'require(\'angular\')';
|
||||
}
|
||||
var module = angular + '.module(\'' + options.module + '\')' +
|
||||
'.run([\'gettextCatalog\', function (gettextCatalog) {\n' +
|
||||
'/* jshint -W100 */\n' +
|
||||
locales.join('') +
|
||||
'/* jshint +W100 */\n';
|
||||
if (options.defaultLanguage) {
|
||||
module += 'gettextCatalog.currentLanguage = \'' + options.defaultLanguage + '\';\n';
|
||||
}
|
||||
module += '}]);';
|
||||
|
||||
if (options.requirejs) {
|
||||
return 'define([\'angular\', \'' + options.modulePath + '\'], function (angular) {\n' + module + '\n});';
|
||||
}
|
||||
|
||||
return module;
|
||||
}
|
||||
},
|
||||
json: {
|
||||
addLocale: function (locale, strings) {
|
||||
return {
|
||||
name: locale,
|
||||
strings: strings
|
||||
};
|
||||
},
|
||||
format: function (locales, options) {
|
||||
var result = {};
|
||||
locales.forEach(function (locale) {
|
||||
if (!result[locale.name]) {
|
||||
result[locale.name] = {};
|
||||
}
|
||||
_.assign(result[locale.name], locale.strings);
|
||||
});
|
||||
return JSON.stringify(result);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var noContext = '$$noContext';
|
||||
|
||||
var Compiler = (function () {
|
||||
function Compiler(options) {
|
||||
this.options = _.extend({
|
||||
format: 'javascript',
|
||||
module: 'gettext'
|
||||
}, options);
|
||||
}
|
||||
|
||||
Compiler.browserConvertedHTMLEntities = {
|
||||
'hellip': '…',
|
||||
'cent': '¢',
|
||||
'pound': '£',
|
||||
'euro': '€',
|
||||
'laquo': '«',
|
||||
'raquo': '»',
|
||||
'rsaquo': '›',
|
||||
'lsaquo': '‹',
|
||||
'copy': '©',
|
||||
'reg': '®',
|
||||
'trade': '™',
|
||||
'sect': '§',
|
||||
'deg': '°',
|
||||
'plusmn': '±',
|
||||
'para': '¶',
|
||||
'middot': '·',
|
||||
'ndash': '–',
|
||||
'mdash': '—',
|
||||
'lsquo': '‘',
|
||||
'rsquo': '’',
|
||||
'sbquo': '‚',
|
||||
'ldquo': '“',
|
||||
'rdquo': '”',
|
||||
'bdquo': '„',
|
||||
'dagger': '†',
|
||||
'Dagger': '‡',
|
||||
'bull': '•',
|
||||
'prime': '′',
|
||||
'Prime': '″',
|
||||
'asymp': '≈',
|
||||
'ne': '≠',
|
||||
'le': '≤',
|
||||
'ge': '≥',
|
||||
'sup2': '²',
|
||||
'sup3': '³',
|
||||
'frac12': '½',
|
||||
'frac14': '¼',
|
||||
'frac13': '⅓',
|
||||
'frac34': '¾'
|
||||
};
|
||||
|
||||
Compiler.hasFormat = function (format) {
|
||||
return formats.hasOwnProperty(format);
|
||||
};
|
||||
|
||||
Compiler.prototype.convertPo = function (inputs) {
|
||||
var format = formats[this.options.format];
|
||||
var locales = [];
|
||||
|
||||
inputs.forEach(function (input) {
|
||||
var catalog = po.parse(input);
|
||||
|
||||
if (!catalog.headers.Language) {
|
||||
throw new Error('No Language header found!');
|
||||
}
|
||||
|
||||
var strings = {};
|
||||
for (var i = 0; i < catalog.items.length; i++) {
|
||||
var item = catalog.items[i];
|
||||
var ctx = item.msgctxt || noContext;
|
||||
var msgid = item.msgid;
|
||||
|
||||
var convertedEntity;
|
||||
var unconvertedEntity;
|
||||
var unconvertedEntityPattern;
|
||||
|
||||
for ( unconvertedEntity in Compiler.browserConvertedHTMLEntities ) {
|
||||
convertedEntity = Compiler.browserConvertedHTMLEntities[ unconvertedEntity ];
|
||||
unconvertedEntityPattern = new RegExp( '&' + unconvertedEntity + ';?', 'g' );
|
||||
msgid = msgid.replace( unconvertedEntityPattern, convertedEntity );
|
||||
}
|
||||
|
||||
if (item.msgstr[0].length > 0 && !item.flags.fuzzy && !item.obsolete) {
|
||||
if (!strings[msgid]) {
|
||||
strings[msgid] = {};
|
||||
}
|
||||
|
||||
// Add array for plural, single string for signular.
|
||||
strings[msgid][ctx] = item.msgstr.length === 1 ? item.msgstr[0] : item.msgstr;
|
||||
}
|
||||
}
|
||||
|
||||
// Strip context from strings that have no context.
|
||||
for (var key in strings) {
|
||||
if (Object.keys(strings[key]).length === 1 && strings[key][noContext]) {
|
||||
strings[key] = strings[key][noContext];
|
||||
}
|
||||
}
|
||||
|
||||
locales.push(format.addLocale(catalog.headers.Language, strings));
|
||||
});
|
||||
|
||||
return format.format(locales, this.options);
|
||||
};
|
||||
|
||||
return Compiler;
|
||||
})();
|
||||
|
||||
module.exports = Compiler;
|
486
node_modules/angular-gettext-tools/lib/extract.js
generated
vendored
Normal file
486
node_modules/angular-gettext-tools/lib/extract.js
generated
vendored
Normal file
@ -0,0 +1,486 @@
|
||||
'use strict';
|
||||
|
||||
var cheerio = require('cheerio');
|
||||
var Po = require('pofile');
|
||||
var babylon = require('babylon');
|
||||
var tsParser = require('typescript-eslint-parser');
|
||||
var search = require('binary-search');
|
||||
var _ = require('lodash');
|
||||
|
||||
var escapeRegex = /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;
|
||||
var noContext = '$$noContext';
|
||||
|
||||
function mkAttrRegex(startDelim, endDelim, attribute) {
|
||||
var start = startDelim.replace(escapeRegex, '\\$&');
|
||||
var end = endDelim.replace(escapeRegex, '\\$&');
|
||||
|
||||
if (start === '' && end === '') {
|
||||
start = '^';
|
||||
} else {
|
||||
// match optional :: (Angular 1.3's bind once syntax) without capturing
|
||||
start += '(?:\\s*\\:\\:\\s*)?';
|
||||
}
|
||||
|
||||
if (!_.isString(attribute) || attribute.length === 0) {
|
||||
attribute = 'translate';
|
||||
}
|
||||
|
||||
return new RegExp(start + '\\s*(\'|"|"|')(.*?)\\1\\s*\\|\\s*' + attribute + '\\s*:?\\s?(?:(\'|"|"|')\\s*(.*?)\\3)?\\s*(?:' + end + '|\\|)', 'g');
|
||||
}
|
||||
|
||||
function stringCompare(a, b) {
|
||||
return a === b ? 0 : a > b ? 1 : -1;
|
||||
}
|
||||
|
||||
function contextCompare(a, b) {
|
||||
if (a !== null && b === null) {
|
||||
return -1;
|
||||
} else if (a === null && b !== null) {
|
||||
return 1;
|
||||
}
|
||||
return stringCompare(a, b);
|
||||
}
|
||||
|
||||
function comments2String(comments) {
|
||||
return comments.join(', ');
|
||||
}
|
||||
|
||||
function walkJs(node, fn, parentComment) {
|
||||
fn(node, parentComment);
|
||||
|
||||
// Handle ts comments
|
||||
if (node && node.comments) {
|
||||
parentComment = node;
|
||||
parentComment.comments.reverse();
|
||||
}
|
||||
|
||||
for (var key in node) {
|
||||
var obj = node[key];
|
||||
if (node && node.leadingComments) {
|
||||
parentComment = node;
|
||||
}
|
||||
|
||||
if (typeof obj === 'object') {
|
||||
walkJs(obj, fn, parentComment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function isStringLiteral(node) {
|
||||
return node.type === 'StringLiteral' || (node.type === 'Literal' && typeof(node.value) === 'string');
|
||||
}
|
||||
|
||||
function getJSExpression(node) {
|
||||
var res = '';
|
||||
if (isStringLiteral(node)) {
|
||||
res = node.value;
|
||||
}
|
||||
|
||||
if (node.type === 'TemplateLiteral') {
|
||||
node.quasis.forEach(function (elem) {
|
||||
res += elem.value.raw;
|
||||
});
|
||||
}
|
||||
|
||||
if (node.type === 'BinaryExpression' && node.operator === '+') {
|
||||
res += getJSExpression(node.left);
|
||||
res += getJSExpression(node.right);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
var Extractor = (function () {
|
||||
function Extractor(options) {
|
||||
this.options = _.extend({
|
||||
startDelim: '{{',
|
||||
endDelim: '}}',
|
||||
markerName: 'gettext',
|
||||
markerNames: [],
|
||||
moduleName: 'gettextCatalog',
|
||||
moduleMethodString: 'getString',
|
||||
moduleMethodPlural: 'getPlural',
|
||||
attribute: 'translate',
|
||||
attributes: [],
|
||||
lineNumbers: true,
|
||||
extensions: {
|
||||
htm: 'html',
|
||||
html: 'html',
|
||||
php: 'html',
|
||||
phtml: 'html',
|
||||
tml: 'html',
|
||||
ejs: 'html',
|
||||
erb: 'html',
|
||||
js: 'js',
|
||||
tag: 'html',
|
||||
jsp: 'html',
|
||||
ts: 'js',
|
||||
tsx: 'js',
|
||||
},
|
||||
postProcess: function (po) {}
|
||||
}, options);
|
||||
this.options.markerNames.unshift(this.options.markerName);
|
||||
this.options.attributes.unshift(this.options.attribute);
|
||||
|
||||
this.strings = {};
|
||||
this.attrRegex = mkAttrRegex(this.options.startDelim, this.options.endDelim, this.options.attribute);
|
||||
this.noDelimRegex = mkAttrRegex('', '', this.options.attribute);
|
||||
}
|
||||
|
||||
Extractor.isValidStrategy = function (strategy) {
|
||||
return strategy === 'html' || strategy === 'js';
|
||||
};
|
||||
|
||||
Extractor.mkAttrRegex = mkAttrRegex;
|
||||
|
||||
Extractor.prototype.addString = function (reference, string, plural, extractedComment, context) {
|
||||
// maintain backwards compatibility
|
||||
if (_.isString(reference)) {
|
||||
reference = { file: reference };
|
||||
}
|
||||
|
||||
string = string.trim();
|
||||
|
||||
if (string.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!context) {
|
||||
context = noContext;
|
||||
}
|
||||
|
||||
if (!this.strings[string]) {
|
||||
this.strings[string] = {};
|
||||
}
|
||||
|
||||
if (!this.strings[string][context]) {
|
||||
this.strings[string][context] = new Po.Item();
|
||||
}
|
||||
|
||||
var item = this.strings[string][context];
|
||||
item.msgid = string;
|
||||
|
||||
var refString = reference.file;
|
||||
if (this.options.lineNumbers && reference.location && reference.location.start) {
|
||||
var line = reference.location.start.line;
|
||||
if (line || line === 0) {
|
||||
refString += ':' + reference.location.start.line;
|
||||
}
|
||||
}
|
||||
var refIndex = search(item.references, refString, stringCompare);
|
||||
if (refIndex < 0) { // don't add duplicate references
|
||||
// when not found, binary-search returns -(index_where_it_should_be + 1)
|
||||
item.references.splice(Math.abs(refIndex + 1), 0, refString);
|
||||
}
|
||||
|
||||
if (context !== noContext) {
|
||||
item.msgctxt = context;
|
||||
}
|
||||
|
||||
if (plural && plural !== '') {
|
||||
if (item.msgid_plural && item.msgid_plural !== plural) {
|
||||
throw new Error('Incompatible plural definitions for ' + string + ': ' + item.msgid_plural + ' / ' + plural + ' (in: ' + (item.references.join(', ')) + ')');
|
||||
}
|
||||
item.msgid_plural = plural;
|
||||
item.msgstr = ['', ''];
|
||||
}
|
||||
if (extractedComment) {
|
||||
var commentIndex = search(item.extractedComments, extractedComment, stringCompare);
|
||||
if (commentIndex < 0) { // don't add duplicate comments
|
||||
item.extractedComments.splice(Math.abs(commentIndex + 1), 0, extractedComment);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Extractor.prototype.extractJs = function (filename, src, lineNumber) {
|
||||
// used for line number of JS in HTML <script> tags
|
||||
lineNumber = lineNumber || 0;
|
||||
var self = this;
|
||||
var syntax;
|
||||
var extension = filename.split('.').pop();
|
||||
try {
|
||||
if (extension === 'ts' || extension === 'tsx') {
|
||||
syntax = tsParser.parse(src, {
|
||||
sourceType: 'module',
|
||||
comment: true,
|
||||
ecmaFeatures: {
|
||||
jsx: true
|
||||
}
|
||||
});
|
||||
} else {
|
||||
syntax = babylon.parse(src, {
|
||||
sourceType: 'module',
|
||||
plugins: [
|
||||
'jsx',
|
||||
'objectRestSpread',
|
||||
'decorators',
|
||||
'classProperties',
|
||||
'exportExtensions',
|
||||
'functionBind'
|
||||
]
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
var errMsg = 'Error parsing';
|
||||
if (filename) {
|
||||
errMsg += ' ' + filename;
|
||||
}
|
||||
if (err.lineNumber) {
|
||||
errMsg += ' at line ' + err.lineNumber;
|
||||
errMsg += ' column ' + err.column;
|
||||
}
|
||||
|
||||
console.warn(errMsg);
|
||||
return;
|
||||
}
|
||||
|
||||
function isGettext(node) {
|
||||
return node !== null &&
|
||||
node.type === 'CallExpression' &&
|
||||
node.callee !== null &&
|
||||
(self.options.markerNames.indexOf(node.callee.name) > -1 || (
|
||||
node.callee.property &&
|
||||
self.options.markerNames.indexOf(node.callee.property.name) > -1
|
||||
)) &&
|
||||
node.arguments !== null &&
|
||||
node.arguments.length;
|
||||
}
|
||||
|
||||
function isGetString(node) {
|
||||
return node !== null &&
|
||||
node.type === 'CallExpression' &&
|
||||
node.callee !== null &&
|
||||
node.callee.type === 'MemberExpression' &&
|
||||
node.callee.object !== null && (
|
||||
node.callee.object.name === self.options.moduleName || (
|
||||
// also allow gettextCatalog calls on objects like this.gettextCatalog.getString()
|
||||
node.callee.object.property &&
|
||||
node.callee.object.property.name === self.options.moduleName)) &&
|
||||
node.callee.property !== null &&
|
||||
node.callee.property.name === self.options.moduleMethodString &&
|
||||
node.arguments !== null &&
|
||||
node.arguments.length;
|
||||
}
|
||||
|
||||
function isGetPlural(node) {
|
||||
return node !== null &&
|
||||
node.type === 'CallExpression' &&
|
||||
node.callee !== null &&
|
||||
node.callee.type === 'MemberExpression' &&
|
||||
node.callee.object !== null && (
|
||||
node.callee.object.name === self.options.moduleName || (
|
||||
// also allow gettextCatalog calls on objects like this.gettextCatalog.getPlural()
|
||||
node.callee.object.property &&
|
||||
node.callee.object.property.name === self.options.moduleName)) &&
|
||||
node.callee.property !== null &&
|
||||
node.callee.property.name === self.options.moduleMethodPlural &&
|
||||
node.arguments !== null &&
|
||||
node.arguments.length;
|
||||
}
|
||||
|
||||
function isTemplateElement(node) {
|
||||
return node !== null &&
|
||||
node.type === 'TemplateElement' &&
|
||||
node.value &&
|
||||
node.value.raw;
|
||||
}
|
||||
|
||||
walkJs(syntax, function (node, parentComment) {
|
||||
var str;
|
||||
var context;
|
||||
var singular;
|
||||
var plural;
|
||||
var extractedComments = [];
|
||||
var reference = {
|
||||
file: filename,
|
||||
location: (function () {
|
||||
if (!node || !node.loc || !node.loc.start) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
start: {
|
||||
line: node.loc.start.line + lineNumber
|
||||
}
|
||||
};
|
||||
})()
|
||||
};
|
||||
|
||||
if (isGettext(node) || isGetString(node)) {
|
||||
str = getJSExpression(node.arguments[0]);
|
||||
if (node.arguments[2]) {
|
||||
context = getJSExpression(node.arguments[2]);
|
||||
}
|
||||
} else if (isGetPlural(node)) {
|
||||
singular = getJSExpression(node.arguments[1]);
|
||||
plural = getJSExpression(node.arguments[2]);
|
||||
if (node.arguments[4]) {
|
||||
context = getJSExpression(node.arguments[4]);
|
||||
}
|
||||
} else if (isTemplateElement(node)) {
|
||||
var line = reference.location && reference.location.start.line ? reference.location.start.line - 1 : 0;
|
||||
self.extractHtml(reference.file, node.value.raw, line);
|
||||
}
|
||||
if (str || singular) {
|
||||
var leadingComments = node.leadingComments || (parentComment ? parentComment.leadingComments : []);
|
||||
if (leadingComments) {
|
||||
leadingComments.forEach(function (comment) {
|
||||
if (comment.value.match(/^\/ .*/)) {
|
||||
extractedComments.push(comment.value.replace(/^\/ /, ''));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Handle ts comments
|
||||
if (parentComment.comments) {
|
||||
var commentFound = 0;
|
||||
parentComment.comments.forEach(function (comment) {
|
||||
if (comment.type === 'Line' &&
|
||||
comment.loc.start.line === (reference.location.start.line - commentFound - 1) &&
|
||||
comment.value.match(/^\/ .*/)) {
|
||||
commentFound++;
|
||||
extractedComments.push(comment.value.replace(/^\/ /, ''));
|
||||
}
|
||||
});
|
||||
extractedComments.reverse();
|
||||
}
|
||||
|
||||
if (str) {
|
||||
self.addString(reference, str, plural, comments2String(extractedComments), context);
|
||||
} else if (singular) {
|
||||
self.addString(reference, singular, plural, comments2String(extractedComments), context);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Extractor.prototype.extractHtml = function (filename, src, lineNumber) {
|
||||
var extractHtml = function (src, lineNumber) {
|
||||
var $ = cheerio.load(src, { decodeEntities: false, withStartIndices: true });
|
||||
var self = this;
|
||||
|
||||
var newlines = function (index) {
|
||||
return src.substr(0, index).match(/\n/g) || [];
|
||||
};
|
||||
var reference = function (index) {
|
||||
return {
|
||||
file: filename,
|
||||
location: {
|
||||
start: {
|
||||
line: lineNumber + newlines(index).length + 1
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
$('*').each(function (index, n) {
|
||||
var node = $(n);
|
||||
var getAttr = function (attr) {
|
||||
return node.attr(attr) || node.data(attr);
|
||||
};
|
||||
var str = node.html();
|
||||
var extracted = {};
|
||||
var possibleAttributes = self.options.attributes;
|
||||
|
||||
possibleAttributes.forEach(function (attr) {
|
||||
extracted[attr] = {
|
||||
plural: getAttr(attr + '-plural'),
|
||||
extractedComment: getAttr(attr + '-comment'),
|
||||
context: getAttr(attr + '-context')
|
||||
};
|
||||
});
|
||||
|
||||
if (n.name === 'script') {
|
||||
if (n.attribs.type === 'text/ng-template') {
|
||||
extractHtml(node.text(), newlines(n.startIndex).length);
|
||||
return;
|
||||
}
|
||||
|
||||
// In HTML5, type defaults to text/javascript.
|
||||
// In HTML4, it's required, so if it's not there, just assume it's JS
|
||||
if (!n.attribs.type || n.attribs.type === 'text/javascript') {
|
||||
self.extractJs(filename, node.text(), newlines(n.startIndex).length);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (node.is(self.options.attribute)) {
|
||||
self.addString(reference(n.startIndex), str, extracted[self.options.attribute].plural, extracted[self.options.attribute].extractedComment, extracted[self.options.attribute].context);
|
||||
return;
|
||||
}
|
||||
|
||||
for (var attr in node.attr()) {
|
||||
attr = attr.replace(/^data-/, '');
|
||||
|
||||
if (possibleAttributes.indexOf(attr) > -1) {
|
||||
var attrValue = extracted[attr];
|
||||
str = node.html(); // this shouldn't be necessary, but it is
|
||||
self.addString(reference(n.startIndex), str || getAttr(attr) || '', attrValue.plural, attrValue.extractedComment, attrValue.context);
|
||||
} else if (matches = self.noDelimRegex.exec(getAttr(attr))) {
|
||||
str = matches[2].replace(/\\\'/g, '\'');
|
||||
self.addString(reference(n.startIndex), str);
|
||||
self.noDelimRegex.lastIndex = 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var matches;
|
||||
while (matches = this.attrRegex.exec(src)) {
|
||||
var str = matches[2].replace(/\\\'/g, '\'');
|
||||
var context = matches[4] ? matches[4].replace(/\\\'/g, '\'') : null;
|
||||
this.addString(reference(matches.index), str, null, null, context);
|
||||
}
|
||||
}.bind(this);
|
||||
|
||||
extractHtml(src, lineNumber || 0);
|
||||
};
|
||||
|
||||
Extractor.prototype.isSupportedByStrategy = function (strategy, extension) {
|
||||
return (extension in this.options.extensions) && (this.options.extensions[extension] === strategy);
|
||||
};
|
||||
|
||||
Extractor.prototype.parse = function (filename, content) {
|
||||
var extension = filename.split('.').pop();
|
||||
|
||||
if (this.isSupportedByStrategy('html', extension)) {
|
||||
this.extractHtml(filename, content);
|
||||
}
|
||||
if (this.isSupportedByStrategy('js', extension)) {
|
||||
this.extractJs(filename, content);
|
||||
}
|
||||
};
|
||||
|
||||
Extractor.prototype.toString = function () {
|
||||
var catalog = new Po();
|
||||
|
||||
catalog.headers = {
|
||||
'Content-Type': 'text/plain; charset=UTF-8',
|
||||
'Content-Transfer-Encoding': '8bit',
|
||||
'Project-Id-Version': ''
|
||||
};
|
||||
|
||||
var sortedItems = [];
|
||||
for (var msgstr in this.strings) {
|
||||
var msg = this.strings[msgstr];
|
||||
var contexts = Object.keys(msg);
|
||||
for (var i = 0; i < contexts.length; i++) {
|
||||
sortedItems.push([msg[contexts[i]], i]);
|
||||
}
|
||||
}
|
||||
|
||||
sortedItems.sort(function (a, b) {
|
||||
return contextCompare(a[0].msgctxt, b[0].msgctxt) || stringCompare(a[0].msgid, b[0].msgid) || (a[1] - b[1]);
|
||||
});
|
||||
|
||||
for (var j = 0; j < sortedItems.length; j++) {
|
||||
catalog.items.push(sortedItems[j][0]);
|
||||
}
|
||||
|
||||
this.options.postProcess(catalog);
|
||||
|
||||
return catalog.toString();
|
||||
};
|
||||
|
||||
return Extractor;
|
||||
})();
|
||||
|
||||
module.exports = Extractor;
|
74
node_modules/angular-gettext-tools/package.json
generated
vendored
Normal file
74
node_modules/angular-gettext-tools/package.json
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
{
|
||||
"_from": "angular-gettext-tools@~2.3.9",
|
||||
"_id": "angular-gettext-tools@2.3.9",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-5R7guzzRpBvJloFsbDtY16PNA4xxrQvKhnbjpT74zuIXrOEy4sTz/r35BKFofrLEL4iLmVEgaUC7pYhZdW2QyQ==",
|
||||
"_location": "/angular-gettext-tools",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "angular-gettext-tools@~2.3.9",
|
||||
"name": "angular-gettext-tools",
|
||||
"escapedName": "angular-gettext-tools",
|
||||
"rawSpec": "~2.3.9",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~2.3.9"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/grunt-angular-gettext"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/angular-gettext-tools/-/angular-gettext-tools-2.3.9.tgz",
|
||||
"_shasum": "e8fd6692171b863370b6db031e6cdbf24673f102",
|
||||
"_spec": "angular-gettext-tools@~2.3.9",
|
||||
"_where": "/home/lrullo/httpdocs/anorgatarrak.eus/wp-content/themes/anorgatarrak/node_modules/grunt-angular-gettext",
|
||||
"author": {
|
||||
"name": "Ruben Vermeersch",
|
||||
"email": "ruben@rocketeer.be",
|
||||
"url": "http://rocketeer.be"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/rubenv/angular-gettext-tools/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"babylon": "^6.11.4",
|
||||
"binary-search": "^1.2.0",
|
||||
"cheerio": "~0.19.0",
|
||||
"lodash": "^4.0.0",
|
||||
"pofile": "~1.0.0",
|
||||
"typescript": "~2.3.2",
|
||||
"typescript-eslint-parser": "^3.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Tools for extracting/compiling angular-gettext strings.",
|
||||
"devDependencies": {
|
||||
"grunt": "~0.4.4",
|
||||
"grunt-bump": "0.0.13",
|
||||
"grunt-contrib-clean": "~0.6.0",
|
||||
"grunt-contrib-jshint": "~0.11.2",
|
||||
"grunt-contrib-watch": "~0.6.1",
|
||||
"grunt-jscs": "^1.8.0",
|
||||
"grunt-mocha-cli": "^1.13.1",
|
||||
"sinon": "^1.17.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10.0"
|
||||
},
|
||||
"homepage": "http://angular-gettext.rocketeer.be/",
|
||||
"keywords": [
|
||||
"angular",
|
||||
"gettext"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "angular-gettext-tools",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/rubenv/angular-gettext-tools.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "grunt test"
|
||||
},
|
||||
"version": "2.3.9"
|
||||
}
|
966
node_modules/angular-gettext-tools/yarn.lock
generated
vendored
Normal file
966
node_modules/angular-gettext-tools/yarn.lock
generated
vendored
Normal file
@ -0,0 +1,966 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
abbrev@1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
|
||||
|
||||
ansi-regex@^1.0.0, ansi-regex@^1.1.0:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-1.1.1.tgz#41c847194646375e6a1a5d10c3ca054ef9fc980d"
|
||||
|
||||
ansi-styles@^2.0.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
|
||||
|
||||
"argparse@~ 0.1.11":
|
||||
version "0.1.16"
|
||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-0.1.16.tgz#cfd01e0fbba3d6caed049fbd758d40f65196f57c"
|
||||
dependencies:
|
||||
underscore "~1.7.0"
|
||||
underscore.string "~2.4.0"
|
||||
|
||||
async@0.2.x, async@~0.2.9:
|
||||
version "0.2.10"
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1"
|
||||
|
||||
async@~0.1.22:
|
||||
version "0.1.22"
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-0.1.22.tgz#0fc1aaa088a0e3ef0ebe2d8831bab0dcf8845061"
|
||||
|
||||
babylon@^6.11.4:
|
||||
version "6.18.0"
|
||||
resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3"
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
||||
|
||||
binary-search@^1.2.0:
|
||||
version "1.3.2"
|
||||
resolved "https://registry.yarnpkg.com/binary-search/-/binary-search-1.3.2.tgz#88c9b7bd2b7221d352da78ec887f5af2549e4de2"
|
||||
|
||||
boolbase@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
|
||||
|
||||
brace-expansion@^1.0.0, brace-expansion@^1.1.7:
|
||||
version "1.1.8"
|
||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292"
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
concat-map "0.0.1"
|
||||
|
||||
chalk@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.0.0.tgz#b3cf4ed0ff5397c99c75b8f679db2f52831f96dc"
|
||||
dependencies:
|
||||
ansi-styles "^2.0.1"
|
||||
escape-string-regexp "^1.0.2"
|
||||
has-ansi "^1.0.3"
|
||||
strip-ansi "^2.0.1"
|
||||
supports-color "^1.3.0"
|
||||
|
||||
cheerio@~0.19.0:
|
||||
version "0.19.0"
|
||||
resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-0.19.0.tgz#772e7015f2ee29965096d71ea4175b75ab354925"
|
||||
dependencies:
|
||||
css-select "~1.0.0"
|
||||
dom-serializer "~0.1.0"
|
||||
entities "~1.1.1"
|
||||
htmlparser2 "~3.8.1"
|
||||
lodash "^3.2.0"
|
||||
|
||||
cli-table@~0.3.1:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.1.tgz#f53b05266a8b1a0b934b3d0821e6e2dc5914ae23"
|
||||
dependencies:
|
||||
colors "1.0.3"
|
||||
|
||||
cli@0.6.x:
|
||||
version "0.6.6"
|
||||
resolved "https://registry.yarnpkg.com/cli/-/cli-0.6.6.tgz#02ad44a380abf27adac5e6f0cdd7b043d74c53e3"
|
||||
dependencies:
|
||||
exit "0.1.2"
|
||||
glob "~ 3.2.1"
|
||||
|
||||
coffee-script@~1.3.3:
|
||||
version "1.3.3"
|
||||
resolved "https://registry.yarnpkg.com/coffee-script/-/coffee-script-1.3.3.tgz#150d6b4cb522894369efed6a2101c20bc7f4a4f4"
|
||||
|
||||
colors@0.6.x, colors@~0.6.2:
|
||||
version "0.6.2"
|
||||
resolved "https://registry.yarnpkg.com/colors/-/colors-0.6.2.tgz#2423fe6678ac0c5dae8852e5d0e5be08c997abcc"
|
||||
|
||||
colors@1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b"
|
||||
|
||||
commander@0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-0.6.1.tgz#fa68a14f6a945d54dbbe50d8cdb3320e9e3b1a06"
|
||||
|
||||
commander@2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.3.0.tgz#fd430e889832ec353b9acd1de217c11cb3eef873"
|
||||
|
||||
commander@~2.6.0:
|
||||
version "2.6.0"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.6.0.tgz#9df7e52fb2a0cb0fb89058ee80c3104225f37e1d"
|
||||
|
||||
concat-map@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||
|
||||
console-browserify@1.1.x:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10"
|
||||
dependencies:
|
||||
date-now "^0.1.4"
|
||||
|
||||
core-util-is@~1.0.0:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||
|
||||
css-select@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.0.0.tgz#b1121ca51848dd264e2244d058cee254deeb44b0"
|
||||
dependencies:
|
||||
boolbase "~1.0.0"
|
||||
css-what "1.0"
|
||||
domutils "1.4"
|
||||
nth-check "~1.0.0"
|
||||
|
||||
css-what@1.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/css-what/-/css-what-1.0.0.tgz#d7cc2df45180666f99d2b14462639469e00f736c"
|
||||
|
||||
cycle@1.0.x:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/cycle/-/cycle-1.0.3.tgz#21e80b2be8580f98b468f379430662b046c34ad2"
|
||||
|
||||
date-now@^0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b"
|
||||
|
||||
dateformat@1.0.2-1.2.3:
|
||||
version "1.0.2-1.2.3"
|
||||
resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.2-1.2.3.tgz#b0220c02de98617433b72851cf47de3df2cdbee9"
|
||||
|
||||
debug@2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-2.0.0.tgz#89bd9df6732b51256bc6705342bba02ed12131ef"
|
||||
dependencies:
|
||||
ms "0.6.2"
|
||||
|
||||
debug@~0.7.0:
|
||||
version "0.7.4"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-0.7.4.tgz#06e1ea8082c2cb14e39806e22e2f6f757f92af39"
|
||||
|
||||
deep-equal@*:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5"
|
||||
|
||||
diff@1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf"
|
||||
|
||||
dom-serializer@0, dom-serializer@~0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82"
|
||||
dependencies:
|
||||
domelementtype "~1.1.1"
|
||||
entities "~1.1.1"
|
||||
|
||||
domelementtype@1:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2"
|
||||
|
||||
domelementtype@~1.1.1:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b"
|
||||
|
||||
domhandler@2.3:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.3.0.tgz#2de59a0822d5027fabff6f032c2b25a2a8abe738"
|
||||
dependencies:
|
||||
domelementtype "1"
|
||||
|
||||
domutils@1.4:
|
||||
version "1.4.3"
|
||||
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.4.3.tgz#0865513796c6b306031850e175516baf80b72a6f"
|
||||
dependencies:
|
||||
domelementtype "1"
|
||||
|
||||
domutils@1.5:
|
||||
version "1.5.1"
|
||||
resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf"
|
||||
dependencies:
|
||||
dom-serializer "0"
|
||||
domelementtype "1"
|
||||
|
||||
entities@1.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/entities/-/entities-1.0.0.tgz#b2987aa3821347fcde642b24fdfc9e4fb712bf26"
|
||||
|
||||
entities@~1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0"
|
||||
|
||||
escape-string-regexp@1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz#4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1"
|
||||
|
||||
escape-string-regexp@^1.0.2:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||
|
||||
esprima-harmony-jscs@1.1.0-bin:
|
||||
version "1.1.0-bin"
|
||||
resolved "https://registry.yarnpkg.com/esprima-harmony-jscs/-/esprima-harmony-jscs-1.1.0-bin.tgz#07cb0571d943eed4bc7bfe9e72637c663fe151ed"
|
||||
|
||||
esprima@^1.2.5:
|
||||
version "1.2.5"
|
||||
resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.2.5.tgz#0993502feaf668138325756f30f9a51feeec11e9"
|
||||
|
||||
"esprima@~ 1.0.2":
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.0.4.tgz#9f557e08fc3b4d26ece9dd34f8fbf476b62585ad"
|
||||
|
||||
estraverse@^1.9.3:
|
||||
version "1.9.3"
|
||||
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44"
|
||||
|
||||
eventemitter2@~0.4.13:
|
||||
version "0.4.14"
|
||||
resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-0.4.14.tgz#8f61b75cde012b2e9eb284d4545583b5643b61ab"
|
||||
|
||||
exit@0.1.2, exit@0.1.x, exit@~0.1.1, exit@~0.1.2:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c"
|
||||
|
||||
eyes@0.1.x:
|
||||
version "0.1.8"
|
||||
resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0"
|
||||
|
||||
faye-websocket@~0.4.3:
|
||||
version "0.4.4"
|
||||
resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.4.4.tgz#c14c5b3bf14d7417ffbfd990c0a7495cd9f337bc"
|
||||
|
||||
findup-sync@~0.1.2:
|
||||
version "0.1.3"
|
||||
resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-0.1.3.tgz#7f3e7a97b82392c653bf06589bd85190e93c3683"
|
||||
dependencies:
|
||||
glob "~3.2.9"
|
||||
lodash "~2.4.1"
|
||||
|
||||
formatio@1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/formatio/-/formatio-1.1.1.tgz#5ed3ccd636551097383465d996199100e86161e9"
|
||||
dependencies:
|
||||
samsam "~1.1"
|
||||
|
||||
fs.realpath@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
||||
|
||||
gaze@~0.5.1:
|
||||
version "0.5.2"
|
||||
resolved "https://registry.yarnpkg.com/gaze/-/gaze-0.5.2.tgz#40b709537d24d1d45767db5a908689dfe69ac44f"
|
||||
dependencies:
|
||||
globule "~0.1.0"
|
||||
|
||||
get-stdin@^4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"
|
||||
|
||||
getobject@~0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/getobject/-/getobject-0.1.0.tgz#047a449789fa160d018f5486ed91320b6ec7885c"
|
||||
|
||||
glob@3.2.3:
|
||||
version "3.2.3"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-3.2.3.tgz#e313eeb249c7affaa5c475286b0e115b59839467"
|
||||
dependencies:
|
||||
graceful-fs "~2.0.0"
|
||||
inherits "2"
|
||||
minimatch "~0.2.11"
|
||||
|
||||
glob@^5.0.1:
|
||||
version "5.0.15"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1"
|
||||
dependencies:
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "2 || 3"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
glob@^7.0.5:
|
||||
version "7.1.2"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
|
||||
dependencies:
|
||||
fs.realpath "^1.0.0"
|
||||
inflight "^1.0.4"
|
||||
inherits "2"
|
||||
minimatch "^3.0.4"
|
||||
once "^1.3.0"
|
||||
path-is-absolute "^1.0.0"
|
||||
|
||||
"glob@~ 3.2.1", glob@~3.2.9:
|
||||
version "3.2.11"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-3.2.11.tgz#4a973f635b9190f715d10987d5c00fd2815ebe3d"
|
||||
dependencies:
|
||||
inherits "2"
|
||||
minimatch "0.3"
|
||||
|
||||
glob@~3.1.21:
|
||||
version "3.1.21"
|
||||
resolved "https://registry.yarnpkg.com/glob/-/glob-3.1.21.tgz#d29e0a055dea5138f4d07ed40e8982e83c2066cd"
|
||||
dependencies:
|
||||
graceful-fs "~1.2.0"
|
||||
inherits "1"
|
||||
minimatch "~0.2.11"
|
||||
|
||||
globule@~0.1.0:
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/globule/-/globule-0.1.0.tgz#d9c8edde1da79d125a151b79533b978676346ae5"
|
||||
dependencies:
|
||||
glob "~3.1.21"
|
||||
lodash "~1.0.1"
|
||||
minimatch "~0.2.11"
|
||||
|
||||
graceful-fs@~1.2.0:
|
||||
version "1.2.3"
|
||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-1.2.3.tgz#15a4806a57547cb2d2dbf27f42e89a8c3451b364"
|
||||
|
||||
graceful-fs@~2.0.0:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-2.0.3.tgz#7cd2cdb228a4a3f36e95efa6cc142de7d1a136d0"
|
||||
|
||||
growl@1.8.1:
|
||||
version "1.8.1"
|
||||
resolved "https://registry.yarnpkg.com/growl/-/growl-1.8.1.tgz#4b2dec8d907e93db336624dcec0183502f8c9428"
|
||||
|
||||
grunt-bump@0.0.13:
|
||||
version "0.0.13"
|
||||
resolved "https://registry.yarnpkg.com/grunt-bump/-/grunt-bump-0.0.13.tgz#b133ba5398c55b7fcd02c00445b65adcb81e494b"
|
||||
dependencies:
|
||||
semver "~1.1"
|
||||
|
||||
grunt-contrib-clean@~0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/grunt-contrib-clean/-/grunt-contrib-clean-0.6.0.tgz#f532dba4b8212674c7c013e146bda6638b9048f6"
|
||||
dependencies:
|
||||
rimraf "~2.2.1"
|
||||
|
||||
grunt-contrib-jshint@~0.11.2:
|
||||
version "0.11.3"
|
||||
resolved "https://registry.yarnpkg.com/grunt-contrib-jshint/-/grunt-contrib-jshint-0.11.3.tgz#80368181dccd551186e5b8385c011cee24d640a0"
|
||||
dependencies:
|
||||
hooker "^0.2.3"
|
||||
jshint "~2.8.0"
|
||||
|
||||
grunt-contrib-watch@~0.6.1:
|
||||
version "0.6.1"
|
||||
resolved "https://registry.yarnpkg.com/grunt-contrib-watch/-/grunt-contrib-watch-0.6.1.tgz#64fdcba25a635f5b4da1b6ce6f90da0aeb6e3f15"
|
||||
dependencies:
|
||||
async "~0.2.9"
|
||||
gaze "~0.5.1"
|
||||
lodash "~2.4.1"
|
||||
tiny-lr-fork "0.0.5"
|
||||
|
||||
grunt-jscs@^1.8.0:
|
||||
version "1.8.0"
|
||||
resolved "https://registry.yarnpkg.com/grunt-jscs/-/grunt-jscs-1.8.0.tgz#de96df9cdd737ee15c12b31bb46a3bd91d948981"
|
||||
dependencies:
|
||||
hooker "~0.2.3"
|
||||
jscs "~1.13.0"
|
||||
lodash "~2.4.1"
|
||||
vow "~0.4.1"
|
||||
|
||||
grunt-legacy-log-utils@~0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/grunt-legacy-log-utils/-/grunt-legacy-log-utils-0.1.1.tgz#c0706b9dd9064e116f36f23fe4e6b048672c0f7e"
|
||||
dependencies:
|
||||
colors "~0.6.2"
|
||||
lodash "~2.4.1"
|
||||
underscore.string "~2.3.3"
|
||||
|
||||
grunt-legacy-log@~0.1.0:
|
||||
version "0.1.3"
|
||||
resolved "https://registry.yarnpkg.com/grunt-legacy-log/-/grunt-legacy-log-0.1.3.tgz#ec29426e803021af59029f87d2f9cd7335a05531"
|
||||
dependencies:
|
||||
colors "~0.6.2"
|
||||
grunt-legacy-log-utils "~0.1.1"
|
||||
hooker "~0.2.3"
|
||||
lodash "~2.4.1"
|
||||
underscore.string "~2.3.3"
|
||||
|
||||
grunt-legacy-util@~0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/grunt-legacy-util/-/grunt-legacy-util-0.2.0.tgz#93324884dbf7e37a9ff7c026dff451d94a9e554b"
|
||||
dependencies:
|
||||
async "~0.1.22"
|
||||
exit "~0.1.1"
|
||||
getobject "~0.1.0"
|
||||
hooker "~0.2.3"
|
||||
lodash "~0.9.2"
|
||||
underscore.string "~2.2.1"
|
||||
which "~1.0.5"
|
||||
|
||||
grunt-mocha-cli@^1.13.1:
|
||||
version "1.14.0"
|
||||
resolved "https://registry.yarnpkg.com/grunt-mocha-cli/-/grunt-mocha-cli-1.14.0.tgz#48f657b53347f52dd95cf843270c0cabd92f595a"
|
||||
dependencies:
|
||||
mocha "~2.2.1"
|
||||
|
||||
grunt@~0.4.4:
|
||||
version "0.4.5"
|
||||
resolved "https://registry.yarnpkg.com/grunt/-/grunt-0.4.5.tgz#56937cd5194324adff6d207631832a9d6ba4e7f0"
|
||||
dependencies:
|
||||
async "~0.1.22"
|
||||
coffee-script "~1.3.3"
|
||||
colors "~0.6.2"
|
||||
dateformat "1.0.2-1.2.3"
|
||||
eventemitter2 "~0.4.13"
|
||||
exit "~0.1.1"
|
||||
findup-sync "~0.1.2"
|
||||
getobject "~0.1.0"
|
||||
glob "~3.1.21"
|
||||
grunt-legacy-log "~0.1.0"
|
||||
grunt-legacy-util "~0.2.0"
|
||||
hooker "~0.2.3"
|
||||
iconv-lite "~0.2.11"
|
||||
js-yaml "~2.0.5"
|
||||
lodash "~0.9.2"
|
||||
minimatch "~0.2.12"
|
||||
nopt "~1.0.10"
|
||||
rimraf "~2.2.8"
|
||||
underscore.string "~2.2.1"
|
||||
which "~1.0.5"
|
||||
|
||||
has-ansi@^1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-1.0.3.tgz#c0b5b1615d9e382b0ff67169d967b425e48ca538"
|
||||
dependencies:
|
||||
ansi-regex "^1.1.0"
|
||||
get-stdin "^4.0.1"
|
||||
|
||||
hooker@^0.2.3, hooker@~0.2.3:
|
||||
version "0.2.3"
|
||||
resolved "https://registry.yarnpkg.com/hooker/-/hooker-0.2.3.tgz#b834f723cc4a242aa65963459df6d984c5d3d959"
|
||||
|
||||
htmlparser2@3.8.x, htmlparser2@~3.8.1:
|
||||
version "3.8.3"
|
||||
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.8.3.tgz#996c28b191516a8be86501a7d79757e5c70c1068"
|
||||
dependencies:
|
||||
domelementtype "1"
|
||||
domhandler "2.3"
|
||||
domutils "1.5"
|
||||
entities "1.0"
|
||||
readable-stream "1.1"
|
||||
|
||||
i@0.3.x:
|
||||
version "0.3.6"
|
||||
resolved "https://registry.yarnpkg.com/i/-/i-0.3.6.tgz#d96c92732076f072711b6b10fd7d4f65ad8ee23d"
|
||||
|
||||
iconv-lite@~0.2.11:
|
||||
version "0.2.11"
|
||||
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.2.11.tgz#1ce60a3a57864a292d1321ff4609ca4bb965adc8"
|
||||
|
||||
inflight@^1.0.4:
|
||||
version "1.0.6"
|
||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
||||
dependencies:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-1.0.2.tgz#ca4309dadee6b54cc0b8d247e8d7c7a0975bdc9b"
|
||||
|
||||
inherits@2, inherits@~2.0.1:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
||||
|
||||
inherits@2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1"
|
||||
|
||||
isarray@0.0.1:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
|
||||
|
||||
isstream@0.1.x:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
|
||||
|
||||
jade@0.26.3:
|
||||
version "0.26.3"
|
||||
resolved "https://registry.yarnpkg.com/jade/-/jade-0.26.3.tgz#8f10d7977d8d79f2f6ff862a81b0513ccb25686c"
|
||||
dependencies:
|
||||
commander "0.6.1"
|
||||
mkdirp "0.3.0"
|
||||
|
||||
js-yaml@~2.0.5:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-2.0.5.tgz#a25ae6509999e97df278c6719da11bd0687743a8"
|
||||
dependencies:
|
||||
argparse "~ 0.1.11"
|
||||
esprima "~ 1.0.2"
|
||||
|
||||
jscs@~1.13.0:
|
||||
version "1.13.1"
|
||||
resolved "https://registry.yarnpkg.com/jscs/-/jscs-1.13.1.tgz#7dd46e186f0fce0712cd031eacc0a45ef7dcfeb0"
|
||||
dependencies:
|
||||
chalk "~1.0.0"
|
||||
cli-table "~0.3.1"
|
||||
commander "~2.6.0"
|
||||
esprima "^1.2.5"
|
||||
esprima-harmony-jscs "1.1.0-bin"
|
||||
estraverse "^1.9.3"
|
||||
exit "~0.1.2"
|
||||
glob "^5.0.1"
|
||||
lodash.assign "~3.0.0"
|
||||
minimatch "~2.0.1"
|
||||
pathval "~0.1.1"
|
||||
prompt "~0.2.14"
|
||||
strip-json-comments "~1.0.2"
|
||||
vow "~0.4.8"
|
||||
vow-fs "~0.3.4"
|
||||
xmlbuilder "^2.6.1"
|
||||
|
||||
jshint@~2.8.0:
|
||||
version "2.8.0"
|
||||
resolved "https://registry.yarnpkg.com/jshint/-/jshint-2.8.0.tgz#1d09a3bd913c4cadfa81bf18d582bd85bffe0d44"
|
||||
dependencies:
|
||||
cli "0.6.x"
|
||||
console-browserify "1.1.x"
|
||||
exit "0.1.x"
|
||||
htmlparser2 "3.8.x"
|
||||
lodash "3.7.x"
|
||||
minimatch "2.0.x"
|
||||
shelljs "0.3.x"
|
||||
strip-json-comments "1.0.x"
|
||||
|
||||
lodash._baseassign@^3.0.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e"
|
||||
dependencies:
|
||||
lodash._basecopy "^3.0.0"
|
||||
lodash.keys "^3.0.0"
|
||||
|
||||
lodash._basecopy@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36"
|
||||
|
||||
lodash._bindcallback@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e"
|
||||
|
||||
lodash._createassigner@^3.0.0:
|
||||
version "3.1.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz#838a5bae2fdaca63ac22dee8e19fa4e6d6970b11"
|
||||
dependencies:
|
||||
lodash._bindcallback "^3.0.0"
|
||||
lodash._isiterateecall "^3.0.0"
|
||||
lodash.restparam "^3.0.0"
|
||||
|
||||
lodash._getnative@^3.0.0:
|
||||
version "3.9.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
|
||||
|
||||
lodash._isiterateecall@^3.0.0:
|
||||
version "3.0.9"
|
||||
resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c"
|
||||
|
||||
lodash.assign@~3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-3.0.0.tgz#f7749d1580a4120273a371f54a66b14c9d7226fa"
|
||||
dependencies:
|
||||
lodash._baseassign "^3.0.0"
|
||||
lodash._createassigner "^3.0.0"
|
||||
|
||||
lodash.isarguments@^3.0.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a"
|
||||
|
||||
lodash.isarray@^3.0.0:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55"
|
||||
|
||||
lodash.keys@^3.0.0:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a"
|
||||
dependencies:
|
||||
lodash._getnative "^3.0.0"
|
||||
lodash.isarguments "^3.0.0"
|
||||
lodash.isarray "^3.0.0"
|
||||
|
||||
lodash.restparam@^3.0.0:
|
||||
version "3.6.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805"
|
||||
|
||||
lodash.unescape@4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c"
|
||||
|
||||
lodash@3.7.x:
|
||||
version "3.7.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.7.0.tgz#3678bd8ab995057c07ade836ed2ef087da811d45"
|
||||
|
||||
lodash@^3.2.0, lodash@^3.5.0:
|
||||
version "3.10.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
|
||||
|
||||
lodash@^4.0.0:
|
||||
version "4.17.4"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
|
||||
|
||||
lodash@~0.9.2:
|
||||
version "0.9.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-0.9.2.tgz#8f3499c5245d346d682e5b0d3b40767e09f1a92c"
|
||||
|
||||
lodash@~1.0.1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-1.0.2.tgz#8f57560c83b59fc270bd3d561b690043430e2551"
|
||||
|
||||
lodash@~2.4.1:
|
||||
version "2.4.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-2.4.2.tgz#fadd834b9683073da179b3eae6d9c0d15053f73e"
|
||||
|
||||
lolex@1.3.2:
|
||||
version "1.3.2"
|
||||
resolved "https://registry.yarnpkg.com/lolex/-/lolex-1.3.2.tgz#7c3da62ffcb30f0f5a80a2566ca24e45d8a01f31"
|
||||
|
||||
lru-cache@2:
|
||||
version "2.7.3"
|
||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952"
|
||||
|
||||
minimatch@0.3:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.3.0.tgz#275d8edaac4f1bb3326472089e7949c8394699dd"
|
||||
dependencies:
|
||||
lru-cache "2"
|
||||
sigmund "~1.0.0"
|
||||
|
||||
"minimatch@2 || 3", minimatch@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
||||
dependencies:
|
||||
brace-expansion "^1.1.7"
|
||||
|
||||
minimatch@2.0.x, minimatch@~2.0.1:
|
||||
version "2.0.10"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7"
|
||||
dependencies:
|
||||
brace-expansion "^1.0.0"
|
||||
|
||||
minimatch@~0.2.11, minimatch@~0.2.12:
|
||||
version "0.2.14"
|
||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.2.14.tgz#c74e780574f63c6f9a090e90efbe6ef53a6a756a"
|
||||
dependencies:
|
||||
lru-cache "2"
|
||||
sigmund "~1.0.0"
|
||||
|
||||
minimist@0.0.8:
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
|
||||
|
||||
mkdirp@0.3.0:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e"
|
||||
|
||||
mkdirp@0.5.0:
|
||||
version "0.5.0"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.0.tgz#1d73076a6df986cd9344e15e71fcc05a4c9abf12"
|
||||
dependencies:
|
||||
minimist "0.0.8"
|
||||
|
||||
mkdirp@0.x.x:
|
||||
version "0.5.1"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
|
||||
dependencies:
|
||||
minimist "0.0.8"
|
||||
|
||||
mocha@~2.2.1:
|
||||
version "2.2.5"
|
||||
resolved "https://registry.yarnpkg.com/mocha/-/mocha-2.2.5.tgz#d3b72a4fe49ec9439353f1ac893dbc430d993140"
|
||||
dependencies:
|
||||
commander "2.3.0"
|
||||
debug "2.0.0"
|
||||
diff "1.4.0"
|
||||
escape-string-regexp "1.0.2"
|
||||
glob "3.2.3"
|
||||
growl "1.8.1"
|
||||
jade "0.26.3"
|
||||
mkdirp "0.5.0"
|
||||
supports-color "~1.2.0"
|
||||
|
||||
ms@0.6.2:
|
||||
version "0.6.2"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-0.6.2.tgz#d89c2124c6fdc1353d65a8b77bf1aac4b193708c"
|
||||
|
||||
mute-stream@~0.0.4:
|
||||
version "0.0.7"
|
||||
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
|
||||
|
||||
ncp@0.4.x:
|
||||
version "0.4.2"
|
||||
resolved "https://registry.yarnpkg.com/ncp/-/ncp-0.4.2.tgz#abcc6cbd3ec2ed2a729ff6e7c1fa8f01784a8574"
|
||||
|
||||
nopt@~1.0.10:
|
||||
version "1.0.10"
|
||||
resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee"
|
||||
dependencies:
|
||||
abbrev "1"
|
||||
|
||||
nopt@~2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/nopt/-/nopt-2.0.0.tgz#ca7416f20a5e3f9c3b86180f96295fa3d0b52e0d"
|
||||
dependencies:
|
||||
abbrev "1"
|
||||
|
||||
noptify@~0.0.3:
|
||||
version "0.0.3"
|
||||
resolved "https://registry.yarnpkg.com/noptify/-/noptify-0.0.3.tgz#58f654a73d9753df0c51d9686dc92104a67f4bbb"
|
||||
dependencies:
|
||||
nopt "~2.0.0"
|
||||
|
||||
nth-check@~1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.1.tgz#9929acdf628fc2c41098deab82ac580cf149aae4"
|
||||
dependencies:
|
||||
boolbase "~1.0.0"
|
||||
|
||||
once@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
||||
dependencies:
|
||||
wrappy "1"
|
||||
|
||||
path-is-absolute@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
|
||||
pathval@~0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/pathval/-/pathval-0.1.1.tgz#08f911cdca9cce5942880da7817bc0b723b66d82"
|
||||
|
||||
pkginfo@0.3.x:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.3.1.tgz#5b29f6a81f70717142e09e765bbeab97b4f81e21"
|
||||
|
||||
pkginfo@0.x.x:
|
||||
version "0.4.1"
|
||||
resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.4.1.tgz#b5418ef0439de5425fc4995042dced14fb2a84ff"
|
||||
|
||||
pofile@~1.0.0:
|
||||
version "1.0.10"
|
||||
resolved "https://registry.yarnpkg.com/pofile/-/pofile-1.0.10.tgz#503dda9499403984e83ff4489ba2d80af276172a"
|
||||
|
||||
prompt@~0.2.14:
|
||||
version "0.2.14"
|
||||
resolved "https://registry.yarnpkg.com/prompt/-/prompt-0.2.14.tgz#57754f64f543fd7b0845707c818ece618f05ffdc"
|
||||
dependencies:
|
||||
pkginfo "0.x.x"
|
||||
read "1.0.x"
|
||||
revalidator "0.1.x"
|
||||
utile "0.2.x"
|
||||
winston "0.8.x"
|
||||
|
||||
qs@~0.5.2:
|
||||
version "0.5.6"
|
||||
resolved "https://registry.yarnpkg.com/qs/-/qs-0.5.6.tgz#31b1ad058567651c526921506b9a8793911a0384"
|
||||
|
||||
read@1.0.x:
|
||||
version "1.0.7"
|
||||
resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4"
|
||||
dependencies:
|
||||
mute-stream "~0.0.4"
|
||||
|
||||
readable-stream@1.1:
|
||||
version "1.1.13"
|
||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.13.tgz#f6eef764f514c89e2b9e23146a75ba106756d23e"
|
||||
dependencies:
|
||||
core-util-is "~1.0.0"
|
||||
inherits "~2.0.1"
|
||||
isarray "0.0.1"
|
||||
string_decoder "~0.10.x"
|
||||
|
||||
revalidator@0.1.x:
|
||||
version "0.1.8"
|
||||
resolved "https://registry.yarnpkg.com/revalidator/-/revalidator-0.1.8.tgz#fece61bfa0c1b52a206bd6b18198184bdd523a3b"
|
||||
|
||||
rimraf@2.x.x:
|
||||
version "2.6.2"
|
||||
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36"
|
||||
dependencies:
|
||||
glob "^7.0.5"
|
||||
|
||||
rimraf@~2.2.1, rimraf@~2.2.8:
|
||||
version "2.2.8"
|
||||
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582"
|
||||
|
||||
samsam@1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.1.2.tgz#bec11fdc83a9fda063401210e40176c3024d1567"
|
||||
|
||||
samsam@~1.1:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.1.3.tgz#9f5087419b4d091f232571e7fa52e90b0f552621"
|
||||
|
||||
semver@5.3.0:
|
||||
version "5.3.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"
|
||||
|
||||
semver@~1.1:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-1.1.4.tgz#2e5a4e72bab03472cc97f72753b4508912ef5540"
|
||||
|
||||
shelljs@0.3.x:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.3.0.tgz#3596e6307a781544f591f37da618360f31db57b1"
|
||||
|
||||
sigmund@~1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590"
|
||||
|
||||
sinon@^1.17.4:
|
||||
version "1.17.7"
|
||||
resolved "https://registry.yarnpkg.com/sinon/-/sinon-1.17.7.tgz#4542a4f49ba0c45c05eb2e9dd9d203e2b8efe0bf"
|
||||
dependencies:
|
||||
formatio "1.1.1"
|
||||
lolex "1.3.2"
|
||||
samsam "1.1.2"
|
||||
util ">=0.10.3 <1"
|
||||
|
||||
stack-trace@0.0.x:
|
||||
version "0.0.10"
|
||||
resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0"
|
||||
|
||||
string_decoder@~0.10.x:
|
||||
version "0.10.31"
|
||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"
|
||||
|
||||
strip-ansi@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-2.0.1.tgz#df62c1aa94ed2f114e1d0f21fd1d50482b79a60e"
|
||||
dependencies:
|
||||
ansi-regex "^1.0.0"
|
||||
|
||||
strip-json-comments@1.0.x, strip-json-comments@~1.0.2:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91"
|
||||
|
||||
supports-color@^1.3.0:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-1.3.1.tgz#15758df09d8ff3b4acc307539fabe27095e1042d"
|
||||
|
||||
supports-color@~1.2.0:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-1.2.1.tgz#12ee21507086cd98c1058d9ec0f4ac476b7af3b2"
|
||||
|
||||
tiny-lr-fork@0.0.5:
|
||||
version "0.0.5"
|
||||
resolved "https://registry.yarnpkg.com/tiny-lr-fork/-/tiny-lr-fork-0.0.5.tgz#1e99e1e2a8469b736ab97d97eefa98c71f76ed0a"
|
||||
dependencies:
|
||||
debug "~0.7.0"
|
||||
faye-websocket "~0.4.3"
|
||||
noptify "~0.0.3"
|
||||
qs "~0.5.2"
|
||||
|
||||
typescript-eslint-parser@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/typescript-eslint-parser/-/typescript-eslint-parser-3.0.0.tgz#dd0435b303abc841464c02d00184d7b39bd488b5"
|
||||
dependencies:
|
||||
lodash.unescape "4.0.1"
|
||||
semver "5.3.0"
|
||||
|
||||
typescript@~2.3.2:
|
||||
version "2.3.4"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.3.4.tgz#3d38321828231e434f287514959c37a82b629f42"
|
||||
|
||||
underscore.string@~2.2.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-2.2.1.tgz#d7c0fa2af5d5a1a67f4253daee98132e733f0f19"
|
||||
|
||||
underscore.string@~2.3.3:
|
||||
version "2.3.3"
|
||||
resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-2.3.3.tgz#71c08bf6b428b1133f37e78fa3a21c82f7329b0d"
|
||||
|
||||
underscore.string@~2.4.0:
|
||||
version "2.4.0"
|
||||
resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-2.4.0.tgz#8cdd8fbac4e2d2ea1e7e2e8097c42f442280f85b"
|
||||
|
||||
underscore@~1.7.0:
|
||||
version "1.7.0"
|
||||
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.7.0.tgz#6bbaf0877500d36be34ecaa584e0db9fef035209"
|
||||
|
||||
"util@>=0.10.3 <1":
|
||||
version "0.10.3"
|
||||
resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9"
|
||||
dependencies:
|
||||
inherits "2.0.1"
|
||||
|
||||
utile@0.2.x:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/utile/-/utile-0.2.1.tgz#930c88e99098d6220834c356cbd9a770522d90d7"
|
||||
dependencies:
|
||||
async "~0.2.9"
|
||||
deep-equal "*"
|
||||
i "0.3.x"
|
||||
mkdirp "0.x.x"
|
||||
ncp "0.4.x"
|
||||
rimraf "2.x.x"
|
||||
|
||||
uuid@^2.0.2:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a"
|
||||
|
||||
vow-fs@~0.3.4:
|
||||
version "0.3.6"
|
||||
resolved "https://registry.yarnpkg.com/vow-fs/-/vow-fs-0.3.6.tgz#2d4c59be22e2bf2618ddf597ab4baa923be7200d"
|
||||
dependencies:
|
||||
glob "^7.0.5"
|
||||
uuid "^2.0.2"
|
||||
vow "^0.4.7"
|
||||
vow-queue "^0.4.1"
|
||||
|
||||
vow-queue@^0.4.1:
|
||||
version "0.4.3"
|
||||
resolved "https://registry.yarnpkg.com/vow-queue/-/vow-queue-0.4.3.tgz#4ba8f64b56e9212c0dbe57f1405aeebd54cce78d"
|
||||
dependencies:
|
||||
vow "^0.4.17"
|
||||
|
||||
vow@^0.4.17, vow@^0.4.7, vow@~0.4.1, vow@~0.4.8:
|
||||
version "0.4.17"
|
||||
resolved "https://registry.yarnpkg.com/vow/-/vow-0.4.17.tgz#b16e08fae58c52f3ebc6875f2441b26a92682904"
|
||||
|
||||
which@~1.0.5:
|
||||
version "1.0.9"
|
||||
resolved "https://registry.yarnpkg.com/which/-/which-1.0.9.tgz#460c1da0f810103d0321a9b633af9e575e64486f"
|
||||
|
||||
winston@0.8.x:
|
||||
version "0.8.3"
|
||||
resolved "https://registry.yarnpkg.com/winston/-/winston-0.8.3.tgz#64b6abf4cd01adcaefd5009393b1d8e8bec19db0"
|
||||
dependencies:
|
||||
async "0.2.x"
|
||||
colors "0.6.x"
|
||||
cycle "1.0.x"
|
||||
eyes "0.1.x"
|
||||
isstream "0.1.x"
|
||||
pkginfo "0.3.x"
|
||||
stack-trace "0.0.x"
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
|
||||
xmlbuilder@^2.6.1:
|
||||
version "2.6.5"
|
||||
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-2.6.5.tgz#6ff7ad60fb72d22764f007a164b77f2bf1400526"
|
||||
dependencies:
|
||||
lodash "^3.5.0"
|
35
node_modules/angular-gettext/.jscs.json
generated
vendored
Normal file
35
node_modules/angular-gettext/.jscs.json
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
|
||||
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
|
||||
"requireParenthesesAroundIIFE": true,
|
||||
"requireSpacesInFunctionExpression": {
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"requireSpacesInAnonymousFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowSpacesInNamedFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowSpacesInFunctionDeclaration": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowMultipleVarDecl": true,
|
||||
"requireSpacesInsideObjectBrackets": "all",
|
||||
"disallowQuotedKeysInObjects": "allButReserved",
|
||||
"disallowSpaceAfterObjectKeys": true,
|
||||
"requireCommaBeforeLineBreak": true,
|
||||
"disallowSpaceBeforeBinaryOperators": [","],
|
||||
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
|
||||
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
|
||||
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
|
||||
"requireSpaceAfterBinaryOperators": [",", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
|
||||
"validateQuoteMarks": { "mark": true, "escape": true },
|
||||
"validateIndentation": 4,
|
||||
"disallowTrailingWhitespace": true,
|
||||
"disallowKeywordsOnNewLine": ["else"],
|
||||
"requireCapitalizedConstructors": true,
|
||||
"safeContextKeyword": "self",
|
||||
"requireDotNotation": true,
|
||||
"disallowYodaConditions": true
|
||||
}
|
32
node_modules/angular-gettext/.jshintrc
generated
vendored
Normal file
32
node_modules/angular-gettext/.jshintrc
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"bitwise": true,
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"es3": true,
|
||||
"freeze": true,
|
||||
"immed": true,
|
||||
"indent": 4,
|
||||
"latedef": true,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"node": true,
|
||||
"trailing": true,
|
||||
"undef": true,
|
||||
"unused": true,
|
||||
"predef": [
|
||||
"$",
|
||||
"after",
|
||||
"afterEach",
|
||||
"angular",
|
||||
"assert",
|
||||
"before",
|
||||
"beforeEach",
|
||||
"browser",
|
||||
"by",
|
||||
"describe",
|
||||
"element",
|
||||
"expect",
|
||||
"inject",
|
||||
"it"
|
||||
]
|
||||
}
|
9
node_modules/angular-gettext/.npmignore
generated
vendored
Normal file
9
node_modules/angular-gettext/.npmignore
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
/Gruntfile.js
|
||||
/.travis.yml
|
||||
/genplurals.py
|
||||
/test
|
||||
/src
|
||||
/node_modules
|
||||
/bower_components
|
||||
/libpeerconnection.log
|
||||
/*-results.xml
|
19
node_modules/angular-gettext/LICENSE
generated
vendored
Normal file
19
node_modules/angular-gettext/LICENSE
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright (C) 2013-2017 by Ruben Vermeersch <ruben@rocketeer.be>
|
||||
|
||||
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.
|
31
node_modules/angular-gettext/README.md
generated
vendored
Normal file
31
node_modules/angular-gettext/README.md
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
# angular-gettext - gettext utilities for angular.js
|
||||
|
||||
> Translate your Angular.JS applications with gettext.
|
||||
|
||||
[![Build Status](https://travis-ci.org/rubenv/angular-gettext.png?branch=master)](https://travis-ci.org/rubenv/angular-gettext)
|
||||
|
||||
Check the website for usage instructions: [http://angular-gettext.rocketeer.be/](http://angular-gettext.rocketeer.be/).
|
||||
|
||||
## License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (C) 2013-2017 by Ruben Vermeersch <ruben@rocketeer.be>
|
||||
|
||||
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.
|
21
node_modules/angular-gettext/bower.json
generated
vendored
Normal file
21
node_modules/angular-gettext/bower.json
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "angular-gettext",
|
||||
"version": "2.3.10",
|
||||
"main": "dist/angular-gettext.js",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"src",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"genplurals.py",
|
||||
"Gruntfile.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"angular": ">=1.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"jquery": ">=1.8.0",
|
||||
"angular-mocks": ">=1.2.0"
|
||||
}
|
||||
}
|
825
node_modules/angular-gettext/dist/angular-gettext.js
generated
vendored
Normal file
825
node_modules/angular-gettext/dist/angular-gettext.js
generated
vendored
Normal file
@ -0,0 +1,825 @@
|
||||
/**
|
||||
* @ngdoc module
|
||||
* @name gettext
|
||||
* @packageName angular-gettext
|
||||
* @description Super simple Gettext for Angular.JS
|
||||
*
|
||||
* A sample application can be found at https://github.com/rubenv/angular-gettext-example.
|
||||
* This is an adaptation of the [TodoMVC](http://todomvc.com/) example. You can use this as a guideline while adding {@link angular-gettext angular-gettext} to your own application.
|
||||
*/
|
||||
/**
|
||||
* @ngdoc factory
|
||||
* @module gettext
|
||||
* @name gettextPlurals
|
||||
* @param {String} [langCode=en] language code
|
||||
* @param {Number} [n=0] number to calculate form for
|
||||
* @returns {Number} plural form number
|
||||
* @description Provides correct plural form id for the given language
|
||||
*
|
||||
* Example
|
||||
* ```js
|
||||
* gettextPlurals('ru', 10); // 1
|
||||
* gettextPlurals('en', 1); // 0
|
||||
* gettextPlurals(); // 1
|
||||
* ```
|
||||
*/
|
||||
angular.module('gettext', []);
|
||||
/**
|
||||
* @ngdoc object
|
||||
* @module gettext
|
||||
* @name gettext
|
||||
* @kind function
|
||||
* @param {String} str annotation key
|
||||
* @description Gettext constant function for annotating strings
|
||||
*
|
||||
* ```js
|
||||
* angular.module('myApp', ['gettext']).config(function(gettext) {
|
||||
* /// MyApp document title
|
||||
* gettext('my-app.title');
|
||||
* ...
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
angular.module('gettext').constant('gettext', function (str) {
|
||||
/*
|
||||
* Does nothing, simply returns the input string.
|
||||
*
|
||||
* This function serves as a marker for `grunt-angular-gettext` to know that
|
||||
* this string should be extracted for translations.
|
||||
*/
|
||||
return str;
|
||||
});
|
||||
|
||||
/**
|
||||
* @ngdoc service
|
||||
* @module gettext
|
||||
* @name gettextCatalog
|
||||
* @requires gettextPlurals
|
||||
* @requires gettextFallbackLanguage
|
||||
* @requires https://docs.angularjs.org/api/ng/service/$http $http
|
||||
* @requires https://docs.angularjs.org/api/ng/service/$cacheFactory $cacheFactory
|
||||
* @requires https://docs.angularjs.org/api/ng/service/$interpolate $interpolate
|
||||
* @requires https://docs.angularjs.org/api/ng/service/$rootScope $rootScope
|
||||
* @description Provides set of method to translate stings
|
||||
*/
|
||||
angular.module('gettext').factory('gettextCatalog', ["gettextPlurals", "gettextFallbackLanguage", "$http", "$cacheFactory", "$interpolate", "$rootScope", function (gettextPlurals, gettextFallbackLanguage, $http, $cacheFactory, $interpolate, $rootScope) {
|
||||
var catalog;
|
||||
var noContext = '$$noContext';
|
||||
|
||||
// IE8 returns UPPER CASE tags, even though the source is lower case.
|
||||
// This can causes the (key) string in the DOM to have a different case to
|
||||
// the string in the `po` files.
|
||||
// IE9, IE10 and IE11 reorders the attributes of tags.
|
||||
var test = '<span id="test" title="test" class="tested">test</span>';
|
||||
var isHTMLModified = (angular.element('<span>' + test + '</span>').html() !== test);
|
||||
|
||||
var prefixDebug = function (string) {
|
||||
if (catalog.debug && catalog.currentLanguage !== catalog.baseLanguage) {
|
||||
return catalog.debugPrefix + string;
|
||||
} else {
|
||||
return string;
|
||||
}
|
||||
};
|
||||
|
||||
var addTranslatedMarkers = function (string) {
|
||||
if (catalog.showTranslatedMarkers) {
|
||||
return catalog.translatedMarkerPrefix + string + catalog.translatedMarkerSuffix;
|
||||
} else {
|
||||
return string;
|
||||
}
|
||||
};
|
||||
|
||||
function broadcastUpdated() {
|
||||
/**
|
||||
* @ngdoc event
|
||||
* @name gettextCatalog#gettextLanguageChanged
|
||||
* @eventType broadcast on $rootScope
|
||||
* @description Fires language change notification without any additional parameters.
|
||||
*/
|
||||
$rootScope.$broadcast('gettextLanguageChanged');
|
||||
}
|
||||
|
||||
catalog = {
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name gettextCatalog#debug
|
||||
* @public
|
||||
* @type {Boolean} false
|
||||
* @see gettextCatalog#debug
|
||||
* @description Whether or not to prefix untranslated strings with `[MISSING]:` or a custom prefix.
|
||||
*/
|
||||
debug: false,
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name gettextCatalog#debugPrefix
|
||||
* @public
|
||||
* @type {String} [MISSING]:
|
||||
* @description Custom prefix for untranslated strings when {@link gettextCatalog#debug gettextCatalog#debug} set to `true`.
|
||||
*/
|
||||
debugPrefix: '[MISSING]: ',
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name gettextCatalog#showTranslatedMarkers
|
||||
* @public
|
||||
* @type {Boolean} false
|
||||
* @description Whether or not to wrap all processed text with markers.
|
||||
*
|
||||
* Example output: `[Welcome]`
|
||||
*/
|
||||
showTranslatedMarkers: false,
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name gettextCatalog#translatedMarkerPrefix
|
||||
* @public
|
||||
* @type {String} [
|
||||
* @description Custom prefix to mark strings that have been run through {@link angular-gettext angular-gettext}.
|
||||
*/
|
||||
translatedMarkerPrefix: '[',
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name gettextCatalog#translatedMarkerSuffix
|
||||
* @public
|
||||
* @type {String} ]
|
||||
* @description Custom suffix to mark strings that have been run through {@link angular-gettext angular-gettext}.
|
||||
*/
|
||||
translatedMarkerSuffix: ']',
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name gettextCatalog#strings
|
||||
* @private
|
||||
* @type {Object}
|
||||
* @description An object of loaded translation strings. Shouldn't be used directly.
|
||||
*/
|
||||
strings: {},
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name gettextCatalog#baseLanguage
|
||||
* @protected
|
||||
* @deprecated
|
||||
* @since 2.0
|
||||
* @type {String} en
|
||||
* @description The default language, in which you're application is written.
|
||||
*
|
||||
* This defaults to English and it's generally a bad idea to use anything else:
|
||||
* if your language has different pluralization rules you'll end up with incorrect translations.
|
||||
*/
|
||||
baseLanguage: 'en',
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name gettextCatalog#currentLanguage
|
||||
* @public
|
||||
* @type {String}
|
||||
* @description Active language.
|
||||
*/
|
||||
currentLanguage: 'en',
|
||||
/**
|
||||
* @ngdoc property
|
||||
* @name gettextCatalog#cache
|
||||
* @public
|
||||
* @type {String} en
|
||||
* @description Language cache for lazy load
|
||||
*/
|
||||
cache: $cacheFactory('strings'),
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextCatalog#setCurrentLanguage
|
||||
* @public
|
||||
* @param {String} lang language name
|
||||
* @description Sets the current language and makes sure that all translations get updated correctly.
|
||||
*/
|
||||
setCurrentLanguage: function (lang) {
|
||||
this.currentLanguage = lang;
|
||||
broadcastUpdated();
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextCatalog#getCurrentLanguage
|
||||
* @public
|
||||
* @returns {String} current language
|
||||
* @description Returns the current language.
|
||||
*/
|
||||
getCurrentLanguage: function () {
|
||||
return this.currentLanguage;
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextCatalog#setStrings
|
||||
* @public
|
||||
* @param {String} language language name
|
||||
* @param {Object.<String>} strings set of strings where the key is the translation `key` and `value` is the translated text
|
||||
* @description Processes an object of string definitions. {@link guide:manual-setstrings More details here}.
|
||||
*/
|
||||
setStrings: function (language, strings) {
|
||||
if (!this.strings[language]) {
|
||||
this.strings[language] = {};
|
||||
}
|
||||
|
||||
var defaultPlural = gettextPlurals(language, 1);
|
||||
for (var key in strings) {
|
||||
var val = strings[key];
|
||||
|
||||
if (isHTMLModified) {
|
||||
// Use the DOM engine to render any HTML in the key (#131).
|
||||
key = angular.element('<span>' + key + '</span>').html();
|
||||
}
|
||||
|
||||
if (angular.isString(val) || angular.isArray(val)) {
|
||||
// No context, wrap it in $$noContext.
|
||||
var obj = {};
|
||||
obj[noContext] = val;
|
||||
val = obj;
|
||||
}
|
||||
|
||||
if (!this.strings[language][key]) {
|
||||
this.strings[language][key] = {};
|
||||
}
|
||||
|
||||
for (var context in val) {
|
||||
var str = val[context];
|
||||
if (!angular.isArray(str)) {
|
||||
// Expand single strings
|
||||
this.strings[language][key][context] = [];
|
||||
this.strings[language][key][context][defaultPlural] = str;
|
||||
} else {
|
||||
this.strings[language][key][context] = str;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
broadcastUpdated();
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextCatalog#getStringFormFor
|
||||
* @protected
|
||||
* @param {String} language language name
|
||||
* @param {String} string translation key
|
||||
* @param {Number=} n number to build sting form for
|
||||
* @param {String=} context translation key context, e.g. {@link doc:context Verb, Noun}
|
||||
* @returns {String|Null} translated or annotated string or null if language is not set
|
||||
* @description Translate a string with the given language, count and context.
|
||||
*/
|
||||
getStringFormFor: function (language, string, n, context) {
|
||||
if (!language) {
|
||||
return null;
|
||||
}
|
||||
var stringTable = this.strings[language] || {};
|
||||
var contexts = stringTable[string] || {};
|
||||
var plurals = contexts[context || noContext] || [];
|
||||
return plurals[gettextPlurals(language, n)];
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextCatalog#getString
|
||||
* @public
|
||||
* @param {String} string translation key
|
||||
* @param {$rootScope.Scope=} scope scope to do interpolation against
|
||||
* @param {String=} context translation key context, e.g. {@link doc:context Verb, Noun}
|
||||
* @returns {String} translated or annotated string
|
||||
* @description Translate a string with the given scope and context.
|
||||
*
|
||||
* First it tries {@link gettextCatalog#currentLanguage gettextCatalog#currentLanguage} (e.g. `en-US`) then {@link gettextFallbackLanguage fallback} (e.g. `en`).
|
||||
*
|
||||
* When `scope` is supplied it uses Angular.JS interpolation, so something like this will do what you expect:
|
||||
* ```js
|
||||
* var hello = gettextCatalog.getString("Hello {{name}}!", { name: "Ruben" });
|
||||
* // var hello will be "Hallo Ruben!" in Dutch.
|
||||
* ```
|
||||
* Avoid using scopes - this skips interpolation and is a lot faster.
|
||||
*/
|
||||
getString: function (string, scope, context) {
|
||||
var fallbackLanguage = gettextFallbackLanguage(this.currentLanguage);
|
||||
string = this.getStringFormFor(this.currentLanguage, string, 1, context) ||
|
||||
this.getStringFormFor(fallbackLanguage, string, 1, context) ||
|
||||
prefixDebug(string);
|
||||
string = scope ? $interpolate(string)(scope) : string;
|
||||
return addTranslatedMarkers(string);
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextCatalog#getPlural
|
||||
* @public
|
||||
* @param {Number} n number to build sting form for
|
||||
* @param {String} string translation key
|
||||
* @param {String} stringPlural plural translation key
|
||||
* @param {$rootScope.Scope=} scope scope to do interpolation against
|
||||
* @param {String=} context translation key context, e.g. {@link doc:context Verb, Noun}
|
||||
* @returns {String} translated or annotated string
|
||||
* @see {@link gettextCatalog#getString gettextCatalog#getString} for details
|
||||
* @description Translate a plural string with the given context.
|
||||
*/
|
||||
getPlural: function (n, string, stringPlural, scope, context) {
|
||||
var fallbackLanguage = gettextFallbackLanguage(this.currentLanguage);
|
||||
string = this.getStringFormFor(this.currentLanguage, string, n, context) ||
|
||||
this.getStringFormFor(fallbackLanguage, string, n, context) ||
|
||||
prefixDebug(n === 1 ? string : stringPlural);
|
||||
if (scope) {
|
||||
scope.$count = n;
|
||||
string = $interpolate(string)(scope);
|
||||
}
|
||||
return addTranslatedMarkers(string);
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextCatalog#loadRemote
|
||||
* @public
|
||||
* @param {String} url location of the translations
|
||||
* @description Load a set of translation strings from a given URL.
|
||||
*
|
||||
* This should be a JSON catalog generated with [angular-gettext-tools](https://github.com/rubenv/angular-gettext-tools).
|
||||
* {@link guide:lazy-loading More details here}.
|
||||
*/
|
||||
loadRemote: function (url) {
|
||||
return $http({
|
||||
method: 'GET',
|
||||
url: url,
|
||||
cache: catalog.cache
|
||||
}).then(function (response) {
|
||||
var data = response.data;
|
||||
for (var lang in data) {
|
||||
catalog.setStrings(lang, data[lang]);
|
||||
}
|
||||
return response;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return catalog;
|
||||
}]);
|
||||
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @module gettext
|
||||
* @name translate
|
||||
* @requires gettextCatalog
|
||||
* @requires gettextUtil
|
||||
* @requires https://docs.angularjs.org/api/ng/service/$parse $parse
|
||||
* @requires https://docs.angularjs.org/api/ng/service/$animate $animate
|
||||
* @requires https://docs.angularjs.org/api/ng/service/$compile $compile
|
||||
* @requires https://docs.angularjs.org/api/ng/service/$window $window
|
||||
* @restrict AE
|
||||
* @param {String} [translatePlural] plural form
|
||||
* @param {Number} translateN value to watch to substitute correct plural form
|
||||
* @param {String} translateContext context value, e.g. {@link doc:context Verb, Noun}
|
||||
* @description Annotates and translates text inside directive
|
||||
*
|
||||
* Full interpolation support is available in translated strings, so the following will work as expected:
|
||||
* ```js
|
||||
* <div translate>Hello {{name}}!</div>
|
||||
* ```
|
||||
*
|
||||
* You can also use custom context parameters while interpolating. This approach allows usage
|
||||
* of angular filters as well as custom logic inside your translated messages without unnecessary impact on translations.
|
||||
*
|
||||
* So for example when you have message like this:
|
||||
* ```js
|
||||
* <div translate>Last modified {{modificationDate | date:'yyyy-MM-dd HH:mm:ss Z'}} by {{author}}.</div>
|
||||
* ```
|
||||
* you will have it extracted in exact same version so it would look like this:
|
||||
* `Last modified {{modificationDate | date:'yyyy-MM-dd HH:mm:ss Z'}} by {{author}}`.
|
||||
* To start with it might be too complicated to read and handle by non technical translator. It's easy to make mistake
|
||||
* when copying format for example. Secondly if you decide to change format by some point of the project translation will broke
|
||||
* as it won't be the same string anymore.
|
||||
*
|
||||
* Instead your translator should only be concerned to place {{modificationDate}} correctly and you should have a free hand
|
||||
* to modify implementation details on how to present the results. This is how you can achieve the goal:
|
||||
* ```js
|
||||
* <div translate translate-params-modification-date="modificationDate | date:'yyyy-MM-dd HH:mm:ss Z'">Last modified {{modificationDate}} by {{author}}.</div>
|
||||
* ```
|
||||
*
|
||||
* There's a few more things worth to point out:
|
||||
* 1. You can use as many parameters as you want. Each parameter begins with `translate-params-` followed by snake-case parameter name.
|
||||
* Each parameter will be available for interpolation in camelCase manner (just like angular directive works by default).
|
||||
* ```js
|
||||
* <div translate translate-params-my-custom-param="param1" translate-params-name="name">Param {{myCustomParam}} has been changed by {{name}}.</div>
|
||||
* ```
|
||||
* 2. You can rename your variables from current scope to simple ones if you like.
|
||||
* ```js
|
||||
* <div translate translate-params-date="veryUnintuitiveNameForDate">Today's date is: {{date}}.</div>
|
||||
* ```
|
||||
* 3. You can use translate-params only for some interpolations. Rest would be treated as usual.
|
||||
* ```js
|
||||
* <div translate translate-params-cost="cost | currency">This product: {{product}} costs {{cost}}.</div>
|
||||
* ```
|
||||
*/
|
||||
angular.module('gettext').directive('translate', ["gettextCatalog", "$parse", "$animate", "$compile", "$window", "gettextUtil", function (gettextCatalog, $parse, $animate, $compile, $window, gettextUtil) {
|
||||
var msie = parseInt((/msie (\d+)/.exec(angular.lowercase($window.navigator.userAgent)) || [])[1], 10);
|
||||
var PARAMS_PREFIX = 'translateParams';
|
||||
|
||||
function getCtxAttr(key) {
|
||||
return gettextUtil.lcFirst(key.replace(PARAMS_PREFIX, ''));
|
||||
}
|
||||
|
||||
function handleInterpolationContext(scope, attrs, update) {
|
||||
var attributes = Object.keys(attrs).filter(function (key) {
|
||||
return gettextUtil.startsWith(key, PARAMS_PREFIX) && key !== PARAMS_PREFIX;
|
||||
});
|
||||
|
||||
if (!attributes.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var interpolationContext = angular.extend({}, scope);
|
||||
var unwatchers = [];
|
||||
attributes.forEach(function (attribute) {
|
||||
var unwatch = scope.$watch(attrs[attribute], function (newVal) {
|
||||
var key = getCtxAttr(attribute);
|
||||
interpolationContext[key] = newVal;
|
||||
update(interpolationContext);
|
||||
});
|
||||
unwatchers.push(unwatch);
|
||||
});
|
||||
scope.$on('$destroy', function () {
|
||||
unwatchers.forEach(function (unwatch) {
|
||||
unwatch();
|
||||
});
|
||||
});
|
||||
return interpolationContext;
|
||||
}
|
||||
|
||||
return {
|
||||
restrict: 'AE',
|
||||
terminal: true,
|
||||
compile: function compile(element, attrs) {
|
||||
// Validate attributes
|
||||
gettextUtil.assert(!attrs.translatePlural || attrs.translateN, 'translate-n', 'translate-plural');
|
||||
gettextUtil.assert(!attrs.translateN || attrs.translatePlural, 'translate-plural', 'translate-n');
|
||||
|
||||
var msgid = gettextUtil.trim(element.html());
|
||||
var translatePlural = attrs.translatePlural;
|
||||
var translateContext = attrs.translateContext;
|
||||
|
||||
if (msie <= 8) {
|
||||
// Workaround fix relating to angular adding a comment node to
|
||||
// anchors. angular/angular.js/#1949 / angular/angular.js/#2013
|
||||
if (msgid.slice(-13) === '<!--IE fix-->') {
|
||||
msgid = msgid.slice(0, -13);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
post: function (scope, element, attrs) {
|
||||
var countFn = $parse(attrs.translateN);
|
||||
var pluralScope = null;
|
||||
var linking = true;
|
||||
|
||||
function update(interpolationContext) {
|
||||
interpolationContext = interpolationContext || null;
|
||||
|
||||
// Fetch correct translated string.
|
||||
var translated;
|
||||
if (translatePlural) {
|
||||
scope = pluralScope || (pluralScope = scope.$new());
|
||||
scope.$count = countFn(scope);
|
||||
translated = gettextCatalog.getPlural(scope.$count, msgid, translatePlural, interpolationContext, translateContext);
|
||||
} else {
|
||||
translated = gettextCatalog.getString(msgid, interpolationContext, translateContext);
|
||||
}
|
||||
var oldContents = element.contents();
|
||||
|
||||
if (!oldContents && !translated){
|
||||
return;
|
||||
}
|
||||
|
||||
// Avoid redundant swaps
|
||||
if (translated === gettextUtil.trim(oldContents.html())){
|
||||
// Take care of unlinked content
|
||||
if (linking){
|
||||
$compile(oldContents)(scope);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Swap in the translation
|
||||
var newWrapper = angular.element('<span>' + translated + '</span>');
|
||||
$compile(newWrapper.contents())(scope);
|
||||
var newContents = newWrapper.contents();
|
||||
|
||||
$animate.enter(newContents, element);
|
||||
$animate.leave(oldContents);
|
||||
}
|
||||
|
||||
var interpolationContext = handleInterpolationContext(scope, attrs, update);
|
||||
update(interpolationContext);
|
||||
linking = false;
|
||||
|
||||
if (attrs.translateN) {
|
||||
scope.$watch(attrs.translateN, function () {
|
||||
update(interpolationContext);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @ngdoc event
|
||||
* @name translate#gettextLanguageChanged
|
||||
* @eventType listen on scope
|
||||
* @description Listens for language updates and changes translation accordingly
|
||||
*/
|
||||
scope.$on('gettextLanguageChanged', function () {
|
||||
update(interpolationContext);
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}]);
|
||||
|
||||
/**
|
||||
* @ngdoc factory
|
||||
* @module gettext
|
||||
* @name gettextFallbackLanguage
|
||||
* @param {String} langCode language code
|
||||
* @returns {String|Null} fallback language
|
||||
* @description Strips regional code and returns language code only
|
||||
*
|
||||
* Example
|
||||
* ```js
|
||||
* gettextFallbackLanguage('ru'); // "null"
|
||||
* gettextFallbackLanguage('en_GB'); // "en"
|
||||
* gettextFallbackLanguage(); // null
|
||||
* ```
|
||||
*/
|
||||
angular.module("gettext").factory("gettextFallbackLanguage", function () {
|
||||
var cache = {};
|
||||
var pattern = /([^_]+)_[^_]+$/;
|
||||
|
||||
return function (langCode) {
|
||||
if (cache[langCode]) {
|
||||
return cache[langCode];
|
||||
}
|
||||
|
||||
var matches = pattern.exec(langCode);
|
||||
if (matches) {
|
||||
cache[langCode] = matches[1];
|
||||
return matches[1];
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
});
|
||||
/**
|
||||
* @ngdoc filter
|
||||
* @module gettext
|
||||
* @name translate
|
||||
* @requires gettextCatalog
|
||||
* @param {String} input translation key
|
||||
* @param {String} context context to evaluate key against
|
||||
* @returns {String} translated string or annotated key
|
||||
* @see {@link doc:context Verb, Noun}
|
||||
* @description Takes key and returns string
|
||||
*
|
||||
* Sometimes it's not an option to use an attribute (e.g. when you want to annotate an attribute value).
|
||||
* There's a `translate` filter available for this purpose.
|
||||
*
|
||||
* ```html
|
||||
* <input type="text" placeholder="{{'Username'|translate}}" />
|
||||
* ```
|
||||
* This filter does not support plural strings.
|
||||
*
|
||||
* You may want to use {@link guide:custom-annotations custom annotations} to avoid using the `translate` filter all the time. * Is
|
||||
*/
|
||||
angular.module('gettext').filter('translate', ["gettextCatalog", function (gettextCatalog) {
|
||||
function filter(input, context) {
|
||||
return gettextCatalog.getString(input, null, context);
|
||||
}
|
||||
filter.$stateful = true;
|
||||
return filter;
|
||||
}]);
|
||||
|
||||
// Do not edit this file, it is autogenerated using genplurals.py!
|
||||
angular.module("gettext").factory("gettextPlurals", function () {
|
||||
var languageCodes = {
|
||||
"pt_BR": "pt_BR",
|
||||
"pt-BR": "pt_BR"
|
||||
};
|
||||
return function (langCode, n) {
|
||||
switch (getLanguageCode(langCode)) {
|
||||
case "ay": // Aymará
|
||||
case "bo": // Tibetan
|
||||
case "cgg": // Chiga
|
||||
case "dz": // Dzongkha
|
||||
case "fa": // Persian
|
||||
case "id": // Indonesian
|
||||
case "ja": // Japanese
|
||||
case "jbo": // Lojban
|
||||
case "ka": // Georgian
|
||||
case "kk": // Kazakh
|
||||
case "km": // Khmer
|
||||
case "ko": // Korean
|
||||
case "ky": // Kyrgyz
|
||||
case "lo": // Lao
|
||||
case "ms": // Malay
|
||||
case "my": // Burmese
|
||||
case "sah": // Yakut
|
||||
case "su": // Sundanese
|
||||
case "th": // Thai
|
||||
case "tt": // Tatar
|
||||
case "ug": // Uyghur
|
||||
case "vi": // Vietnamese
|
||||
case "wo": // Wolof
|
||||
case "zh": // Chinese
|
||||
// 1 form
|
||||
return 0;
|
||||
case "is": // Icelandic
|
||||
// 2 forms
|
||||
return (n%10!=1 || n%100==11) ? 1 : 0;
|
||||
case "jv": // Javanese
|
||||
// 2 forms
|
||||
return n!=0 ? 1 : 0;
|
||||
case "mk": // Macedonian
|
||||
// 2 forms
|
||||
return n==1 || n%10==1 ? 0 : 1;
|
||||
case "ach": // Acholi
|
||||
case "ak": // Akan
|
||||
case "am": // Amharic
|
||||
case "arn": // Mapudungun
|
||||
case "br": // Breton
|
||||
case "fil": // Filipino
|
||||
case "fr": // French
|
||||
case "gun": // Gun
|
||||
case "ln": // Lingala
|
||||
case "mfe": // Mauritian Creole
|
||||
case "mg": // Malagasy
|
||||
case "mi": // Maori
|
||||
case "oc": // Occitan
|
||||
case "pt_BR": // Brazilian Portuguese
|
||||
case "tg": // Tajik
|
||||
case "ti": // Tigrinya
|
||||
case "tr": // Turkish
|
||||
case "uz": // Uzbek
|
||||
case "wa": // Walloon
|
||||
case "zh": // Chinese
|
||||
// 2 forms
|
||||
return n>1 ? 1 : 0;
|
||||
case "lv": // Latvian
|
||||
// 3 forms
|
||||
return (n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);
|
||||
case "lt": // Lithuanian
|
||||
// 3 forms
|
||||
return (n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);
|
||||
case "be": // Belarusian
|
||||
case "bs": // Bosnian
|
||||
case "hr": // Croatian
|
||||
case "ru": // Russian
|
||||
case "sr": // Serbian
|
||||
case "uk": // Ukrainian
|
||||
// 3 forms
|
||||
return (n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);
|
||||
case "mnk": // Mandinka
|
||||
// 3 forms
|
||||
return (n==0 ? 0 : n==1 ? 1 : 2);
|
||||
case "ro": // Romanian
|
||||
// 3 forms
|
||||
return (n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2);
|
||||
case "pl": // Polish
|
||||
// 3 forms
|
||||
return (n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);
|
||||
case "cs": // Czech
|
||||
case "sk": // Slovak
|
||||
// 3 forms
|
||||
return (n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;
|
||||
case "sl": // Slovenian
|
||||
// 4 forms
|
||||
return (n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0);
|
||||
case "mt": // Maltese
|
||||
// 4 forms
|
||||
return (n==1 ? 0 : n==0 || ( n%100>1 && n%100<11) ? 1 : (n%100>10 && n%100<20 ) ? 2 : 3);
|
||||
case "gd": // Scottish Gaelic
|
||||
// 4 forms
|
||||
return (n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3;
|
||||
case "cy": // Welsh
|
||||
// 4 forms
|
||||
return (n==1) ? 0 : (n==2) ? 1 : (n != 8 && n != 11) ? 2 : 3;
|
||||
case "kw": // Cornish
|
||||
// 4 forms
|
||||
return (n==1) ? 0 : (n==2) ? 1 : (n == 3) ? 2 : 3;
|
||||
case "ga": // Irish
|
||||
// 5 forms
|
||||
return n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n<11 ? 3 : 4;
|
||||
case "ar": // Arabic
|
||||
// 6 forms
|
||||
return (n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 ? 4 : 5);
|
||||
default: // Everything else
|
||||
return n != 1 ? 1 : 0;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Method extracts iso639-2 language code from code with locale e.g. pl_PL, en_US, etc.
|
||||
* If it's provided with standalone iso639-2 language code it simply returns it.
|
||||
* @param {String} langCode
|
||||
* @returns {String} iso639-2 language Code
|
||||
*/
|
||||
function getLanguageCode(langCode) {
|
||||
if (!languageCodes[langCode]) {
|
||||
languageCodes[langCode] = langCode.split(/\-|_/).shift();
|
||||
}
|
||||
return languageCodes[langCode];
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @ngdoc factory
|
||||
* @module gettext
|
||||
* @name gettextUtil
|
||||
* @description Utility service for common operations and polyfills.
|
||||
*/
|
||||
angular.module('gettext').factory('gettextUtil', function gettextUtil() {
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextUtil#trim
|
||||
* @public
|
||||
* @param {string} value String to be trimmed.
|
||||
* @description Trim polyfill for old browsers (instead of jQuery). Based on AngularJS-v1.2.2 (angular.js#620).
|
||||
*
|
||||
* Example
|
||||
* ```js
|
||||
* gettextUtil.assert(' no blanks '); // "no blanks"
|
||||
* ```
|
||||
*/
|
||||
var trim = (function () {
|
||||
if (!String.prototype.trim) {
|
||||
return function (value) {
|
||||
return (typeof value === 'string') ? value.replace(/^\s*/, '').replace(/\s*$/, '') : value;
|
||||
};
|
||||
}
|
||||
return function (value) {
|
||||
return (typeof value === 'string') ? value.trim() : value;
|
||||
};
|
||||
})();
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextUtil#assert
|
||||
* @public
|
||||
* @param {bool} condition condition to check
|
||||
* @param {String} missing name of the directive missing attribute
|
||||
* @param {String} found name of attribute that has been used with directive
|
||||
* @description Throws error if condition is not met, which means that directive was used with certain parameter
|
||||
* that requires another one (which is missing).
|
||||
*
|
||||
* Example
|
||||
* ```js
|
||||
* gettextUtil.assert(!attrs.translatePlural || attrs.translateN, 'translate-n', 'translate-plural');
|
||||
* //You should add a translate-n attribute whenever you add a translate-plural attribute.
|
||||
* ```
|
||||
*/
|
||||
function assert(condition, missing, found) {
|
||||
if (!condition) {
|
||||
throw new Error('You should add a ' + missing + ' attribute whenever you add a ' + found + ' attribute.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextUtil#startsWith
|
||||
* @public
|
||||
* @param {string} target String on which checking will occur.
|
||||
* @param {string} query String expected to be at the beginning of target.
|
||||
* @returns {boolean} Returns true if object has no ownProperties. For arrays returns true if length == 0.
|
||||
* @description Checks if string starts with another string.
|
||||
*
|
||||
* Example
|
||||
* ```js
|
||||
* gettextUtil.startsWith('Home sweet home.', 'Home'); //true
|
||||
* gettextUtil.startsWith('Home sweet home.', 'sweet'); //false
|
||||
* ```
|
||||
*/
|
||||
function startsWith(target, query) {
|
||||
return target.indexOf(query) === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name gettextUtil#lcFirst
|
||||
* @public
|
||||
* @param {string} target String to transform.
|
||||
* @returns {string} Strings beginning with lowercase letter.
|
||||
* @description Makes first letter of the string lower case
|
||||
*
|
||||
* Example
|
||||
* ```js
|
||||
* gettextUtil.lcFirst('Home Sweet Home.'); //'home Sweet Home'
|
||||
* gettextUtil.lcFirst('ShouldBeCamelCase.'); //'shouldBeCamelCase'
|
||||
* ```
|
||||
*/
|
||||
function lcFirst(target) {
|
||||
var first = target.charAt(0).toLowerCase();
|
||||
return first + target.substr(1);
|
||||
}
|
||||
|
||||
return {
|
||||
trim: trim,
|
||||
assert: assert,
|
||||
startsWith: startsWith,
|
||||
lcFirst: lcFirst
|
||||
};
|
||||
});
|
1
node_modules/angular-gettext/dist/angular-gettext.min.js
generated
vendored
Normal file
1
node_modules/angular-gettext/dist/angular-gettext.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
45
node_modules/angular-gettext/docs/api/index.ngdoc
generated
vendored
Normal file
45
node_modules/angular-gettext/docs/api/index.ngdoc
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
@ngdoc overview
|
||||
@name angular-gettext
|
||||
@area api
|
||||
@id api-index
|
||||
@description Super-simple translation support for Angular.JS
|
||||
|
||||
## Effortless translations
|
||||
Angular-gettext let's you focus on developing your application.
|
||||
Just write everything in English and annotate which parts should be translated. The tools do the rest.
|
||||
|
||||
Marking a string as translatable is as simple as adding an attribute:
|
||||
```html
|
||||
<a href="/" translate>Home</a>
|
||||
```
|
||||
|
||||
No need to maintain translation codes or magic values, that just causes headaches!
|
||||
|
||||
## Seamless Angular.JS integration
|
||||
Translating your application doesn't mean you have to give up any of the good stuff that Angular.JS provides.
|
||||
Interpolation and everything else we love and are used to just keep on working:
|
||||
|
||||
```html
|
||||
<a href="/" translate>Hello {{name}}</a>
|
||||
```
|
||||
|
||||
And with a minified footprint of less than 4kb, you don't have to worry about the size of your application.
|
||||
Add gzip compression and it amounts to less than 1.5kb.
|
||||
|
||||
## Correct plurals in all languages
|
||||
Not every language works like English. Did you know that Polish uses three plural forms? Or that Irish uses five? No worries, `angular-gettext` handles all of this for you. Just provide a plural string where needed.
|
||||
|
||||
```html
|
||||
<span translate translate-n="msgCount" translate-plural="{{$count}} new messages">1 new message</span>
|
||||
```
|
||||
|
||||
The span above will always show a correctly pluralized message, even if the language uses wildly different pluralization rules.
|
||||
|
||||
A full list of supported languages (over 130) can be found [here](http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html?id=l10n/pluralforms).
|
||||
|
||||
## Rich tool support
|
||||
The widely used [gettext](http://en.wikipedia.org/wiki/Gettext) format is used in `angular-gettext` (hence the name).
|
||||
This means you can use widely established translation tools like [Poedit](http://www.poedit.net/).
|
||||
Or you can use an online translation platform like [Pootle](http://pootle.translatehouse.org/), [Transifex](https://www.transifex.com/), or [Zanata](http://www.zanata.org/).
|
||||
|
||||
The upside of this? Non-technical users can help out by translating. Or you can use professional translation services. Better results, faster.
|
2
node_modules/angular-gettext/index.js
generated
vendored
Normal file
2
node_modules/angular-gettext/index.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
require('./dist/angular-gettext.js');
|
||||
module.exports = 'gettext';
|
83
node_modules/angular-gettext/package.json
generated
vendored
Normal file
83
node_modules/angular-gettext/package.json
generated
vendored
Normal file
@ -0,0 +1,83 @@
|
||||
{
|
||||
"_from": "angular-gettext",
|
||||
"_id": "angular-gettext@2.3.10",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-9xJb8aJ7dnA3wgTeNS87FE25aXw=",
|
||||
"_location": "/angular-gettext",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "tag",
|
||||
"registry": true,
|
||||
"raw": "angular-gettext",
|
||||
"name": "angular-gettext",
|
||||
"escapedName": "angular-gettext",
|
||||
"rawSpec": "",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "latest"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#USER",
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/angular-gettext/-/angular-gettext-2.3.10.tgz",
|
||||
"_shasum": "f7125bf1a27b767037c204de352f3b144db9697c",
|
||||
"_spec": "angular-gettext",
|
||||
"_where": "/home/lrullo/httpdocs/anorgatarrak.eus/wp-content/themes/anorgatarrak",
|
||||
"author": {
|
||||
"name": "Ruben Vermeersch",
|
||||
"email": "ruben@rocketeer.be",
|
||||
"url": "http://rocketeer.be/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/rubenv/angular-gettext/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Gettext support for Angular.js",
|
||||
"devDependencies": {
|
||||
"chai": "^3.5.0",
|
||||
"dgeni-alive": "~0.2.1",
|
||||
"grunt": "~1.0.1",
|
||||
"grunt-bump": "0.8.0",
|
||||
"grunt-contrib-clean": "~1.0.0",
|
||||
"grunt-contrib-concat": "~1.0.0",
|
||||
"grunt-contrib-connect": "~1.0.0",
|
||||
"grunt-contrib-jshint": "~1.0.0",
|
||||
"grunt-contrib-uglify": "~1.0.0",
|
||||
"grunt-contrib-watch": "~1.0.0",
|
||||
"grunt-jscs": "^3.0.0",
|
||||
"grunt-karma": "~2.0.0",
|
||||
"grunt-ng-annotate": "^2.0.2",
|
||||
"grunt-protractor-runner": "^4.0.0",
|
||||
"grunt-shell": "^1.3.0",
|
||||
"karma": "~0.13.22",
|
||||
"karma-chai": "~0.1.0",
|
||||
"karma-firefox-launcher": "~1.0.0",
|
||||
"karma-mocha": "~1.0.1",
|
||||
"karma-phantomjs-launcher": "^1.0.0",
|
||||
"mocha": "^2.5.3",
|
||||
"phantomjs-prebuilt": "^2.1.7",
|
||||
"serve-static": "^1.11.1"
|
||||
},
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"homepage": "http://angular-gettext.rocketeer.be/",
|
||||
"keywords": [
|
||||
"angular",
|
||||
"gettext"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "angular-gettext",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/rubenv/angular-gettext.git"
|
||||
},
|
||||
"scripts": {
|
||||
"prepublish": "grunt build",
|
||||
"test": "grunt ci"
|
||||
},
|
||||
"title": "Angular Gettext",
|
||||
"version": "2.3.10"
|
||||
}
|
4
node_modules/ansi-regex/index.js
generated
vendored
Normal file
4
node_modules/ansi-regex/index.js
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
'use strict';
|
||||
module.exports = function () {
|
||||
return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g;
|
||||
};
|
21
node_modules/ansi-regex/license
generated
vendored
Normal file
21
node_modules/ansi-regex/license
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
109
node_modules/ansi-regex/package.json
generated
vendored
Normal file
109
node_modules/ansi-regex/package.json
generated
vendored
Normal file
@ -0,0 +1,109 @@
|
||||
{
|
||||
"_from": "ansi-regex@^2.0.0",
|
||||
"_id": "ansi-regex@2.1.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
|
||||
"_location": "/ansi-regex",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "ansi-regex@^2.0.0",
|
||||
"name": "ansi-regex",
|
||||
"escapedName": "ansi-regex",
|
||||
"rawSpec": "^2.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^2.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/has-ansi",
|
||||
"/strip-ansi"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
||||
"_shasum": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df",
|
||||
"_spec": "ansi-regex@^2.0.0",
|
||||
"_where": "/home/lrullo/httpdocs/anorgatarrak.eus/wp-content/themes/anorgatarrak/node_modules/has-ansi",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/chalk/ansi-regex/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Regular expression for matching ANSI escape codes",
|
||||
"devDependencies": {
|
||||
"ava": "0.17.0",
|
||||
"xo": "0.16.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/chalk/ansi-regex#readme",
|
||||
"keywords": [
|
||||
"ansi",
|
||||
"styles",
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"string",
|
||||
"tty",
|
||||
"escape",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"command-line",
|
||||
"text",
|
||||
"regex",
|
||||
"regexp",
|
||||
"re",
|
||||
"match",
|
||||
"test",
|
||||
"find",
|
||||
"pattern"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
{
|
||||
"name": "Joshua Appelman",
|
||||
"email": "jappelman@xebia.com",
|
||||
"url": "jbnicolai.com"
|
||||
},
|
||||
{
|
||||
"name": "JD Ballard",
|
||||
"email": "i.am.qix@gmail.com",
|
||||
"url": "github.com/qix-"
|
||||
}
|
||||
],
|
||||
"name": "ansi-regex",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/chalk/ansi-regex.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava --verbose",
|
||||
"view-supported": "node fixtures/view-codes.js"
|
||||
},
|
||||
"version": "2.1.1",
|
||||
"xo": {
|
||||
"rules": {
|
||||
"guard-for-in": 0,
|
||||
"no-loop-func": 0
|
||||
}
|
||||
}
|
||||
}
|
39
node_modules/ansi-regex/readme.md
generated
vendored
Normal file
39
node_modules/ansi-regex/readme.md
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex)
|
||||
|
||||
> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save ansi-regex
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const ansiRegex = require('ansi-regex');
|
||||
|
||||
ansiRegex().test('\u001b[4mcake\u001b[0m');
|
||||
//=> true
|
||||
|
||||
ansiRegex().test('cake');
|
||||
//=> false
|
||||
|
||||
'\u001b[4mcake\u001b[0m'.match(ansiRegex());
|
||||
//=> ['\u001b[4m', '\u001b[0m']
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
||||
### Why do you test for codes not in the ECMA 48 standard?
|
||||
|
||||
Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. If I recall correctly, we test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them.
|
||||
|
||||
On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
65
node_modules/ansi-styles/index.js
generated
vendored
Normal file
65
node_modules/ansi-styles/index.js
generated
vendored
Normal file
@ -0,0 +1,65 @@
|
||||
'use strict';
|
||||
|
||||
function assembleStyles () {
|
||||
var styles = {
|
||||
modifiers: {
|
||||
reset: [0, 0],
|
||||
bold: [1, 22], // 21 isn't widely supported and 22 does the same thing
|
||||
dim: [2, 22],
|
||||
italic: [3, 23],
|
||||
underline: [4, 24],
|
||||
inverse: [7, 27],
|
||||
hidden: [8, 28],
|
||||
strikethrough: [9, 29]
|
||||
},
|
||||
colors: {
|
||||
black: [30, 39],
|
||||
red: [31, 39],
|
||||
green: [32, 39],
|
||||
yellow: [33, 39],
|
||||
blue: [34, 39],
|
||||
magenta: [35, 39],
|
||||
cyan: [36, 39],
|
||||
white: [37, 39],
|
||||
gray: [90, 39]
|
||||
},
|
||||
bgColors: {
|
||||
bgBlack: [40, 49],
|
||||
bgRed: [41, 49],
|
||||
bgGreen: [42, 49],
|
||||
bgYellow: [43, 49],
|
||||
bgBlue: [44, 49],
|
||||
bgMagenta: [45, 49],
|
||||
bgCyan: [46, 49],
|
||||
bgWhite: [47, 49]
|
||||
}
|
||||
};
|
||||
|
||||
// fix humans
|
||||
styles.colors.grey = styles.colors.gray;
|
||||
|
||||
Object.keys(styles).forEach(function (groupName) {
|
||||
var group = styles[groupName];
|
||||
|
||||
Object.keys(group).forEach(function (styleName) {
|
||||
var style = group[styleName];
|
||||
|
||||
styles[styleName] = group[styleName] = {
|
||||
open: '\u001b[' + style[0] + 'm',
|
||||
close: '\u001b[' + style[1] + 'm'
|
||||
};
|
||||
});
|
||||
|
||||
Object.defineProperty(styles, groupName, {
|
||||
value: group,
|
||||
enumerable: false
|
||||
});
|
||||
});
|
||||
|
||||
return styles;
|
||||
}
|
||||
|
||||
Object.defineProperty(module, 'exports', {
|
||||
enumerable: true,
|
||||
get: assembleStyles
|
||||
});
|
21
node_modules/ansi-styles/license
generated
vendored
Normal file
21
node_modules/ansi-styles/license
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
90
node_modules/ansi-styles/package.json
generated
vendored
Normal file
90
node_modules/ansi-styles/package.json
generated
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
{
|
||||
"_from": "ansi-styles@^2.2.1",
|
||||
"_id": "ansi-styles@2.2.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
|
||||
"_location": "/ansi-styles",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "ansi-styles@^2.2.1",
|
||||
"name": "ansi-styles",
|
||||
"escapedName": "ansi-styles",
|
||||
"rawSpec": "^2.2.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^2.2.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/chalk"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
|
||||
"_shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe",
|
||||
"_spec": "ansi-styles@^2.2.1",
|
||||
"_where": "/home/lrullo/httpdocs/anorgatarrak.eus/wp-content/themes/anorgatarrak/node_modules/chalk",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/chalk/ansi-styles/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "ANSI escape codes for styling strings in the terminal",
|
||||
"devDependencies": {
|
||||
"mocha": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/chalk/ansi-styles#readme",
|
||||
"keywords": [
|
||||
"ansi",
|
||||
"styles",
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"string",
|
||||
"tty",
|
||||
"escape",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"log",
|
||||
"logging",
|
||||
"command-line",
|
||||
"text"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
{
|
||||
"name": "Joshua Appelman",
|
||||
"email": "jappelman@xebia.com",
|
||||
"url": "jbnicolai.com"
|
||||
}
|
||||
],
|
||||
"name": "ansi-styles",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/chalk/ansi-styles.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"version": "2.2.1"
|
||||
}
|
86
node_modules/ansi-styles/readme.md
generated
vendored
Normal file
86
node_modules/ansi-styles/readme.md
generated
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles)
|
||||
|
||||
> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
|
||||
|
||||
You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
|
||||
|
||||
![](screenshot.png)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save ansi-styles
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var ansi = require('ansi-styles');
|
||||
|
||||
console.log(ansi.green.open + 'Hello world!' + ansi.green.close);
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
Each style has an `open` and `close` property.
|
||||
|
||||
|
||||
## Styles
|
||||
|
||||
### Modifiers
|
||||
|
||||
- `reset`
|
||||
- `bold`
|
||||
- `dim`
|
||||
- `italic` *(not widely supported)*
|
||||
- `underline`
|
||||
- `inverse`
|
||||
- `hidden`
|
||||
- `strikethrough` *(not widely supported)*
|
||||
|
||||
### Colors
|
||||
|
||||
- `black`
|
||||
- `red`
|
||||
- `green`
|
||||
- `yellow`
|
||||
- `blue`
|
||||
- `magenta`
|
||||
- `cyan`
|
||||
- `white`
|
||||
- `gray`
|
||||
|
||||
### Background colors
|
||||
|
||||
- `bgBlack`
|
||||
- `bgRed`
|
||||
- `bgGreen`
|
||||
- `bgYellow`
|
||||
- `bgBlue`
|
||||
- `bgMagenta`
|
||||
- `bgCyan`
|
||||
- `bgWhite`
|
||||
|
||||
|
||||
## Advanced usage
|
||||
|
||||
By default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
|
||||
|
||||
- `ansi.modifiers`
|
||||
- `ansi.colors`
|
||||
- `ansi.bgColors`
|
||||
|
||||
|
||||
###### Example
|
||||
|
||||
```js
|
||||
console.log(ansi.colors.green.open);
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
185
node_modules/argparse/CHANGELOG.md
generated
vendored
Normal file
185
node_modules/argparse/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,185 @@
|
||||
1.0.10 / 2018-02-15
|
||||
------------------
|
||||
|
||||
- Use .concat instead of + for arrays, #122.
|
||||
|
||||
|
||||
1.0.9 / 2016-09-29
|
||||
------------------
|
||||
|
||||
- Rerelease after 1.0.8 - deps cleanup.
|
||||
|
||||
|
||||
1.0.8 / 2016-09-29
|
||||
------------------
|
||||
|
||||
- Maintenance (deps bump, fix node 6.5+ tests, coverage report).
|
||||
|
||||
|
||||
1.0.7 / 2016-03-17
|
||||
------------------
|
||||
|
||||
- Teach `addArgument` to accept string arg names. #97, @tomxtobin.
|
||||
|
||||
|
||||
1.0.6 / 2016-02-06
|
||||
------------------
|
||||
|
||||
- Maintenance: moved to eslint & updated CS.
|
||||
|
||||
|
||||
1.0.5 / 2016-02-05
|
||||
------------------
|
||||
|
||||
- Removed lodash dependency to significantly reduce install size.
|
||||
Thanks to @mourner.
|
||||
|
||||
|
||||
1.0.4 / 2016-01-17
|
||||
------------------
|
||||
|
||||
- Maintenance: lodash update to 4.0.0.
|
||||
|
||||
|
||||
1.0.3 / 2015-10-27
|
||||
------------------
|
||||
|
||||
- Fix parse `=` in args: `--examplepath="C:\myfolder\env=x64"`. #84, @CatWithApple.
|
||||
|
||||
|
||||
1.0.2 / 2015-03-22
|
||||
------------------
|
||||
|
||||
- Relaxed lodash version dependency.
|
||||
|
||||
|
||||
1.0.1 / 2015-02-20
|
||||
------------------
|
||||
|
||||
- Changed dependencies to be compatible with ancient nodejs.
|
||||
|
||||
|
||||
1.0.0 / 2015-02-19
|
||||
------------------
|
||||
|
||||
- Maintenance release.
|
||||
- Replaced `underscore` with `lodash`.
|
||||
- Bumped version to 1.0.0 to better reflect semver meaning.
|
||||
- HISTORY.md -> CHANGELOG.md
|
||||
|
||||
|
||||
0.1.16 / 2013-12-01
|
||||
-------------------
|
||||
|
||||
- Maintenance release. Updated dependencies and docs.
|
||||
|
||||
|
||||
0.1.15 / 2013-05-13
|
||||
-------------------
|
||||
|
||||
- Fixed #55, @trebor89
|
||||
|
||||
|
||||
0.1.14 / 2013-05-12
|
||||
-------------------
|
||||
|
||||
- Fixed #62, @maxtaco
|
||||
|
||||
|
||||
0.1.13 / 2013-04-08
|
||||
-------------------
|
||||
|
||||
- Added `.npmignore` to reduce package size
|
||||
|
||||
|
||||
0.1.12 / 2013-02-10
|
||||
-------------------
|
||||
|
||||
- Fixed conflictHandler (#46), @hpaulj
|
||||
|
||||
|
||||
0.1.11 / 2013-02-07
|
||||
-------------------
|
||||
|
||||
- Multiple bugfixes, @hpaulj
|
||||
- Added 70+ tests (ported from python), @hpaulj
|
||||
- Added conflictHandler, @applepicke
|
||||
- Added fromfilePrefixChar, @hpaulj
|
||||
|
||||
|
||||
0.1.10 / 2012-12-30
|
||||
-------------------
|
||||
|
||||
- Added [mutual exclusion](http://docs.python.org/dev/library/argparse.html#mutual-exclusion)
|
||||
support, thanks to @hpaulj
|
||||
- Fixed options check for `storeConst` & `appendConst` actions, thanks to @hpaulj
|
||||
|
||||
|
||||
0.1.9 / 2012-12-27
|
||||
------------------
|
||||
|
||||
- Fixed option dest interferens with other options (issue #23), thanks to @hpaulj
|
||||
- Fixed default value behavior with `*` positionals, thanks to @hpaulj
|
||||
- Improve `getDefault()` behavior, thanks to @hpaulj
|
||||
- Imrove negative argument parsing, thanks to @hpaulj
|
||||
|
||||
|
||||
0.1.8 / 2012-12-01
|
||||
------------------
|
||||
|
||||
- Fixed parser parents (issue #19), thanks to @hpaulj
|
||||
- Fixed negative argument parse (issue #20), thanks to @hpaulj
|
||||
|
||||
|
||||
0.1.7 / 2012-10-14
|
||||
------------------
|
||||
|
||||
- Fixed 'choices' argument parse (issue #16)
|
||||
- Fixed stderr output (issue #15)
|
||||
|
||||
|
||||
0.1.6 / 2012-09-09
|
||||
------------------
|
||||
|
||||
- Fixed check for conflict of options (thanks to @tomxtobin)
|
||||
|
||||
|
||||
0.1.5 / 2012-09-03
|
||||
------------------
|
||||
|
||||
- Fix parser #setDefaults method (thanks to @tomxtobin)
|
||||
|
||||
|
||||
0.1.4 / 2012-07-30
|
||||
------------------
|
||||
|
||||
- Fixed pseudo-argument support (thanks to @CGamesPlay)
|
||||
- Fixed addHelp default (should be true), if not set (thanks to @benblank)
|
||||
|
||||
|
||||
0.1.3 / 2012-06-27
|
||||
------------------
|
||||
|
||||
- Fixed formatter api name: Formatter -> HelpFormatter
|
||||
|
||||
|
||||
0.1.2 / 2012-05-29
|
||||
------------------
|
||||
|
||||
- Added basic tests
|
||||
- Removed excess whitespace in help
|
||||
- Fixed error reporting, when parcer with subcommands
|
||||
called with empty arguments
|
||||
|
||||
|
||||
0.1.1 / 2012-05-23
|
||||
------------------
|
||||
|
||||
- Fixed line wrapping in help formatter
|
||||
- Added better error reporting on invalid arguments
|
||||
|
||||
|
||||
0.1.0 / 2012-05-16
|
||||
------------------
|
||||
|
||||
- First release.
|
21
node_modules/argparse/LICENSE
generated
vendored
Normal file
21
node_modules/argparse/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (C) 2012 by Vitaly Puzrin
|
||||
|
||||
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.
|
257
node_modules/argparse/README.md
generated
vendored
Normal file
257
node_modules/argparse/README.md
generated
vendored
Normal file
@ -0,0 +1,257 @@
|
||||
argparse
|
||||
========
|
||||
|
||||
[![Build Status](https://secure.travis-ci.org/nodeca/argparse.svg?branch=master)](http://travis-ci.org/nodeca/argparse)
|
||||
[![NPM version](https://img.shields.io/npm/v/argparse.svg)](https://www.npmjs.org/package/argparse)
|
||||
|
||||
CLI arguments parser for node.js. Javascript port of python's
|
||||
[argparse](http://docs.python.org/dev/library/argparse.html) module
|
||||
(original version 3.2). That's a full port, except some very rare options,
|
||||
recorded in issue tracker.
|
||||
|
||||
**NB. Difference with original.**
|
||||
|
||||
- Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/).
|
||||
- Use `defaultValue` instead of `default`.
|
||||
- Use `argparse.Const.REMAINDER` instead of `argparse.REMAINDER`, and
|
||||
similarly for constant values `OPTIONAL`, `ZERO_OR_MORE`, and `ONE_OR_MORE`
|
||||
(aliases for `nargs` values `'?'`, `'*'`, `'+'`, respectively), and
|
||||
`SUPPRESS`.
|
||||
|
||||
|
||||
Example
|
||||
=======
|
||||
|
||||
test.js file:
|
||||
|
||||
```javascript
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
var ArgumentParser = require('../lib/argparse').ArgumentParser;
|
||||
var parser = new ArgumentParser({
|
||||
version: '0.0.1',
|
||||
addHelp:true,
|
||||
description: 'Argparse example'
|
||||
});
|
||||
parser.addArgument(
|
||||
[ '-f', '--foo' ],
|
||||
{
|
||||
help: 'foo bar'
|
||||
}
|
||||
);
|
||||
parser.addArgument(
|
||||
[ '-b', '--bar' ],
|
||||
{
|
||||
help: 'bar foo'
|
||||
}
|
||||
);
|
||||
parser.addArgument(
|
||||
'--baz',
|
||||
{
|
||||
help: 'baz bar'
|
||||
}
|
||||
);
|
||||
var args = parser.parseArgs();
|
||||
console.dir(args);
|
||||
```
|
||||
|
||||
Display help:
|
||||
|
||||
```
|
||||
$ ./test.js -h
|
||||
usage: example.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ]
|
||||
|
||||
Argparse example
|
||||
|
||||
Optional arguments:
|
||||
-h, --help Show this help message and exit.
|
||||
-v, --version Show program's version number and exit.
|
||||
-f FOO, --foo FOO foo bar
|
||||
-b BAR, --bar BAR bar foo
|
||||
--baz BAZ baz bar
|
||||
```
|
||||
|
||||
Parse arguments:
|
||||
|
||||
```
|
||||
$ ./test.js -f=3 --bar=4 --baz 5
|
||||
{ foo: '3', bar: '4', baz: '5' }
|
||||
```
|
||||
|
||||
More [examples](https://github.com/nodeca/argparse/tree/master/examples).
|
||||
|
||||
|
||||
ArgumentParser objects
|
||||
======================
|
||||
|
||||
```
|
||||
new ArgumentParser({parameters hash});
|
||||
```
|
||||
|
||||
Creates a new ArgumentParser object.
|
||||
|
||||
**Supported params:**
|
||||
|
||||
- ```description``` - Text to display before the argument help.
|
||||
- ```epilog``` - Text to display after the argument help.
|
||||
- ```addHelp``` - Add a -h/–help option to the parser. (default: true)
|
||||
- ```argumentDefault``` - Set the global default value for arguments. (default: null)
|
||||
- ```parents``` - A list of ArgumentParser objects whose arguments should also be included.
|
||||
- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘)
|
||||
- ```formatterClass``` - A class for customizing the help output.
|
||||
- ```prog``` - The name of the program (default: `path.basename(process.argv[1])`)
|
||||
- ```usage``` - The string describing the program usage (default: generated)
|
||||
- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals.
|
||||
|
||||
**Not supported yet**
|
||||
|
||||
- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read.
|
||||
|
||||
|
||||
Details in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects)
|
||||
|
||||
|
||||
addArgument() method
|
||||
====================
|
||||
|
||||
```
|
||||
ArgumentParser.addArgument(name or flag or [name] or [flags...], {options})
|
||||
```
|
||||
|
||||
Defines how a single command-line argument should be parsed.
|
||||
|
||||
- ```name or flag or [name] or [flags...]``` - Either a positional name
|
||||
(e.g., `'foo'`), a single option (e.g., `'-f'` or `'--foo'`), an array
|
||||
of a single positional name (e.g., `['foo']`), or an array of options
|
||||
(e.g., `['-f', '--foo']`).
|
||||
|
||||
Options:
|
||||
|
||||
- ```action``` - The basic type of action to be taken when this argument is encountered at the command line.
|
||||
- ```nargs```- The number of command-line arguments that should be consumed.
|
||||
- ```constant``` - A constant value required by some action and nargs selections.
|
||||
- ```defaultValue``` - The value produced if the argument is absent from the command line.
|
||||
- ```type``` - The type to which the command-line argument should be converted.
|
||||
- ```choices``` - A container of the allowable values for the argument.
|
||||
- ```required``` - Whether or not the command-line option may be omitted (optionals only).
|
||||
- ```help``` - A brief description of what the argument does.
|
||||
- ```metavar``` - A name for the argument in usage messages.
|
||||
- ```dest``` - The name of the attribute to be added to the object returned by parseArgs().
|
||||
|
||||
Details in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method)
|
||||
|
||||
|
||||
Action (some details)
|
||||
================
|
||||
|
||||
ArgumentParser objects associate command-line arguments with actions.
|
||||
These actions can do just about anything with the command-line arguments associated
|
||||
with them, though most actions simply add an attribute to the object returned by
|
||||
parseArgs(). The action keyword argument specifies how the command-line arguments
|
||||
should be handled. The supported actions are:
|
||||
|
||||
- ```store``` - Just stores the argument’s value. This is the default action.
|
||||
- ```storeConst``` - Stores value, specified by the const keyword argument.
|
||||
(Note that the const keyword argument defaults to the rather unhelpful None.)
|
||||
The 'storeConst' action is most commonly used with optional arguments, that
|
||||
specify some sort of flag.
|
||||
- ```storeTrue``` and ```storeFalse``` - Stores values True and False
|
||||
respectively. These are special cases of 'storeConst'.
|
||||
- ```append``` - Stores a list, and appends each argument value to the list.
|
||||
This is useful to allow an option to be specified multiple times.
|
||||
- ```appendConst``` - Stores a list, and appends value, specified by the
|
||||
const keyword argument to the list. (Note, that the const keyword argument defaults
|
||||
is None.) The 'appendConst' action is typically used when multiple arguments need
|
||||
to store constants to the same list.
|
||||
- ```count``` - Counts the number of times a keyword argument occurs. For example,
|
||||
used for increasing verbosity levels.
|
||||
- ```help``` - Prints a complete help message for all the options in the current
|
||||
parser and then exits. By default a help action is automatically added to the parser.
|
||||
See ArgumentParser for details of how the output is created.
|
||||
- ```version``` - Prints version information and exit. Expects a `version=`
|
||||
keyword argument in the addArgument() call.
|
||||
|
||||
Details in [original action guide](http://docs.python.org/dev/library/argparse.html#action)
|
||||
|
||||
|
||||
Sub-commands
|
||||
============
|
||||
|
||||
ArgumentParser.addSubparsers()
|
||||
|
||||
Many programs split their functionality into a number of sub-commands, for
|
||||
example, the svn program can invoke sub-commands like `svn checkout`, `svn update`,
|
||||
and `svn commit`. Splitting up functionality this way can be a particularly good
|
||||
idea when a program performs several different functions which require different
|
||||
kinds of command-line arguments. `ArgumentParser` supports creation of such
|
||||
sub-commands with `addSubparsers()` method. The `addSubparsers()` method is
|
||||
normally called with no arguments and returns an special action object.
|
||||
This object has a single method `addParser()`, which takes a command name and
|
||||
any `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object
|
||||
that can be modified as usual.
|
||||
|
||||
Example:
|
||||
|
||||
sub_commands.js
|
||||
```javascript
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
var ArgumentParser = require('../lib/argparse').ArgumentParser;
|
||||
var parser = new ArgumentParser({
|
||||
version: '0.0.1',
|
||||
addHelp:true,
|
||||
description: 'Argparse examples: sub-commands',
|
||||
});
|
||||
|
||||
var subparsers = parser.addSubparsers({
|
||||
title:'subcommands',
|
||||
dest:"subcommand_name"
|
||||
});
|
||||
|
||||
var bar = subparsers.addParser('c1', {addHelp:true});
|
||||
bar.addArgument(
|
||||
[ '-f', '--foo' ],
|
||||
{
|
||||
action: 'store',
|
||||
help: 'foo3 bar3'
|
||||
}
|
||||
);
|
||||
var bar = subparsers.addParser(
|
||||
'c2',
|
||||
{aliases:['co'], addHelp:true}
|
||||
);
|
||||
bar.addArgument(
|
||||
[ '-b', '--bar' ],
|
||||
{
|
||||
action: 'store',
|
||||
type: 'int',
|
||||
help: 'foo3 bar3'
|
||||
}
|
||||
);
|
||||
|
||||
var args = parser.parseArgs();
|
||||
console.dir(args);
|
||||
|
||||
```
|
||||
|
||||
Details in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands)
|
||||
|
||||
|
||||
Contributors
|
||||
============
|
||||
|
||||
- [Eugene Shkuropat](https://github.com/shkuropat)
|
||||
- [Paul Jacobson](https://github.com/hpaulj)
|
||||
|
||||
[others](https://github.com/nodeca/argparse/graphs/contributors)
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
Copyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin).
|
||||
Released under the MIT license. See
|
||||
[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details.
|
||||
|
||||
|
3
node_modules/argparse/index.js
generated
vendored
Normal file
3
node_modules/argparse/index.js
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./lib/argparse');
|
146
node_modules/argparse/lib/action.js
generated
vendored
Normal file
146
node_modules/argparse/lib/action.js
generated
vendored
Normal file
@ -0,0 +1,146 @@
|
||||
/**
|
||||
* class Action
|
||||
*
|
||||
* Base class for all actions
|
||||
* Do not call in your code, use this class only for inherits your own action
|
||||
*
|
||||
* Information about how to convert command line strings to Javascript objects.
|
||||
* Action objects are used by an ArgumentParser to represent the information
|
||||
* needed to parse a single argument from one or more strings from the command
|
||||
* line. The keyword arguments to the Action constructor are also all attributes
|
||||
* of Action instances.
|
||||
*
|
||||
* ##### Allowed keywords:
|
||||
*
|
||||
* - `store`
|
||||
* - `storeConstant`
|
||||
* - `storeTrue`
|
||||
* - `storeFalse`
|
||||
* - `append`
|
||||
* - `appendConstant`
|
||||
* - `count`
|
||||
* - `help`
|
||||
* - `version`
|
||||
*
|
||||
* Information about action options see [[Action.new]]
|
||||
*
|
||||
* See also [original guide](http://docs.python.org/dev/library/argparse.html#action)
|
||||
*
|
||||
**/
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
// Constants
|
||||
var c = require('./const');
|
||||
|
||||
|
||||
/**
|
||||
* new Action(options)
|
||||
*
|
||||
* Base class for all actions. Used only for inherits
|
||||
*
|
||||
*
|
||||
* ##### Options:
|
||||
*
|
||||
* - `optionStrings` A list of command-line option strings for the action.
|
||||
* - `dest` Attribute to hold the created object(s)
|
||||
* - `nargs` The number of command-line arguments that should be consumed.
|
||||
* By default, one argument will be consumed and a single value will be
|
||||
* produced.
|
||||
* - `constant` Default value for an action with no value.
|
||||
* - `defaultValue` The value to be produced if the option is not specified.
|
||||
* - `type` Cast to 'string'|'int'|'float'|'complex'|function (string). If
|
||||
* None, 'string'.
|
||||
* - `choices` The choices available.
|
||||
* - `required` True if the action must always be specified at the command
|
||||
* line.
|
||||
* - `help` The help describing the argument.
|
||||
* - `metavar` The name to be used for the option's argument with the help
|
||||
* string. If None, the 'dest' value will be used as the name.
|
||||
*
|
||||
* ##### nargs supported values:
|
||||
*
|
||||
* - `N` (an integer) consumes N arguments (and produces a list)
|
||||
* - `?` consumes zero or one arguments
|
||||
* - `*` consumes zero or more arguments (and produces a list)
|
||||
* - `+` consumes one or more arguments (and produces a list)
|
||||
*
|
||||
* Note: that the difference between the default and nargs=1 is that with the
|
||||
* default, a single value will be produced, while with nargs=1, a list
|
||||
* containing a single value will be produced.
|
||||
**/
|
||||
var Action = module.exports = function Action(options) {
|
||||
options = options || {};
|
||||
this.optionStrings = options.optionStrings || [];
|
||||
this.dest = options.dest;
|
||||
this.nargs = typeof options.nargs !== 'undefined' ? options.nargs : null;
|
||||
this.constant = typeof options.constant !== 'undefined' ? options.constant : null;
|
||||
this.defaultValue = options.defaultValue;
|
||||
this.type = typeof options.type !== 'undefined' ? options.type : null;
|
||||
this.choices = typeof options.choices !== 'undefined' ? options.choices : null;
|
||||
this.required = typeof options.required !== 'undefined' ? options.required : false;
|
||||
this.help = typeof options.help !== 'undefined' ? options.help : null;
|
||||
this.metavar = typeof options.metavar !== 'undefined' ? options.metavar : null;
|
||||
|
||||
if (!(this.optionStrings instanceof Array)) {
|
||||
throw new Error('optionStrings should be an array');
|
||||
}
|
||||
if (typeof this.required !== 'undefined' && typeof this.required !== 'boolean') {
|
||||
throw new Error('required should be a boolean');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Action#getName -> String
|
||||
*
|
||||
* Tells action name
|
||||
**/
|
||||
Action.prototype.getName = function () {
|
||||
if (this.optionStrings.length > 0) {
|
||||
return this.optionStrings.join('/');
|
||||
} else if (this.metavar !== null && this.metavar !== c.SUPPRESS) {
|
||||
return this.metavar;
|
||||
} else if (typeof this.dest !== 'undefined' && this.dest !== c.SUPPRESS) {
|
||||
return this.dest;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Action#isOptional -> Boolean
|
||||
*
|
||||
* Return true if optional
|
||||
**/
|
||||
Action.prototype.isOptional = function () {
|
||||
return !this.isPositional();
|
||||
};
|
||||
|
||||
/**
|
||||
* Action#isPositional -> Boolean
|
||||
*
|
||||
* Return true if positional
|
||||
**/
|
||||
Action.prototype.isPositional = function () {
|
||||
return (this.optionStrings.length === 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* Action#call(parser, namespace, values, optionString) -> Void
|
||||
* - parser (ArgumentParser): current parser
|
||||
* - namespace (Namespace): namespace for output data
|
||||
* - values (Array): parsed values
|
||||
* - optionString (Array): input option string(not parsed)
|
||||
*
|
||||
* Call the action. Should be implemented in inherited classes
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* ActionCount.prototype.call = function (parser, namespace, values, optionString) {
|
||||
* namespace.set(this.dest, (namespace[this.dest] || 0) + 1);
|
||||
* };
|
||||
*
|
||||
**/
|
||||
Action.prototype.call = function () {
|
||||
throw new Error('.call() not defined');// Not Implemented error
|
||||
};
|
53
node_modules/argparse/lib/action/append.js
generated
vendored
Normal file
53
node_modules/argparse/lib/action/append.js
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
/*:nodoc:*
|
||||
* class ActionAppend
|
||||
*
|
||||
* This action stores a list, and appends each argument value to the list.
|
||||
* This is useful to allow an option to be specified multiple times.
|
||||
* This class inherided from [[Action]]
|
||||
*
|
||||
**/
|
||||
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var Action = require('../action');
|
||||
|
||||
// Constants
|
||||
var c = require('../const');
|
||||
|
||||
/*:nodoc:*
|
||||
* new ActionAppend(options)
|
||||
* - options (object): options hash see [[Action.new]]
|
||||
*
|
||||
* Note: options.nargs should be optional for constants
|
||||
* and more then zero for other
|
||||
**/
|
||||
var ActionAppend = module.exports = function ActionAppend(options) {
|
||||
options = options || {};
|
||||
if (this.nargs <= 0) {
|
||||
throw new Error('nargs for append actions must be > 0; if arg ' +
|
||||
'strings are not supplying the value to append, ' +
|
||||
'the append const action may be more appropriate');
|
||||
}
|
||||
if (!!this.constant && this.nargs !== c.OPTIONAL) {
|
||||
throw new Error('nargs must be OPTIONAL to supply const');
|
||||
}
|
||||
Action.call(this, options);
|
||||
};
|
||||
util.inherits(ActionAppend, Action);
|
||||
|
||||
/*:nodoc:*
|
||||
* ActionAppend#call(parser, namespace, values, optionString) -> Void
|
||||
* - parser (ArgumentParser): current parser
|
||||
* - namespace (Namespace): namespace for output data
|
||||
* - values (Array): parsed values
|
||||
* - optionString (Array): input option string(not parsed)
|
||||
*
|
||||
* Call the action. Save result in namespace object
|
||||
**/
|
||||
ActionAppend.prototype.call = function (parser, namespace, values) {
|
||||
var items = (namespace[this.dest] || []).slice();
|
||||
items.push(values);
|
||||
namespace.set(this.dest, items);
|
||||
};
|
47
node_modules/argparse/lib/action/append/constant.js
generated
vendored
Normal file
47
node_modules/argparse/lib/action/append/constant.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
/*:nodoc:*
|
||||
* class ActionAppendConstant
|
||||
*
|
||||
* This stores a list, and appends the value specified by
|
||||
* the const keyword argument to the list.
|
||||
* (Note that the const keyword argument defaults to null.)
|
||||
* The 'appendConst' action is typically useful when multiple
|
||||
* arguments need to store constants to the same list.
|
||||
*
|
||||
* This class inherited from [[Action]]
|
||||
**/
|
||||
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var Action = require('../../action');
|
||||
|
||||
/*:nodoc:*
|
||||
* new ActionAppendConstant(options)
|
||||
* - options (object): options hash see [[Action.new]]
|
||||
*
|
||||
**/
|
||||
var ActionAppendConstant = module.exports = function ActionAppendConstant(options) {
|
||||
options = options || {};
|
||||
options.nargs = 0;
|
||||
if (typeof options.constant === 'undefined') {
|
||||
throw new Error('constant option is required for appendAction');
|
||||
}
|
||||
Action.call(this, options);
|
||||
};
|
||||
util.inherits(ActionAppendConstant, Action);
|
||||
|
||||
/*:nodoc:*
|
||||
* ActionAppendConstant#call(parser, namespace, values, optionString) -> Void
|
||||
* - parser (ArgumentParser): current parser
|
||||
* - namespace (Namespace): namespace for output data
|
||||
* - values (Array): parsed values
|
||||
* - optionString (Array): input option string(not parsed)
|
||||
*
|
||||
* Call the action. Save result in namespace object
|
||||
**/
|
||||
ActionAppendConstant.prototype.call = function (parser, namespace) {
|
||||
var items = [].concat(namespace[this.dest] || []);
|
||||
items.push(this.constant);
|
||||
namespace.set(this.dest, items);
|
||||
};
|
40
node_modules/argparse/lib/action/count.js
generated
vendored
Normal file
40
node_modules/argparse/lib/action/count.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
/*:nodoc:*
|
||||
* class ActionCount
|
||||
*
|
||||
* This counts the number of times a keyword argument occurs.
|
||||
* For example, this is useful for increasing verbosity levels
|
||||
*
|
||||
* This class inherided from [[Action]]
|
||||
*
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var Action = require('../action');
|
||||
|
||||
/*:nodoc:*
|
||||
* new ActionCount(options)
|
||||
* - options (object): options hash see [[Action.new]]
|
||||
*
|
||||
**/
|
||||
var ActionCount = module.exports = function ActionCount(options) {
|
||||
options = options || {};
|
||||
options.nargs = 0;
|
||||
|
||||
Action.call(this, options);
|
||||
};
|
||||
util.inherits(ActionCount, Action);
|
||||
|
||||
/*:nodoc:*
|
||||
* ActionCount#call(parser, namespace, values, optionString) -> Void
|
||||
* - parser (ArgumentParser): current parser
|
||||
* - namespace (Namespace): namespace for output data
|
||||
* - values (Array): parsed values
|
||||
* - optionString (Array): input option string(not parsed)
|
||||
*
|
||||
* Call the action. Save result in namespace object
|
||||
**/
|
||||
ActionCount.prototype.call = function (parser, namespace) {
|
||||
namespace.set(this.dest, (namespace[this.dest] || 0) + 1);
|
||||
};
|
47
node_modules/argparse/lib/action/help.js
generated
vendored
Normal file
47
node_modules/argparse/lib/action/help.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
/*:nodoc:*
|
||||
* class ActionHelp
|
||||
*
|
||||
* Support action for printing help
|
||||
* This class inherided from [[Action]]
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var Action = require('../action');
|
||||
|
||||
// Constants
|
||||
var c = require('../const');
|
||||
|
||||
/*:nodoc:*
|
||||
* new ActionHelp(options)
|
||||
* - options (object): options hash see [[Action.new]]
|
||||
*
|
||||
**/
|
||||
var ActionHelp = module.exports = function ActionHelp(options) {
|
||||
options = options || {};
|
||||
if (options.defaultValue !== null) {
|
||||
options.defaultValue = options.defaultValue;
|
||||
} else {
|
||||
options.defaultValue = c.SUPPRESS;
|
||||
}
|
||||
options.dest = (options.dest !== null ? options.dest : c.SUPPRESS);
|
||||
options.nargs = 0;
|
||||
Action.call(this, options);
|
||||
|
||||
};
|
||||
util.inherits(ActionHelp, Action);
|
||||
|
||||
/*:nodoc:*
|
||||
* ActionHelp#call(parser, namespace, values, optionString)
|
||||
* - parser (ArgumentParser): current parser
|
||||
* - namespace (Namespace): namespace for output data
|
||||
* - values (Array): parsed values
|
||||
* - optionString (Array): input option string(not parsed)
|
||||
*
|
||||
* Print help and exit
|
||||
**/
|
||||
ActionHelp.prototype.call = function (parser) {
|
||||
parser.printHelp();
|
||||
parser.exit();
|
||||
};
|
50
node_modules/argparse/lib/action/store.js
generated
vendored
Normal file
50
node_modules/argparse/lib/action/store.js
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
/*:nodoc:*
|
||||
* class ActionStore
|
||||
*
|
||||
* This action just stores the argument’s value. This is the default action.
|
||||
*
|
||||
* This class inherited from [[Action]]
|
||||
*
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var Action = require('../action');
|
||||
|
||||
// Constants
|
||||
var c = require('../const');
|
||||
|
||||
|
||||
/*:nodoc:*
|
||||
* new ActionStore(options)
|
||||
* - options (object): options hash see [[Action.new]]
|
||||
*
|
||||
**/
|
||||
var ActionStore = module.exports = function ActionStore(options) {
|
||||
options = options || {};
|
||||
if (this.nargs <= 0) {
|
||||
throw new Error('nargs for store actions must be > 0; if you ' +
|
||||
'have nothing to store, actions such as store ' +
|
||||
'true or store const may be more appropriate');
|
||||
|
||||
}
|
||||
if (typeof this.constant !== 'undefined' && this.nargs !== c.OPTIONAL) {
|
||||
throw new Error('nargs must be OPTIONAL to supply const');
|
||||
}
|
||||
Action.call(this, options);
|
||||
};
|
||||
util.inherits(ActionStore, Action);
|
||||
|
||||
/*:nodoc:*
|
||||
* ActionStore#call(parser, namespace, values, optionString) -> Void
|
||||
* - parser (ArgumentParser): current parser
|
||||
* - namespace (Namespace): namespace for output data
|
||||
* - values (Array): parsed values
|
||||
* - optionString (Array): input option string(not parsed)
|
||||
*
|
||||
* Call the action. Save result in namespace object
|
||||
**/
|
||||
ActionStore.prototype.call = function (parser, namespace, values) {
|
||||
namespace.set(this.dest, values);
|
||||
};
|
43
node_modules/argparse/lib/action/store/constant.js
generated
vendored
Normal file
43
node_modules/argparse/lib/action/store/constant.js
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
/*:nodoc:*
|
||||
* class ActionStoreConstant
|
||||
*
|
||||
* This action stores the value specified by the const keyword argument.
|
||||
* (Note that the const keyword argument defaults to the rather unhelpful null.)
|
||||
* The 'store_const' action is most commonly used with optional
|
||||
* arguments that specify some sort of flag.
|
||||
*
|
||||
* This class inherited from [[Action]]
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var Action = require('../../action');
|
||||
|
||||
/*:nodoc:*
|
||||
* new ActionStoreConstant(options)
|
||||
* - options (object): options hash see [[Action.new]]
|
||||
*
|
||||
**/
|
||||
var ActionStoreConstant = module.exports = function ActionStoreConstant(options) {
|
||||
options = options || {};
|
||||
options.nargs = 0;
|
||||
if (typeof options.constant === 'undefined') {
|
||||
throw new Error('constant option is required for storeAction');
|
||||
}
|
||||
Action.call(this, options);
|
||||
};
|
||||
util.inherits(ActionStoreConstant, Action);
|
||||
|
||||
/*:nodoc:*
|
||||
* ActionStoreConstant#call(parser, namespace, values, optionString) -> Void
|
||||
* - parser (ArgumentParser): current parser
|
||||
* - namespace (Namespace): namespace for output data
|
||||
* - values (Array): parsed values
|
||||
* - optionString (Array): input option string(not parsed)
|
||||
*
|
||||
* Call the action. Save result in namespace object
|
||||
**/
|
||||
ActionStoreConstant.prototype.call = function (parser, namespace) {
|
||||
namespace.set(this.dest, this.constant);
|
||||
};
|
27
node_modules/argparse/lib/action/store/false.js
generated
vendored
Normal file
27
node_modules/argparse/lib/action/store/false.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
/*:nodoc:*
|
||||
* class ActionStoreFalse
|
||||
*
|
||||
* This action store the values False respectively.
|
||||
* This is special cases of 'storeConst'
|
||||
*
|
||||
* This class inherited from [[Action]]
|
||||
**/
|
||||
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var ActionStoreConstant = require('./constant');
|
||||
|
||||
/*:nodoc:*
|
||||
* new ActionStoreFalse(options)
|
||||
* - options (object): hash of options see [[Action.new]]
|
||||
*
|
||||
**/
|
||||
var ActionStoreFalse = module.exports = function ActionStoreFalse(options) {
|
||||
options = options || {};
|
||||
options.constant = false;
|
||||
options.defaultValue = options.defaultValue !== null ? options.defaultValue : true;
|
||||
ActionStoreConstant.call(this, options);
|
||||
};
|
||||
util.inherits(ActionStoreFalse, ActionStoreConstant);
|
26
node_modules/argparse/lib/action/store/true.js
generated
vendored
Normal file
26
node_modules/argparse/lib/action/store/true.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/*:nodoc:*
|
||||
* class ActionStoreTrue
|
||||
*
|
||||
* This action store the values True respectively.
|
||||
* This isspecial cases of 'storeConst'
|
||||
*
|
||||
* This class inherited from [[Action]]
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var ActionStoreConstant = require('./constant');
|
||||
|
||||
/*:nodoc:*
|
||||
* new ActionStoreTrue(options)
|
||||
* - options (object): options hash see [[Action.new]]
|
||||
*
|
||||
**/
|
||||
var ActionStoreTrue = module.exports = function ActionStoreTrue(options) {
|
||||
options = options || {};
|
||||
options.constant = true;
|
||||
options.defaultValue = options.defaultValue !== null ? options.defaultValue : false;
|
||||
ActionStoreConstant.call(this, options);
|
||||
};
|
||||
util.inherits(ActionStoreTrue, ActionStoreConstant);
|
149
node_modules/argparse/lib/action/subparsers.js
generated
vendored
Normal file
149
node_modules/argparse/lib/action/subparsers.js
generated
vendored
Normal file
@ -0,0 +1,149 @@
|
||||
/** internal
|
||||
* class ActionSubparsers
|
||||
*
|
||||
* Support the creation of such sub-commands with the addSubparsers()
|
||||
*
|
||||
* This class inherited from [[Action]]
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
var format = require('util').format;
|
||||
|
||||
|
||||
var Action = require('../action');
|
||||
|
||||
// Constants
|
||||
var c = require('../const');
|
||||
|
||||
// Errors
|
||||
var argumentErrorHelper = require('../argument/error');
|
||||
|
||||
|
||||
/*:nodoc:*
|
||||
* new ChoicesPseudoAction(name, help)
|
||||
*
|
||||
* Create pseudo action for correct help text
|
||||
*
|
||||
**/
|
||||
function ChoicesPseudoAction(name, help) {
|
||||
var options = {
|
||||
optionStrings: [],
|
||||
dest: name,
|
||||
help: help
|
||||
};
|
||||
|
||||
Action.call(this, options);
|
||||
}
|
||||
|
||||
util.inherits(ChoicesPseudoAction, Action);
|
||||
|
||||
/**
|
||||
* new ActionSubparsers(options)
|
||||
* - options (object): options hash see [[Action.new]]
|
||||
*
|
||||
**/
|
||||
function ActionSubparsers(options) {
|
||||
options = options || {};
|
||||
options.dest = options.dest || c.SUPPRESS;
|
||||
options.nargs = c.PARSER;
|
||||
|
||||
this.debug = (options.debug === true);
|
||||
|
||||
this._progPrefix = options.prog;
|
||||
this._parserClass = options.parserClass;
|
||||
this._nameParserMap = {};
|
||||
this._choicesActions = [];
|
||||
|
||||
options.choices = this._nameParserMap;
|
||||
Action.call(this, options);
|
||||
}
|
||||
|
||||
util.inherits(ActionSubparsers, Action);
|
||||
|
||||
/*:nodoc:*
|
||||
* ActionSubparsers#addParser(name, options) -> ArgumentParser
|
||||
* - name (string): sub-command name
|
||||
* - options (object): see [[ArgumentParser.new]]
|
||||
*
|
||||
* Note:
|
||||
* addParser supports an additional aliases option,
|
||||
* which allows multiple strings to refer to the same subparser.
|
||||
* This example, like svn, aliases co as a shorthand for checkout
|
||||
*
|
||||
**/
|
||||
ActionSubparsers.prototype.addParser = function (name, options) {
|
||||
var parser;
|
||||
|
||||
var self = this;
|
||||
|
||||
options = options || {};
|
||||
|
||||
options.debug = (this.debug === true);
|
||||
|
||||
// set program from the existing prefix
|
||||
if (!options.prog) {
|
||||
options.prog = this._progPrefix + ' ' + name;
|
||||
}
|
||||
|
||||
var aliases = options.aliases || [];
|
||||
|
||||
// create a pseudo-action to hold the choice help
|
||||
if (!!options.help || typeof options.help === 'string') {
|
||||
var help = options.help;
|
||||
delete options.help;
|
||||
|
||||
var choiceAction = new ChoicesPseudoAction(name, help);
|
||||
this._choicesActions.push(choiceAction);
|
||||
}
|
||||
|
||||
// create the parser and add it to the map
|
||||
parser = new this._parserClass(options);
|
||||
this._nameParserMap[name] = parser;
|
||||
|
||||
// make parser available under aliases also
|
||||
aliases.forEach(function (alias) {
|
||||
self._nameParserMap[alias] = parser;
|
||||
});
|
||||
|
||||
return parser;
|
||||
};
|
||||
|
||||
ActionSubparsers.prototype._getSubactions = function () {
|
||||
return this._choicesActions;
|
||||
};
|
||||
|
||||
/*:nodoc:*
|
||||
* ActionSubparsers#call(parser, namespace, values, optionString) -> Void
|
||||
* - parser (ArgumentParser): current parser
|
||||
* - namespace (Namespace): namespace for output data
|
||||
* - values (Array): parsed values
|
||||
* - optionString (Array): input option string(not parsed)
|
||||
*
|
||||
* Call the action. Parse input aguments
|
||||
**/
|
||||
ActionSubparsers.prototype.call = function (parser, namespace, values) {
|
||||
var parserName = values[0];
|
||||
var argStrings = values.slice(1);
|
||||
|
||||
// set the parser name if requested
|
||||
if (this.dest !== c.SUPPRESS) {
|
||||
namespace[this.dest] = parserName;
|
||||
}
|
||||
|
||||
// select the parser
|
||||
if (this._nameParserMap[parserName]) {
|
||||
parser = this._nameParserMap[parserName];
|
||||
} else {
|
||||
throw argumentErrorHelper(format(
|
||||
'Unknown parser "%s" (choices: [%s]).',
|
||||
parserName,
|
||||
Object.keys(this._nameParserMap).join(', ')
|
||||
));
|
||||
}
|
||||
|
||||
// parse all the remaining options into the namespace
|
||||
parser.parseArgs(argStrings, namespace);
|
||||
};
|
||||
|
||||
module.exports = ActionSubparsers;
|
47
node_modules/argparse/lib/action/version.js
generated
vendored
Normal file
47
node_modules/argparse/lib/action/version.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
/*:nodoc:*
|
||||
* class ActionVersion
|
||||
*
|
||||
* Support action for printing program version
|
||||
* This class inherited from [[Action]]
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var Action = require('../action');
|
||||
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
var c = require('../const');
|
||||
|
||||
/*:nodoc:*
|
||||
* new ActionVersion(options)
|
||||
* - options (object): options hash see [[Action.new]]
|
||||
*
|
||||
**/
|
||||
var ActionVersion = module.exports = function ActionVersion(options) {
|
||||
options = options || {};
|
||||
options.defaultValue = (options.defaultValue ? options.defaultValue : c.SUPPRESS);
|
||||
options.dest = (options.dest || c.SUPPRESS);
|
||||
options.nargs = 0;
|
||||
this.version = options.version;
|
||||
Action.call(this, options);
|
||||
};
|
||||
util.inherits(ActionVersion, Action);
|
||||
|
||||
/*:nodoc:*
|
||||
* ActionVersion#call(parser, namespace, values, optionString) -> Void
|
||||
* - parser (ArgumentParser): current parser
|
||||
* - namespace (Namespace): namespace for output data
|
||||
* - values (Array): parsed values
|
||||
* - optionString (Array): input option string(not parsed)
|
||||
*
|
||||
* Print version and exit
|
||||
**/
|
||||
ActionVersion.prototype.call = function (parser) {
|
||||
var version = this.version || parser.version;
|
||||
var formatter = parser._getFormatter();
|
||||
formatter.addText(version);
|
||||
parser.exit(0, formatter.formatHelp());
|
||||
};
|
482
node_modules/argparse/lib/action_container.js
generated
vendored
Normal file
482
node_modules/argparse/lib/action_container.js
generated
vendored
Normal file
@ -0,0 +1,482 @@
|
||||
/** internal
|
||||
* class ActionContainer
|
||||
*
|
||||
* Action container. Parent for [[ArgumentParser]] and [[ArgumentGroup]]
|
||||
**/
|
||||
|
||||
'use strict';
|
||||
|
||||
var format = require('util').format;
|
||||
|
||||
// Constants
|
||||
var c = require('./const');
|
||||
|
||||
var $$ = require('./utils');
|
||||
|
||||
//Actions
|
||||
var ActionHelp = require('./action/help');
|
||||
var ActionAppend = require('./action/append');
|
||||
var ActionAppendConstant = require('./action/append/constant');
|
||||
var ActionCount = require('./action/count');
|
||||
var ActionStore = require('./action/store');
|
||||
var ActionStoreConstant = require('./action/store/constant');
|
||||
var ActionStoreTrue = require('./action/store/true');
|
||||
var ActionStoreFalse = require('./action/store/false');
|
||||
var ActionVersion = require('./action/version');
|
||||
var ActionSubparsers = require('./action/subparsers');
|
||||
|
||||
// Errors
|
||||
var argumentErrorHelper = require('./argument/error');
|
||||
|
||||
/**
|
||||
* new ActionContainer(options)
|
||||
*
|
||||
* Action container. Parent for [[ArgumentParser]] and [[ArgumentGroup]]
|
||||
*
|
||||
* ##### Options:
|
||||
*
|
||||
* - `description` -- A description of what the program does
|
||||
* - `prefixChars` -- Characters that prefix optional arguments
|
||||
* - `argumentDefault` -- The default value for all arguments
|
||||
* - `conflictHandler` -- The conflict handler to use for duplicate arguments
|
||||
**/
|
||||
var ActionContainer = module.exports = function ActionContainer(options) {
|
||||
options = options || {};
|
||||
|
||||
this.description = options.description;
|
||||
this.argumentDefault = options.argumentDefault;
|
||||
this.prefixChars = options.prefixChars || '';
|
||||
this.conflictHandler = options.conflictHandler;
|
||||
|
||||
// set up registries
|
||||
this._registries = {};
|
||||
|
||||
// register actions
|
||||
this.register('action', null, ActionStore);
|
||||
this.register('action', 'store', ActionStore);
|
||||
this.register('action', 'storeConst', ActionStoreConstant);
|
||||
this.register('action', 'storeTrue', ActionStoreTrue);
|
||||
this.register('action', 'storeFalse', ActionStoreFalse);
|
||||
this.register('action', 'append', ActionAppend);
|
||||
this.register('action', 'appendConst', ActionAppendConstant);
|
||||
this.register('action', 'count', ActionCount);
|
||||
this.register('action', 'help', ActionHelp);
|
||||
this.register('action', 'version', ActionVersion);
|
||||
this.register('action', 'parsers', ActionSubparsers);
|
||||
|
||||
// raise an exception if the conflict handler is invalid
|
||||
this._getHandler();
|
||||
|
||||
// action storage
|
||||
this._actions = [];
|
||||
this._optionStringActions = {};
|
||||
|
||||
// groups
|
||||
this._actionGroups = [];
|
||||
this._mutuallyExclusiveGroups = [];
|
||||
|
||||
// defaults storage
|
||||
this._defaults = {};
|
||||
|
||||
// determines whether an "option" looks like a negative number
|
||||
// -1, -1.5 -5e+4
|
||||
this._regexpNegativeNumber = new RegExp('^[-]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$');
|
||||
|
||||
// whether or not there are any optionals that look like negative
|
||||
// numbers -- uses a list so it can be shared and edited
|
||||
this._hasNegativeNumberOptionals = [];
|
||||
};
|
||||
|
||||
// Groups must be required, then ActionContainer already defined
|
||||
var ArgumentGroup = require('./argument/group');
|
||||
var MutuallyExclusiveGroup = require('./argument/exclusive');
|
||||
|
||||
//
|
||||
// Registration methods
|
||||
//
|
||||
|
||||
/**
|
||||
* ActionContainer#register(registryName, value, object) -> Void
|
||||
* - registryName (String) : object type action|type
|
||||
* - value (string) : keyword
|
||||
* - object (Object|Function) : handler
|
||||
*
|
||||
* Register handlers
|
||||
**/
|
||||
ActionContainer.prototype.register = function (registryName, value, object) {
|
||||
this._registries[registryName] = this._registries[registryName] || {};
|
||||
this._registries[registryName][value] = object;
|
||||
};
|
||||
|
||||
ActionContainer.prototype._registryGet = function (registryName, value, defaultValue) {
|
||||
if (arguments.length < 3) {
|
||||
defaultValue = null;
|
||||
}
|
||||
return this._registries[registryName][value] || defaultValue;
|
||||
};
|
||||
|
||||
//
|
||||
// Namespace default accessor methods
|
||||
//
|
||||
|
||||
/**
|
||||
* ActionContainer#setDefaults(options) -> Void
|
||||
* - options (object):hash of options see [[Action.new]]
|
||||
*
|
||||
* Set defaults
|
||||
**/
|
||||
ActionContainer.prototype.setDefaults = function (options) {
|
||||
options = options || {};
|
||||
for (var property in options) {
|
||||
if ($$.has(options, property)) {
|
||||
this._defaults[property] = options[property];
|
||||
}
|
||||
}
|
||||
|
||||
// if these defaults match any existing arguments, replace the previous
|
||||
// default on the object with the new one
|
||||
this._actions.forEach(function (action) {
|
||||
if ($$.has(options, action.dest)) {
|
||||
action.defaultValue = options[action.dest];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* ActionContainer#getDefault(dest) -> Mixed
|
||||
* - dest (string): action destination
|
||||
*
|
||||
* Return action default value
|
||||
**/
|
||||
ActionContainer.prototype.getDefault = function (dest) {
|
||||
var result = $$.has(this._defaults, dest) ? this._defaults[dest] : null;
|
||||
|
||||
this._actions.forEach(function (action) {
|
||||
if (action.dest === dest && $$.has(action, 'defaultValue')) {
|
||||
result = action.defaultValue;
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
};
|
||||
//
|
||||
// Adding argument actions
|
||||
//
|
||||
|
||||
/**
|
||||
* ActionContainer#addArgument(args, options) -> Object
|
||||
* - args (String|Array): argument key, or array of argument keys
|
||||
* - options (Object): action objects see [[Action.new]]
|
||||
*
|
||||
* #### Examples
|
||||
* - addArgument([ '-f', '--foo' ], { action: 'store', defaultValue: 1, ... })
|
||||
* - addArgument([ 'bar' ], { action: 'store', nargs: 1, ... })
|
||||
* - addArgument('--baz', { action: 'store', nargs: 1, ... })
|
||||
**/
|
||||
ActionContainer.prototype.addArgument = function (args, options) {
|
||||
args = args;
|
||||
options = options || {};
|
||||
|
||||
if (typeof args === 'string') {
|
||||
args = [ args ];
|
||||
}
|
||||
if (!Array.isArray(args)) {
|
||||
throw new TypeError('addArgument first argument should be a string or an array');
|
||||
}
|
||||
if (typeof options !== 'object' || Array.isArray(options)) {
|
||||
throw new TypeError('addArgument second argument should be a hash');
|
||||
}
|
||||
|
||||
// if no positional args are supplied or only one is supplied and
|
||||
// it doesn't look like an option string, parse a positional argument
|
||||
if (!args || args.length === 1 && this.prefixChars.indexOf(args[0][0]) < 0) {
|
||||
if (args && !!options.dest) {
|
||||
throw new Error('dest supplied twice for positional argument');
|
||||
}
|
||||
options = this._getPositional(args, options);
|
||||
|
||||
// otherwise, we're adding an optional argument
|
||||
} else {
|
||||
options = this._getOptional(args, options);
|
||||
}
|
||||
|
||||
// if no default was supplied, use the parser-level default
|
||||
if (typeof options.defaultValue === 'undefined') {
|
||||
var dest = options.dest;
|
||||
if ($$.has(this._defaults, dest)) {
|
||||
options.defaultValue = this._defaults[dest];
|
||||
} else if (typeof this.argumentDefault !== 'undefined') {
|
||||
options.defaultValue = this.argumentDefault;
|
||||
}
|
||||
}
|
||||
|
||||
// create the action object, and add it to the parser
|
||||
var ActionClass = this._popActionClass(options);
|
||||
if (typeof ActionClass !== 'function') {
|
||||
throw new Error(format('Unknown action "%s".', ActionClass));
|
||||
}
|
||||
var action = new ActionClass(options);
|
||||
|
||||
// throw an error if the action type is not callable
|
||||
var typeFunction = this._registryGet('type', action.type, action.type);
|
||||
if (typeof typeFunction !== 'function') {
|
||||
throw new Error(format('"%s" is not callable', typeFunction));
|
||||
}
|
||||
|
||||
return this._addAction(action);
|
||||
};
|
||||
|
||||
/**
|
||||
* ActionContainer#addArgumentGroup(options) -> ArgumentGroup
|
||||
* - options (Object): hash of options see [[ArgumentGroup.new]]
|
||||
*
|
||||
* Create new arguments groups
|
||||
**/
|
||||
ActionContainer.prototype.addArgumentGroup = function (options) {
|
||||
var group = new ArgumentGroup(this, options);
|
||||
this._actionGroups.push(group);
|
||||
return group;
|
||||
};
|
||||
|
||||
/**
|
||||
* ActionContainer#addMutuallyExclusiveGroup(options) -> ArgumentGroup
|
||||
* - options (Object): {required: false}
|
||||
*
|
||||
* Create new mutual exclusive groups
|
||||
**/
|
||||
ActionContainer.prototype.addMutuallyExclusiveGroup = function (options) {
|
||||
var group = new MutuallyExclusiveGroup(this, options);
|
||||
this._mutuallyExclusiveGroups.push(group);
|
||||
return group;
|
||||
};
|
||||
|
||||
ActionContainer.prototype._addAction = function (action) {
|
||||
var self = this;
|
||||
|
||||
// resolve any conflicts
|
||||
this._checkConflict(action);
|
||||
|
||||
// add to actions list
|
||||
this._actions.push(action);
|
||||
action.container = this;
|
||||
|
||||
// index the action by any option strings it has
|
||||
action.optionStrings.forEach(function (optionString) {
|
||||
self._optionStringActions[optionString] = action;
|
||||
});
|
||||
|
||||
// set the flag if any option strings look like negative numbers
|
||||
action.optionStrings.forEach(function (optionString) {
|
||||
if (optionString.match(self._regexpNegativeNumber)) {
|
||||
if (!self._hasNegativeNumberOptionals.some(Boolean)) {
|
||||
self._hasNegativeNumberOptionals.push(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// return the created action
|
||||
return action;
|
||||
};
|
||||
|
||||
ActionContainer.prototype._removeAction = function (action) {
|
||||
var actionIndex = this._actions.indexOf(action);
|
||||
if (actionIndex >= 0) {
|
||||
this._actions.splice(actionIndex, 1);
|
||||
}
|
||||
};
|
||||
|
||||
ActionContainer.prototype._addContainerActions = function (container) {
|
||||
// collect groups by titles
|
||||
var titleGroupMap = {};
|
||||
this._actionGroups.forEach(function (group) {
|
||||
if (titleGroupMap[group.title]) {
|
||||
throw new Error(format('Cannot merge actions - two groups are named "%s".', group.title));
|
||||
}
|
||||
titleGroupMap[group.title] = group;
|
||||
});
|
||||
|
||||
// map each action to its group
|
||||
var groupMap = {};
|
||||
function actionHash(action) {
|
||||
// unique (hopefully?) string suitable as dictionary key
|
||||
return action.getName();
|
||||
}
|
||||
container._actionGroups.forEach(function (group) {
|
||||
// if a group with the title exists, use that, otherwise
|
||||
// create a new group matching the container's group
|
||||
if (!titleGroupMap[group.title]) {
|
||||
titleGroupMap[group.title] = this.addArgumentGroup({
|
||||
title: group.title,
|
||||
description: group.description
|
||||
});
|
||||
}
|
||||
|
||||
// map the actions to their new group
|
||||
group._groupActions.forEach(function (action) {
|
||||
groupMap[actionHash(action)] = titleGroupMap[group.title];
|
||||
});
|
||||
}, this);
|
||||
|
||||
// add container's mutually exclusive groups
|
||||
// NOTE: if add_mutually_exclusive_group ever gains title= and
|
||||
// description= then this code will need to be expanded as above
|
||||
var mutexGroup;
|
||||
container._mutuallyExclusiveGroups.forEach(function (group) {
|
||||
mutexGroup = this.addMutuallyExclusiveGroup({
|
||||
required: group.required
|
||||
});
|
||||
// map the actions to their new mutex group
|
||||
group._groupActions.forEach(function (action) {
|
||||
groupMap[actionHash(action)] = mutexGroup;
|
||||
});
|
||||
}, this); // forEach takes a 'this' argument
|
||||
|
||||
// add all actions to this container or their group
|
||||
container._actions.forEach(function (action) {
|
||||
var key = actionHash(action);
|
||||
if (groupMap[key]) {
|
||||
groupMap[key]._addAction(action);
|
||||
} else {
|
||||
this._addAction(action);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
ActionContainer.prototype._getPositional = function (dest, options) {
|
||||
if (Array.isArray(dest)) {
|
||||
dest = dest[0];
|
||||
}
|
||||
// make sure required is not specified
|
||||
if (options.required) {
|
||||
throw new Error('"required" is an invalid argument for positionals.');
|
||||
}
|
||||
|
||||
// mark positional arguments as required if at least one is
|
||||
// always required
|
||||
if (options.nargs !== c.OPTIONAL && options.nargs !== c.ZERO_OR_MORE) {
|
||||
options.required = true;
|
||||
}
|
||||
if (options.nargs === c.ZERO_OR_MORE && typeof options.defaultValue === 'undefined') {
|
||||
options.required = true;
|
||||
}
|
||||
|
||||
// return the keyword arguments with no option strings
|
||||
options.dest = dest;
|
||||
options.optionStrings = [];
|
||||
return options;
|
||||
};
|
||||
|
||||
ActionContainer.prototype._getOptional = function (args, options) {
|
||||
var prefixChars = this.prefixChars;
|
||||
var optionStrings = [];
|
||||
var optionStringsLong = [];
|
||||
|
||||
// determine short and long option strings
|
||||
args.forEach(function (optionString) {
|
||||
// error on strings that don't start with an appropriate prefix
|
||||
if (prefixChars.indexOf(optionString[0]) < 0) {
|
||||
throw new Error(format('Invalid option string "%s": must start with a "%s".',
|
||||
optionString,
|
||||
prefixChars
|
||||
));
|
||||
}
|
||||
|
||||
// strings starting with two prefix characters are long options
|
||||
optionStrings.push(optionString);
|
||||
if (optionString.length > 1 && prefixChars.indexOf(optionString[1]) >= 0) {
|
||||
optionStringsLong.push(optionString);
|
||||
}
|
||||
});
|
||||
|
||||
// infer dest, '--foo-bar' -> 'foo_bar' and '-x' -> 'x'
|
||||
var dest = options.dest || null;
|
||||
delete options.dest;
|
||||
|
||||
if (!dest) {
|
||||
var optionStringDest = optionStringsLong.length ? optionStringsLong[0] : optionStrings[0];
|
||||
dest = $$.trimChars(optionStringDest, this.prefixChars);
|
||||
|
||||
if (dest.length === 0) {
|
||||
throw new Error(
|
||||
format('dest= is required for options like "%s"', optionStrings.join(', '))
|
||||
);
|
||||
}
|
||||
dest = dest.replace(/-/g, '_');
|
||||
}
|
||||
|
||||
// return the updated keyword arguments
|
||||
options.dest = dest;
|
||||
options.optionStrings = optionStrings;
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
ActionContainer.prototype._popActionClass = function (options, defaultValue) {
|
||||
defaultValue = defaultValue || null;
|
||||
|
||||
var action = (options.action || defaultValue);
|
||||
delete options.action;
|
||||
|
||||
var actionClass = this._registryGet('action', action, action);
|
||||
return actionClass;
|
||||
};
|
||||
|
||||
ActionContainer.prototype._getHandler = function () {
|
||||
var handlerString = this.conflictHandler;
|
||||
var handlerFuncName = '_handleConflict' + $$.capitalize(handlerString);
|
||||
var func = this[handlerFuncName];
|
||||
if (typeof func === 'undefined') {
|
||||
var msg = 'invalid conflict resolution value: ' + handlerString;
|
||||
throw new Error(msg);
|
||||
} else {
|
||||
return func;
|
||||
}
|
||||
};
|
||||
|
||||
ActionContainer.prototype._checkConflict = function (action) {
|
||||
var optionStringActions = this._optionStringActions;
|
||||
var conflictOptionals = [];
|
||||
|
||||
// find all options that conflict with this option
|
||||
// collect pairs, the string, and an existing action that it conflicts with
|
||||
action.optionStrings.forEach(function (optionString) {
|
||||
var conflOptional = optionStringActions[optionString];
|
||||
if (typeof conflOptional !== 'undefined') {
|
||||
conflictOptionals.push([ optionString, conflOptional ]);
|
||||
}
|
||||
});
|
||||
|
||||
if (conflictOptionals.length > 0) {
|
||||
var conflictHandler = this._getHandler();
|
||||
conflictHandler.call(this, action, conflictOptionals);
|
||||
}
|
||||
};
|
||||
|
||||
ActionContainer.prototype._handleConflictError = function (action, conflOptionals) {
|
||||
var conflicts = conflOptionals.map(function (pair) { return pair[0]; });
|
||||
conflicts = conflicts.join(', ');
|
||||
throw argumentErrorHelper(
|
||||
action,
|
||||
format('Conflicting option string(s): %s', conflicts)
|
||||
);
|
||||
};
|
||||
|
||||
ActionContainer.prototype._handleConflictResolve = function (action, conflOptionals) {
|
||||
// remove all conflicting options
|
||||
var self = this;
|
||||
conflOptionals.forEach(function (pair) {
|
||||
var optionString = pair[0];
|
||||
var conflictingAction = pair[1];
|
||||
// remove the conflicting option string
|
||||
var i = conflictingAction.optionStrings.indexOf(optionString);
|
||||
if (i >= 0) {
|
||||
conflictingAction.optionStrings.splice(i, 1);
|
||||
}
|
||||
delete self._optionStringActions[optionString];
|
||||
// if the option now has no option string, remove it from the
|
||||
// container holding it
|
||||
if (conflictingAction.optionStrings.length === 0) {
|
||||
conflictingAction.container._removeAction(conflictingAction);
|
||||
}
|
||||
});
|
||||
};
|
14
node_modules/argparse/lib/argparse.js
generated
vendored
Normal file
14
node_modules/argparse/lib/argparse.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
module.exports.ArgumentParser = require('./argument_parser.js');
|
||||
module.exports.Namespace = require('./namespace');
|
||||
module.exports.Action = require('./action');
|
||||
module.exports.HelpFormatter = require('./help/formatter.js');
|
||||
module.exports.Const = require('./const.js');
|
||||
|
||||
module.exports.ArgumentDefaultsHelpFormatter =
|
||||
require('./help/added_formatters.js').ArgumentDefaultsHelpFormatter;
|
||||
module.exports.RawDescriptionHelpFormatter =
|
||||
require('./help/added_formatters.js').RawDescriptionHelpFormatter;
|
||||
module.exports.RawTextHelpFormatter =
|
||||
require('./help/added_formatters.js').RawTextHelpFormatter;
|
50
node_modules/argparse/lib/argument/error.js
generated
vendored
Normal file
50
node_modules/argparse/lib/argument/error.js
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
'use strict';
|
||||
|
||||
|
||||
var format = require('util').format;
|
||||
|
||||
|
||||
var ERR_CODE = 'ARGError';
|
||||
|
||||
/*:nodoc:*
|
||||
* argumentError(argument, message) -> TypeError
|
||||
* - argument (Object): action with broken argument
|
||||
* - message (String): error message
|
||||
*
|
||||
* Error format helper. An error from creating or using an argument
|
||||
* (optional or positional). The string value of this exception
|
||||
* is the message, augmented with information
|
||||
* about the argument that caused it.
|
||||
*
|
||||
* #####Example
|
||||
*
|
||||
* var argumentErrorHelper = require('./argument/error');
|
||||
* if (conflictOptionals.length > 0) {
|
||||
* throw argumentErrorHelper(
|
||||
* action,
|
||||
* format('Conflicting option string(s): %s', conflictOptionals.join(', '))
|
||||
* );
|
||||
* }
|
||||
*
|
||||
**/
|
||||
module.exports = function (argument, message) {
|
||||
var argumentName = null;
|
||||
var errMessage;
|
||||
var err;
|
||||
|
||||
if (argument.getName) {
|
||||
argumentName = argument.getName();
|
||||
} else {
|
||||
argumentName = '' + argument;
|
||||
}
|
||||
|
||||
if (!argumentName) {
|
||||
errMessage = message;
|
||||
} else {
|
||||
errMessage = format('argument "%s": %s', argumentName, message);
|
||||
}
|
||||
|
||||
err = new TypeError(errMessage);
|
||||
err.code = ERR_CODE;
|
||||
return err;
|
||||
};
|
54
node_modules/argparse/lib/argument/exclusive.js
generated
vendored
Normal file
54
node_modules/argparse/lib/argument/exclusive.js
generated
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
/** internal
|
||||
* class MutuallyExclusiveGroup
|
||||
*
|
||||
* Group arguments.
|
||||
* By default, ArgumentParser groups command-line arguments
|
||||
* into “positional arguments” and “optional arguments”
|
||||
* when displaying help messages. When there is a better
|
||||
* conceptual grouping of arguments than this default one,
|
||||
* appropriate groups can be created using the addArgumentGroup() method
|
||||
*
|
||||
* This class inherited from [[ArgumentContainer]]
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var ArgumentGroup = require('./group');
|
||||
|
||||
/**
|
||||
* new MutuallyExclusiveGroup(container, options)
|
||||
* - container (object): main container
|
||||
* - options (object): options.required -> true/false
|
||||
*
|
||||
* `required` could be an argument itself, but making it a property of
|
||||
* the options argument is more consistent with the JS adaptation of the Python)
|
||||
**/
|
||||
var MutuallyExclusiveGroup = module.exports = function MutuallyExclusiveGroup(container, options) {
|
||||
var required;
|
||||
options = options || {};
|
||||
required = options.required || false;
|
||||
ArgumentGroup.call(this, container);
|
||||
this.required = required;
|
||||
|
||||
};
|
||||
util.inherits(MutuallyExclusiveGroup, ArgumentGroup);
|
||||
|
||||
|
||||
MutuallyExclusiveGroup.prototype._addAction = function (action) {
|
||||
var msg;
|
||||
if (action.required) {
|
||||
msg = 'mutually exclusive arguments must be optional';
|
||||
throw new Error(msg);
|
||||
}
|
||||
action = this._container._addAction(action);
|
||||
this._groupActions.push(action);
|
||||
return action;
|
||||
};
|
||||
|
||||
|
||||
MutuallyExclusiveGroup.prototype._removeAction = function (action) {
|
||||
this._container._removeAction(action);
|
||||
this._groupActions.remove(action);
|
||||
};
|
||||
|
75
node_modules/argparse/lib/argument/group.js
generated
vendored
Normal file
75
node_modules/argparse/lib/argument/group.js
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
/** internal
|
||||
* class ArgumentGroup
|
||||
*
|
||||
* Group arguments.
|
||||
* By default, ArgumentParser groups command-line arguments
|
||||
* into “positional arguments” and “optional arguments”
|
||||
* when displaying help messages. When there is a better
|
||||
* conceptual grouping of arguments than this default one,
|
||||
* appropriate groups can be created using the addArgumentGroup() method
|
||||
*
|
||||
* This class inherited from [[ArgumentContainer]]
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
var ActionContainer = require('../action_container');
|
||||
|
||||
|
||||
/**
|
||||
* new ArgumentGroup(container, options)
|
||||
* - container (object): main container
|
||||
* - options (object): hash of group options
|
||||
*
|
||||
* #### options
|
||||
* - **prefixChars** group name prefix
|
||||
* - **argumentDefault** default argument value
|
||||
* - **title** group title
|
||||
* - **description** group description
|
||||
*
|
||||
**/
|
||||
var ArgumentGroup = module.exports = function ArgumentGroup(container, options) {
|
||||
|
||||
options = options || {};
|
||||
|
||||
// add any missing keyword arguments by checking the container
|
||||
options.conflictHandler = (options.conflictHandler || container.conflictHandler);
|
||||
options.prefixChars = (options.prefixChars || container.prefixChars);
|
||||
options.argumentDefault = (options.argumentDefault || container.argumentDefault);
|
||||
|
||||
ActionContainer.call(this, options);
|
||||
|
||||
// group attributes
|
||||
this.title = options.title;
|
||||
this._groupActions = [];
|
||||
|
||||
// share most attributes with the container
|
||||
this._container = container;
|
||||
this._registries = container._registries;
|
||||
this._actions = container._actions;
|
||||
this._optionStringActions = container._optionStringActions;
|
||||
this._defaults = container._defaults;
|
||||
this._hasNegativeNumberOptionals = container._hasNegativeNumberOptionals;
|
||||
this._mutuallyExclusiveGroups = container._mutuallyExclusiveGroups;
|
||||
};
|
||||
util.inherits(ArgumentGroup, ActionContainer);
|
||||
|
||||
|
||||
ArgumentGroup.prototype._addAction = function (action) {
|
||||
// Parent add action
|
||||
action = ActionContainer.prototype._addAction.call(this, action);
|
||||
this._groupActions.push(action);
|
||||
return action;
|
||||
};
|
||||
|
||||
|
||||
ArgumentGroup.prototype._removeAction = function (action) {
|
||||
// Parent remove action
|
||||
ActionContainer.prototype._removeAction.call(this, action);
|
||||
var actionIndex = this._groupActions.indexOf(action);
|
||||
if (actionIndex >= 0) {
|
||||
this._groupActions.splice(actionIndex, 1);
|
||||
}
|
||||
};
|
||||
|
1161
node_modules/argparse/lib/argument_parser.js
generated
vendored
Normal file
1161
node_modules/argparse/lib/argument_parser.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
21
node_modules/argparse/lib/const.js
generated
vendored
Normal file
21
node_modules/argparse/lib/const.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports.EOL = '\n';
|
||||
|
||||
module.exports.SUPPRESS = '==SUPPRESS==';
|
||||
|
||||
module.exports.OPTIONAL = '?';
|
||||
|
||||
module.exports.ZERO_OR_MORE = '*';
|
||||
|
||||
module.exports.ONE_OR_MORE = '+';
|
||||
|
||||
module.exports.PARSER = 'A...';
|
||||
|
||||
module.exports.REMAINDER = '...';
|
||||
|
||||
module.exports._UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args';
|
87
node_modules/argparse/lib/help/added_formatters.js
generated
vendored
Normal file
87
node_modules/argparse/lib/help/added_formatters.js
generated
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
'use strict';
|
||||
|
||||
var util = require('util');
|
||||
|
||||
// Constants
|
||||
var c = require('../const');
|
||||
|
||||
var $$ = require('../utils');
|
||||
var HelpFormatter = require('./formatter.js');
|
||||
|
||||
/**
|
||||
* new RawDescriptionHelpFormatter(options)
|
||||
* new ArgumentParser({formatterClass: argparse.RawDescriptionHelpFormatter, ...})
|
||||
*
|
||||
* Help message formatter which adds default values to argument help.
|
||||
*
|
||||
* Only the name of this class is considered a public API. All the methods
|
||||
* provided by the class are considered an implementation detail.
|
||||
**/
|
||||
|
||||
function ArgumentDefaultsHelpFormatter(options) {
|
||||
HelpFormatter.call(this, options);
|
||||
}
|
||||
|
||||
util.inherits(ArgumentDefaultsHelpFormatter, HelpFormatter);
|
||||
|
||||
ArgumentDefaultsHelpFormatter.prototype._getHelpString = function (action) {
|
||||
var help = action.help;
|
||||
if (action.help.indexOf('%(defaultValue)s') === -1) {
|
||||
if (action.defaultValue !== c.SUPPRESS) {
|
||||
var defaulting_nargs = [ c.OPTIONAL, c.ZERO_OR_MORE ];
|
||||
if (action.isOptional() || (defaulting_nargs.indexOf(action.nargs) >= 0)) {
|
||||
help += ' (default: %(defaultValue)s)';
|
||||
}
|
||||
}
|
||||
}
|
||||
return help;
|
||||
};
|
||||
|
||||
module.exports.ArgumentDefaultsHelpFormatter = ArgumentDefaultsHelpFormatter;
|
||||
|
||||
/**
|
||||
* new RawDescriptionHelpFormatter(options)
|
||||
* new ArgumentParser({formatterClass: argparse.RawDescriptionHelpFormatter, ...})
|
||||
*
|
||||
* Help message formatter which retains any formatting in descriptions.
|
||||
*
|
||||
* Only the name of this class is considered a public API. All the methods
|
||||
* provided by the class are considered an implementation detail.
|
||||
**/
|
||||
|
||||
function RawDescriptionHelpFormatter(options) {
|
||||
HelpFormatter.call(this, options);
|
||||
}
|
||||
|
||||
util.inherits(RawDescriptionHelpFormatter, HelpFormatter);
|
||||
|
||||
RawDescriptionHelpFormatter.prototype._fillText = function (text, width, indent) {
|
||||
var lines = text.split('\n');
|
||||
lines = lines.map(function (line) {
|
||||
return $$.trimEnd(indent + line);
|
||||
});
|
||||
return lines.join('\n');
|
||||
};
|
||||
module.exports.RawDescriptionHelpFormatter = RawDescriptionHelpFormatter;
|
||||
|
||||
/**
|
||||
* new RawTextHelpFormatter(options)
|
||||
* new ArgumentParser({formatterClass: argparse.RawTextHelpFormatter, ...})
|
||||
*
|
||||
* Help message formatter which retains formatting of all help text.
|
||||
*
|
||||
* Only the name of this class is considered a public API. All the methods
|
||||
* provided by the class are considered an implementation detail.
|
||||
**/
|
||||
|
||||
function RawTextHelpFormatter(options) {
|
||||
RawDescriptionHelpFormatter.call(this, options);
|
||||
}
|
||||
|
||||
util.inherits(RawTextHelpFormatter, RawDescriptionHelpFormatter);
|
||||
|
||||
RawTextHelpFormatter.prototype._splitLines = function (text) {
|
||||
return text.split('\n');
|
||||
};
|
||||
|
||||
module.exports.RawTextHelpFormatter = RawTextHelpFormatter;
|
795
node_modules/argparse/lib/help/formatter.js
generated
vendored
Normal file
795
node_modules/argparse/lib/help/formatter.js
generated
vendored
Normal file
@ -0,0 +1,795 @@
|
||||
/**
|
||||
* class HelpFormatter
|
||||
*
|
||||
* Formatter for generating usage messages and argument help strings. Only the
|
||||
* name of this class is considered a public API. All the methods provided by
|
||||
* the class are considered an implementation detail.
|
||||
*
|
||||
* Do not call in your code, use this class only for inherits your own forvatter
|
||||
*
|
||||
* ToDo add [additonal formatters][1]
|
||||
*
|
||||
* [1]:http://docs.python.org/dev/library/argparse.html#formatter-class
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var sprintf = require('sprintf-js').sprintf;
|
||||
|
||||
// Constants
|
||||
var c = require('../const');
|
||||
|
||||
var $$ = require('../utils');
|
||||
|
||||
|
||||
/*:nodoc:* internal
|
||||
* new Support(parent, heding)
|
||||
* - parent (object): parent section
|
||||
* - heading (string): header string
|
||||
*
|
||||
**/
|
||||
function Section(parent, heading) {
|
||||
this._parent = parent;
|
||||
this._heading = heading;
|
||||
this._items = [];
|
||||
}
|
||||
|
||||
/*:nodoc:* internal
|
||||
* Section#addItem(callback) -> Void
|
||||
* - callback (array): tuple with function and args
|
||||
*
|
||||
* Add function for single element
|
||||
**/
|
||||
Section.prototype.addItem = function (callback) {
|
||||
this._items.push(callback);
|
||||
};
|
||||
|
||||
/*:nodoc:* internal
|
||||
* Section#formatHelp(formatter) -> string
|
||||
* - formatter (HelpFormatter): current formatter
|
||||
*
|
||||
* Form help section string
|
||||
*
|
||||
**/
|
||||
Section.prototype.formatHelp = function (formatter) {
|
||||
var itemHelp, heading;
|
||||
|
||||
// format the indented section
|
||||
if (this._parent) {
|
||||
formatter._indent();
|
||||
}
|
||||
|
||||
itemHelp = this._items.map(function (item) {
|
||||
var obj, func, args;
|
||||
|
||||
obj = formatter;
|
||||
func = item[0];
|
||||
args = item[1];
|
||||
return func.apply(obj, args);
|
||||
});
|
||||
itemHelp = formatter._joinParts(itemHelp);
|
||||
|
||||
if (this._parent) {
|
||||
formatter._dedent();
|
||||
}
|
||||
|
||||
// return nothing if the section was empty
|
||||
if (!itemHelp) {
|
||||
return '';
|
||||
}
|
||||
|
||||
// add the heading if the section was non-empty
|
||||
heading = '';
|
||||
if (this._heading && this._heading !== c.SUPPRESS) {
|
||||
var currentIndent = formatter.currentIndent;
|
||||
heading = $$.repeat(' ', currentIndent) + this._heading + ':' + c.EOL;
|
||||
}
|
||||
|
||||
// join the section-initialize newline, the heading and the help
|
||||
return formatter._joinParts([ c.EOL, heading, itemHelp, c.EOL ]);
|
||||
};
|
||||
|
||||
/**
|
||||
* new HelpFormatter(options)
|
||||
*
|
||||
* #### Options:
|
||||
* - `prog`: program name
|
||||
* - `indentIncriment`: indent step, default value 2
|
||||
* - `maxHelpPosition`: max help position, default value = 24
|
||||
* - `width`: line width
|
||||
*
|
||||
**/
|
||||
var HelpFormatter = module.exports = function HelpFormatter(options) {
|
||||
options = options || {};
|
||||
|
||||
this._prog = options.prog;
|
||||
|
||||
this._maxHelpPosition = options.maxHelpPosition || 24;
|
||||
this._width = (options.width || ((process.env.COLUMNS || 80) - 2));
|
||||
|
||||
this._currentIndent = 0;
|
||||
this._indentIncriment = options.indentIncriment || 2;
|
||||
this._level = 0;
|
||||
this._actionMaxLength = 0;
|
||||
|
||||
this._rootSection = new Section(null);
|
||||
this._currentSection = this._rootSection;
|
||||
|
||||
this._whitespaceMatcher = new RegExp('\\s+', 'g');
|
||||
this._longBreakMatcher = new RegExp(c.EOL + c.EOL + c.EOL + '+', 'g');
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._indent = function () {
|
||||
this._currentIndent += this._indentIncriment;
|
||||
this._level += 1;
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._dedent = function () {
|
||||
this._currentIndent -= this._indentIncriment;
|
||||
this._level -= 1;
|
||||
if (this._currentIndent < 0) {
|
||||
throw new Error('Indent decreased below 0.');
|
||||
}
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._addItem = function (func, args) {
|
||||
this._currentSection.addItem([ func, args ]);
|
||||
};
|
||||
|
||||
//
|
||||
// Message building methods
|
||||
//
|
||||
|
||||
/**
|
||||
* HelpFormatter#startSection(heading) -> Void
|
||||
* - heading (string): header string
|
||||
*
|
||||
* Start new help section
|
||||
*
|
||||
* See alse [code example][1]
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* formatter.startSection(actionGroup.title);
|
||||
* formatter.addText(actionGroup.description);
|
||||
* formatter.addArguments(actionGroup._groupActions);
|
||||
* formatter.endSection();
|
||||
*
|
||||
**/
|
||||
HelpFormatter.prototype.startSection = function (heading) {
|
||||
this._indent();
|
||||
var section = new Section(this._currentSection, heading);
|
||||
var func = section.formatHelp.bind(section);
|
||||
this._addItem(func, [ this ]);
|
||||
this._currentSection = section;
|
||||
};
|
||||
|
||||
/**
|
||||
* HelpFormatter#endSection -> Void
|
||||
*
|
||||
* End help section
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* formatter.startSection(actionGroup.title);
|
||||
* formatter.addText(actionGroup.description);
|
||||
* formatter.addArguments(actionGroup._groupActions);
|
||||
* formatter.endSection();
|
||||
**/
|
||||
HelpFormatter.prototype.endSection = function () {
|
||||
this._currentSection = this._currentSection._parent;
|
||||
this._dedent();
|
||||
};
|
||||
|
||||
/**
|
||||
* HelpFormatter#addText(text) -> Void
|
||||
* - text (string): plain text
|
||||
*
|
||||
* Add plain text into current section
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* formatter.startSection(actionGroup.title);
|
||||
* formatter.addText(actionGroup.description);
|
||||
* formatter.addArguments(actionGroup._groupActions);
|
||||
* formatter.endSection();
|
||||
*
|
||||
**/
|
||||
HelpFormatter.prototype.addText = function (text) {
|
||||
if (text && text !== c.SUPPRESS) {
|
||||
this._addItem(this._formatText, [ text ]);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* HelpFormatter#addUsage(usage, actions, groups, prefix) -> Void
|
||||
* - usage (string): usage text
|
||||
* - actions (array): actions list
|
||||
* - groups (array): groups list
|
||||
* - prefix (string): usage prefix
|
||||
*
|
||||
* Add usage data into current section
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* formatter.addUsage(this.usage, this._actions, []);
|
||||
* return formatter.formatHelp();
|
||||
*
|
||||
**/
|
||||
HelpFormatter.prototype.addUsage = function (usage, actions, groups, prefix) {
|
||||
if (usage !== c.SUPPRESS) {
|
||||
this._addItem(this._formatUsage, [ usage, actions, groups, prefix ]);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* HelpFormatter#addArgument(action) -> Void
|
||||
* - action (object): action
|
||||
*
|
||||
* Add argument into current section
|
||||
*
|
||||
* Single variant of [[HelpFormatter#addArguments]]
|
||||
**/
|
||||
HelpFormatter.prototype.addArgument = function (action) {
|
||||
if (action.help !== c.SUPPRESS) {
|
||||
var self = this;
|
||||
|
||||
// find all invocations
|
||||
var invocations = [ this._formatActionInvocation(action) ];
|
||||
var invocationLength = invocations[0].length;
|
||||
|
||||
var actionLength;
|
||||
|
||||
if (action._getSubactions) {
|
||||
this._indent();
|
||||
action._getSubactions().forEach(function (subaction) {
|
||||
|
||||
var invocationNew = self._formatActionInvocation(subaction);
|
||||
invocations.push(invocationNew);
|
||||
invocationLength = Math.max(invocationLength, invocationNew.length);
|
||||
|
||||
});
|
||||
this._dedent();
|
||||
}
|
||||
|
||||
// update the maximum item length
|
||||
actionLength = invocationLength + this._currentIndent;
|
||||
this._actionMaxLength = Math.max(this._actionMaxLength, actionLength);
|
||||
|
||||
// add the item to the list
|
||||
this._addItem(this._formatAction, [ action ]);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* HelpFormatter#addArguments(actions) -> Void
|
||||
* - actions (array): actions list
|
||||
*
|
||||
* Mass add arguments into current section
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* formatter.startSection(actionGroup.title);
|
||||
* formatter.addText(actionGroup.description);
|
||||
* formatter.addArguments(actionGroup._groupActions);
|
||||
* formatter.endSection();
|
||||
*
|
||||
**/
|
||||
HelpFormatter.prototype.addArguments = function (actions) {
|
||||
var self = this;
|
||||
actions.forEach(function (action) {
|
||||
self.addArgument(action);
|
||||
});
|
||||
};
|
||||
|
||||
//
|
||||
// Help-formatting methods
|
||||
//
|
||||
|
||||
/**
|
||||
* HelpFormatter#formatHelp -> string
|
||||
*
|
||||
* Format help
|
||||
*
|
||||
* ##### Example
|
||||
*
|
||||
* formatter.addText(this.epilog);
|
||||
* return formatter.formatHelp();
|
||||
*
|
||||
**/
|
||||
HelpFormatter.prototype.formatHelp = function () {
|
||||
var help = this._rootSection.formatHelp(this);
|
||||
if (help) {
|
||||
help = help.replace(this._longBreakMatcher, c.EOL + c.EOL);
|
||||
help = $$.trimChars(help, c.EOL) + c.EOL;
|
||||
}
|
||||
return help;
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._joinParts = function (partStrings) {
|
||||
return partStrings.filter(function (part) {
|
||||
return (part && part !== c.SUPPRESS);
|
||||
}).join('');
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._formatUsage = function (usage, actions, groups, prefix) {
|
||||
if (!prefix && typeof prefix !== 'string') {
|
||||
prefix = 'usage: ';
|
||||
}
|
||||
|
||||
actions = actions || [];
|
||||
groups = groups || [];
|
||||
|
||||
|
||||
// if usage is specified, use that
|
||||
if (usage) {
|
||||
usage = sprintf(usage, { prog: this._prog });
|
||||
|
||||
// if no optionals or positionals are available, usage is just prog
|
||||
} else if (!usage && actions.length === 0) {
|
||||
usage = this._prog;
|
||||
|
||||
// if optionals and positionals are available, calculate usage
|
||||
} else if (!usage) {
|
||||
var prog = this._prog;
|
||||
var optionals = [];
|
||||
var positionals = [];
|
||||
var actionUsage;
|
||||
var textWidth;
|
||||
|
||||
// split optionals from positionals
|
||||
actions.forEach(function (action) {
|
||||
if (action.isOptional()) {
|
||||
optionals.push(action);
|
||||
} else {
|
||||
positionals.push(action);
|
||||
}
|
||||
});
|
||||
|
||||
// build full usage string
|
||||
actionUsage = this._formatActionsUsage([].concat(optionals, positionals), groups);
|
||||
usage = [ prog, actionUsage ].join(' ');
|
||||
|
||||
// wrap the usage parts if it's too long
|
||||
textWidth = this._width - this._currentIndent;
|
||||
if ((prefix.length + usage.length) > textWidth) {
|
||||
|
||||
// break usage into wrappable parts
|
||||
var regexpPart = new RegExp('\\(.*?\\)+|\\[.*?\\]+|\\S+', 'g');
|
||||
var optionalUsage = this._formatActionsUsage(optionals, groups);
|
||||
var positionalUsage = this._formatActionsUsage(positionals, groups);
|
||||
|
||||
|
||||
var optionalParts = optionalUsage.match(regexpPart);
|
||||
var positionalParts = positionalUsage.match(regexpPart) || [];
|
||||
|
||||
if (optionalParts.join(' ') !== optionalUsage) {
|
||||
throw new Error('assert "optionalParts.join(\' \') === optionalUsage"');
|
||||
}
|
||||
if (positionalParts.join(' ') !== positionalUsage) {
|
||||
throw new Error('assert "positionalParts.join(\' \') === positionalUsage"');
|
||||
}
|
||||
|
||||
// helper for wrapping lines
|
||||
/*eslint-disable func-style*/ // node 0.10 compat
|
||||
var _getLines = function (parts, indent, prefix) {
|
||||
var lines = [];
|
||||
var line = [];
|
||||
|
||||
var lineLength = prefix ? prefix.length - 1 : indent.length - 1;
|
||||
|
||||
parts.forEach(function (part) {
|
||||
if (lineLength + 1 + part.length > textWidth) {
|
||||
lines.push(indent + line.join(' '));
|
||||
line = [];
|
||||
lineLength = indent.length - 1;
|
||||
}
|
||||
line.push(part);
|
||||
lineLength += part.length + 1;
|
||||
});
|
||||
|
||||
if (line) {
|
||||
lines.push(indent + line.join(' '));
|
||||
}
|
||||
if (prefix) {
|
||||
lines[0] = lines[0].substr(indent.length);
|
||||
}
|
||||
return lines;
|
||||
};
|
||||
|
||||
var lines, indent, parts;
|
||||
// if prog is short, follow it with optionals or positionals
|
||||
if (prefix.length + prog.length <= 0.75 * textWidth) {
|
||||
indent = $$.repeat(' ', (prefix.length + prog.length + 1));
|
||||
if (optionalParts) {
|
||||
lines = [].concat(
|
||||
_getLines([ prog ].concat(optionalParts), indent, prefix),
|
||||
_getLines(positionalParts, indent)
|
||||
);
|
||||
} else if (positionalParts) {
|
||||
lines = _getLines([ prog ].concat(positionalParts), indent, prefix);
|
||||
} else {
|
||||
lines = [ prog ];
|
||||
}
|
||||
|
||||
// if prog is long, put it on its own line
|
||||
} else {
|
||||
indent = $$.repeat(' ', prefix.length);
|
||||
parts = optionalParts.concat(positionalParts);
|
||||
lines = _getLines(parts, indent);
|
||||
if (lines.length > 1) {
|
||||
lines = [].concat(
|
||||
_getLines(optionalParts, indent),
|
||||
_getLines(positionalParts, indent)
|
||||
);
|
||||
}
|
||||
lines = [ prog ].concat(lines);
|
||||
}
|
||||
// join lines into usage
|
||||
usage = lines.join(c.EOL);
|
||||
}
|
||||
}
|
||||
|
||||
// prefix with 'usage:'
|
||||
return prefix + usage + c.EOL + c.EOL;
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._formatActionsUsage = function (actions, groups) {
|
||||
// find group indices and identify actions in groups
|
||||
var groupActions = [];
|
||||
var inserts = [];
|
||||
var self = this;
|
||||
|
||||
groups.forEach(function (group) {
|
||||
var end;
|
||||
var i;
|
||||
|
||||
var start = actions.indexOf(group._groupActions[0]);
|
||||
if (start >= 0) {
|
||||
end = start + group._groupActions.length;
|
||||
|
||||
//if (actions.slice(start, end) === group._groupActions) {
|
||||
if ($$.arrayEqual(actions.slice(start, end), group._groupActions)) {
|
||||
group._groupActions.forEach(function (action) {
|
||||
groupActions.push(action);
|
||||
});
|
||||
|
||||
if (!group.required) {
|
||||
if (inserts[start]) {
|
||||
inserts[start] += ' [';
|
||||
} else {
|
||||
inserts[start] = '[';
|
||||
}
|
||||
inserts[end] = ']';
|
||||
} else {
|
||||
if (inserts[start]) {
|
||||
inserts[start] += ' (';
|
||||
} else {
|
||||
inserts[start] = '(';
|
||||
}
|
||||
inserts[end] = ')';
|
||||
}
|
||||
for (i = start + 1; i < end; i += 1) {
|
||||
inserts[i] = '|';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// collect all actions format strings
|
||||
var parts = [];
|
||||
|
||||
actions.forEach(function (action, actionIndex) {
|
||||
var part;
|
||||
var optionString;
|
||||
var argsDefault;
|
||||
var argsString;
|
||||
|
||||
// suppressed arguments are marked with None
|
||||
// remove | separators for suppressed arguments
|
||||
if (action.help === c.SUPPRESS) {
|
||||
parts.push(null);
|
||||
if (inserts[actionIndex] === '|') {
|
||||
inserts.splice(actionIndex, actionIndex);
|
||||
} else if (inserts[actionIndex + 1] === '|') {
|
||||
inserts.splice(actionIndex + 1, actionIndex + 1);
|
||||
}
|
||||
|
||||
// produce all arg strings
|
||||
} else if (!action.isOptional()) {
|
||||
part = self._formatArgs(action, action.dest);
|
||||
|
||||
// if it's in a group, strip the outer []
|
||||
if (groupActions.indexOf(action) >= 0) {
|
||||
if (part[0] === '[' && part[part.length - 1] === ']') {
|
||||
part = part.slice(1, -1);
|
||||
}
|
||||
}
|
||||
// add the action string to the list
|
||||
parts.push(part);
|
||||
|
||||
// produce the first way to invoke the option in brackets
|
||||
} else {
|
||||
optionString = action.optionStrings[0];
|
||||
|
||||
// if the Optional doesn't take a value, format is: -s or --long
|
||||
if (action.nargs === 0) {
|
||||
part = '' + optionString;
|
||||
|
||||
// if the Optional takes a value, format is: -s ARGS or --long ARGS
|
||||
} else {
|
||||
argsDefault = action.dest.toUpperCase();
|
||||
argsString = self._formatArgs(action, argsDefault);
|
||||
part = optionString + ' ' + argsString;
|
||||
}
|
||||
// make it look optional if it's not required or in a group
|
||||
if (!action.required && groupActions.indexOf(action) < 0) {
|
||||
part = '[' + part + ']';
|
||||
}
|
||||
// add the action string to the list
|
||||
parts.push(part);
|
||||
}
|
||||
});
|
||||
|
||||
// insert things at the necessary indices
|
||||
for (var i = inserts.length - 1; i >= 0; --i) {
|
||||
if (inserts[i] !== null) {
|
||||
parts.splice(i, 0, inserts[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// join all the action items with spaces
|
||||
var text = parts.filter(function (part) {
|
||||
return !!part;
|
||||
}).join(' ');
|
||||
|
||||
// clean up separators for mutually exclusive groups
|
||||
text = text.replace(/([\[(]) /g, '$1'); // remove spaces
|
||||
text = text.replace(/ ([\])])/g, '$1');
|
||||
text = text.replace(/\[ *\]/g, ''); // remove empty groups
|
||||
text = text.replace(/\( *\)/g, '');
|
||||
text = text.replace(/\(([^|]*)\)/g, '$1'); // remove () from single action groups
|
||||
|
||||
text = text.trim();
|
||||
|
||||
// return the text
|
||||
return text;
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._formatText = function (text) {
|
||||
text = sprintf(text, { prog: this._prog });
|
||||
var textWidth = this._width - this._currentIndent;
|
||||
var indentIncriment = $$.repeat(' ', this._currentIndent);
|
||||
return this._fillText(text, textWidth, indentIncriment) + c.EOL + c.EOL;
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._formatAction = function (action) {
|
||||
var self = this;
|
||||
|
||||
var helpText;
|
||||
var helpLines;
|
||||
var parts;
|
||||
var indentFirst;
|
||||
|
||||
// determine the required width and the entry label
|
||||
var helpPosition = Math.min(this._actionMaxLength + 2, this._maxHelpPosition);
|
||||
var helpWidth = this._width - helpPosition;
|
||||
var actionWidth = helpPosition - this._currentIndent - 2;
|
||||
var actionHeader = this._formatActionInvocation(action);
|
||||
|
||||
// no help; start on same line and add a final newline
|
||||
if (!action.help) {
|
||||
actionHeader = $$.repeat(' ', this._currentIndent) + actionHeader + c.EOL;
|
||||
|
||||
// short action name; start on the same line and pad two spaces
|
||||
} else if (actionHeader.length <= actionWidth) {
|
||||
actionHeader = $$.repeat(' ', this._currentIndent) +
|
||||
actionHeader +
|
||||
' ' +
|
||||
$$.repeat(' ', actionWidth - actionHeader.length);
|
||||
indentFirst = 0;
|
||||
|
||||
// long action name; start on the next line
|
||||
} else {
|
||||
actionHeader = $$.repeat(' ', this._currentIndent) + actionHeader + c.EOL;
|
||||
indentFirst = helpPosition;
|
||||
}
|
||||
|
||||
// collect the pieces of the action help
|
||||
parts = [ actionHeader ];
|
||||
|
||||
// if there was help for the action, add lines of help text
|
||||
if (action.help) {
|
||||
helpText = this._expandHelp(action);
|
||||
helpLines = this._splitLines(helpText, helpWidth);
|
||||
parts.push($$.repeat(' ', indentFirst) + helpLines[0] + c.EOL);
|
||||
helpLines.slice(1).forEach(function (line) {
|
||||
parts.push($$.repeat(' ', helpPosition) + line + c.EOL);
|
||||
});
|
||||
|
||||
// or add a newline if the description doesn't end with one
|
||||
} else if (actionHeader.charAt(actionHeader.length - 1) !== c.EOL) {
|
||||
parts.push(c.EOL);
|
||||
}
|
||||
// if there are any sub-actions, add their help as well
|
||||
if (action._getSubactions) {
|
||||
this._indent();
|
||||
action._getSubactions().forEach(function (subaction) {
|
||||
parts.push(self._formatAction(subaction));
|
||||
});
|
||||
this._dedent();
|
||||
}
|
||||
// return a single string
|
||||
return this._joinParts(parts);
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._formatActionInvocation = function (action) {
|
||||
if (!action.isOptional()) {
|
||||
var format_func = this._metavarFormatter(action, action.dest);
|
||||
var metavars = format_func(1);
|
||||
return metavars[0];
|
||||
}
|
||||
|
||||
var parts = [];
|
||||
var argsDefault;
|
||||
var argsString;
|
||||
|
||||
// if the Optional doesn't take a value, format is: -s, --long
|
||||
if (action.nargs === 0) {
|
||||
parts = parts.concat(action.optionStrings);
|
||||
|
||||
// if the Optional takes a value, format is: -s ARGS, --long ARGS
|
||||
} else {
|
||||
argsDefault = action.dest.toUpperCase();
|
||||
argsString = this._formatArgs(action, argsDefault);
|
||||
action.optionStrings.forEach(function (optionString) {
|
||||
parts.push(optionString + ' ' + argsString);
|
||||
});
|
||||
}
|
||||
return parts.join(', ');
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._metavarFormatter = function (action, metavarDefault) {
|
||||
var result;
|
||||
|
||||
if (action.metavar || action.metavar === '') {
|
||||
result = action.metavar;
|
||||
} else if (action.choices) {
|
||||
var choices = action.choices;
|
||||
|
||||
if (typeof choices === 'string') {
|
||||
choices = choices.split('').join(', ');
|
||||
} else if (Array.isArray(choices)) {
|
||||
choices = choices.join(',');
|
||||
} else {
|
||||
choices = Object.keys(choices).join(',');
|
||||
}
|
||||
result = '{' + choices + '}';
|
||||
} else {
|
||||
result = metavarDefault;
|
||||
}
|
||||
|
||||
return function (size) {
|
||||
if (Array.isArray(result)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
var metavars = [];
|
||||
for (var i = 0; i < size; i += 1) {
|
||||
metavars.push(result);
|
||||
}
|
||||
return metavars;
|
||||
};
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._formatArgs = function (action, metavarDefault) {
|
||||
var result;
|
||||
var metavars;
|
||||
|
||||
var buildMetavar = this._metavarFormatter(action, metavarDefault);
|
||||
|
||||
switch (action.nargs) {
|
||||
/*eslint-disable no-undefined*/
|
||||
case undefined:
|
||||
case null:
|
||||
metavars = buildMetavar(1);
|
||||
result = '' + metavars[0];
|
||||
break;
|
||||
case c.OPTIONAL:
|
||||
metavars = buildMetavar(1);
|
||||
result = '[' + metavars[0] + ']';
|
||||
break;
|
||||
case c.ZERO_OR_MORE:
|
||||
metavars = buildMetavar(2);
|
||||
result = '[' + metavars[0] + ' [' + metavars[1] + ' ...]]';
|
||||
break;
|
||||
case c.ONE_OR_MORE:
|
||||
metavars = buildMetavar(2);
|
||||
result = '' + metavars[0] + ' [' + metavars[1] + ' ...]';
|
||||
break;
|
||||
case c.REMAINDER:
|
||||
result = '...';
|
||||
break;
|
||||
case c.PARSER:
|
||||
metavars = buildMetavar(1);
|
||||
result = metavars[0] + ' ...';
|
||||
break;
|
||||
default:
|
||||
metavars = buildMetavar(action.nargs);
|
||||
result = metavars.join(' ');
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._expandHelp = function (action) {
|
||||
var params = { prog: this._prog };
|
||||
|
||||
Object.keys(action).forEach(function (actionProperty) {
|
||||
var actionValue = action[actionProperty];
|
||||
|
||||
if (actionValue !== c.SUPPRESS) {
|
||||
params[actionProperty] = actionValue;
|
||||
}
|
||||
});
|
||||
|
||||
if (params.choices) {
|
||||
if (typeof params.choices === 'string') {
|
||||
params.choices = params.choices.split('').join(', ');
|
||||
} else if (Array.isArray(params.choices)) {
|
||||
params.choices = params.choices.join(', ');
|
||||
} else {
|
||||
params.choices = Object.keys(params.choices).join(', ');
|
||||
}
|
||||
}
|
||||
|
||||
return sprintf(this._getHelpString(action), params);
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._splitLines = function (text, width) {
|
||||
var lines = [];
|
||||
var delimiters = [ ' ', '.', ',', '!', '?' ];
|
||||
var re = new RegExp('[' + delimiters.join('') + '][^' + delimiters.join('') + ']*$');
|
||||
|
||||
text = text.replace(/[\n\|\t]/g, ' ');
|
||||
|
||||
text = text.trim();
|
||||
text = text.replace(this._whitespaceMatcher, ' ');
|
||||
|
||||
// Wraps the single paragraph in text (a string) so every line
|
||||
// is at most width characters long.
|
||||
text.split(c.EOL).forEach(function (line) {
|
||||
if (width >= line.length) {
|
||||
lines.push(line);
|
||||
return;
|
||||
}
|
||||
|
||||
var wrapStart = 0;
|
||||
var wrapEnd = width;
|
||||
var delimiterIndex = 0;
|
||||
while (wrapEnd <= line.length) {
|
||||
if (wrapEnd !== line.length && delimiters.indexOf(line[wrapEnd] < -1)) {
|
||||
delimiterIndex = (re.exec(line.substring(wrapStart, wrapEnd)) || {}).index;
|
||||
wrapEnd = wrapStart + delimiterIndex + 1;
|
||||
}
|
||||
lines.push(line.substring(wrapStart, wrapEnd));
|
||||
wrapStart = wrapEnd;
|
||||
wrapEnd += width;
|
||||
}
|
||||
if (wrapStart < line.length) {
|
||||
lines.push(line.substring(wrapStart, wrapEnd));
|
||||
}
|
||||
});
|
||||
|
||||
return lines;
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._fillText = function (text, width, indent) {
|
||||
var lines = this._splitLines(text, width);
|
||||
lines = lines.map(function (line) {
|
||||
return indent + line;
|
||||
});
|
||||
return lines.join(c.EOL);
|
||||
};
|
||||
|
||||
HelpFormatter.prototype._getHelpString = function (action) {
|
||||
return action.help;
|
||||
};
|
76
node_modules/argparse/lib/namespace.js
generated
vendored
Normal file
76
node_modules/argparse/lib/namespace.js
generated
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
/**
|
||||
* class Namespace
|
||||
*
|
||||
* Simple object for storing attributes. Implements equality by attribute names
|
||||
* and values, and provides a simple string representation.
|
||||
*
|
||||
* See also [original guide][1]
|
||||
*
|
||||
* [1]:http://docs.python.org/dev/library/argparse.html#the-namespace-object
|
||||
**/
|
||||
'use strict';
|
||||
|
||||
var $$ = require('./utils');
|
||||
|
||||
/**
|
||||
* new Namespace(options)
|
||||
* - options(object): predefined propertis for result object
|
||||
*
|
||||
**/
|
||||
var Namespace = module.exports = function Namespace(options) {
|
||||
$$.extend(this, options);
|
||||
};
|
||||
|
||||
/**
|
||||
* Namespace#isset(key) -> Boolean
|
||||
* - key (string|number): property name
|
||||
*
|
||||
* Tells whenever `namespace` contains given `key` or not.
|
||||
**/
|
||||
Namespace.prototype.isset = function (key) {
|
||||
return $$.has(this, key);
|
||||
};
|
||||
|
||||
/**
|
||||
* Namespace#set(key, value) -> self
|
||||
* -key (string|number|object): propery name
|
||||
* -value (mixed): new property value
|
||||
*
|
||||
* Set the property named key with value.
|
||||
* If key object then set all key properties to namespace object
|
||||
**/
|
||||
Namespace.prototype.set = function (key, value) {
|
||||
if (typeof (key) === 'object') {
|
||||
$$.extend(this, key);
|
||||
} else {
|
||||
this[key] = value;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Namespace#get(key, defaultValue) -> mixed
|
||||
* - key (string|number): property name
|
||||
* - defaultValue (mixed): default value
|
||||
*
|
||||
* Return the property key or defaulValue if not set
|
||||
**/
|
||||
Namespace.prototype.get = function (key, defaultValue) {
|
||||
return !this[key] ? defaultValue : this[key];
|
||||
};
|
||||
|
||||
/**
|
||||
* Namespace#unset(key, defaultValue) -> mixed
|
||||
* - key (string|number): property name
|
||||
* - defaultValue (mixed): default value
|
||||
*
|
||||
* Return data[key](and delete it) or defaultValue
|
||||
**/
|
||||
Namespace.prototype.unset = function (key, defaultValue) {
|
||||
var value = this[key];
|
||||
if (value !== null) {
|
||||
delete this[key];
|
||||
return value;
|
||||
}
|
||||
return defaultValue;
|
||||
};
|
57
node_modules/argparse/lib/utils.js
generated
vendored
Normal file
57
node_modules/argparse/lib/utils.js
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
'use strict';
|
||||
|
||||
exports.repeat = function (str, num) {
|
||||
var result = '';
|
||||
for (var i = 0; i < num; i++) { result += str; }
|
||||
return result;
|
||||
};
|
||||
|
||||
exports.arrayEqual = function (a, b) {
|
||||
if (a.length !== b.length) { return false; }
|
||||
for (var i = 0; i < a.length; i++) {
|
||||
if (a[i] !== b[i]) { return false; }
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
exports.trimChars = function (str, chars) {
|
||||
var start = 0;
|
||||
var end = str.length - 1;
|
||||
while (chars.indexOf(str.charAt(start)) >= 0) { start++; }
|
||||
while (chars.indexOf(str.charAt(end)) >= 0) { end--; }
|
||||
return str.slice(start, end + 1);
|
||||
};
|
||||
|
||||
exports.capitalize = function (str) {
|
||||
return str.charAt(0).toUpperCase() + str.slice(1);
|
||||
};
|
||||
|
||||
exports.arrayUnion = function () {
|
||||
var result = [];
|
||||
for (var i = 0, values = {}; i < arguments.length; i++) {
|
||||
var arr = arguments[i];
|
||||
for (var j = 0; j < arr.length; j++) {
|
||||
if (!values[arr[j]]) {
|
||||
values[arr[j]] = true;
|
||||
result.push(arr[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
function has(obj, key) {
|
||||
return Object.prototype.hasOwnProperty.call(obj, key);
|
||||
}
|
||||
|
||||
exports.has = has;
|
||||
|
||||
exports.extend = function (dest, src) {
|
||||
for (var i in src) {
|
||||
if (has(src, i)) { dest[i] = src[i]; }
|
||||
}
|
||||
};
|
||||
|
||||
exports.trimEnd = function (str) {
|
||||
return str.replace(/\s+$/g, '');
|
||||
};
|
70
node_modules/argparse/package.json
generated
vendored
Normal file
70
node_modules/argparse/package.json
generated
vendored
Normal file
@ -0,0 +1,70 @@
|
||||
{
|
||||
"_from": "argparse@^1.0.2",
|
||||
"_id": "argparse@1.0.10",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
|
||||
"_location": "/argparse",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "argparse@^1.0.2",
|
||||
"name": "argparse",
|
||||
"escapedName": "argparse",
|
||||
"rawSpec": "^1.0.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/js-yaml"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
|
||||
"_shasum": "bcd6791ea5ae09725e17e5ad988134cd40b3d911",
|
||||
"_spec": "argparse@^1.0.2",
|
||||
"_where": "/home/lrullo/httpdocs/anorgatarrak.eus/wp-content/themes/anorgatarrak/node_modules/js-yaml",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nodeca/argparse/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Eugene Shkuropat"
|
||||
},
|
||||
{
|
||||
"name": "Paul Jacobson"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"sprintf-js": "~1.0.2"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library",
|
||||
"devDependencies": {
|
||||
"eslint": "^2.13.1",
|
||||
"istanbul": "^0.4.5",
|
||||
"mocha": "^3.1.0",
|
||||
"ndoc": "^5.0.1"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib/"
|
||||
],
|
||||
"homepage": "https://github.com/nodeca/argparse#readme",
|
||||
"keywords": [
|
||||
"cli",
|
||||
"parser",
|
||||
"argparse",
|
||||
"option",
|
||||
"args"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "argparse",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/nodeca/argparse.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "make test"
|
||||
},
|
||||
"version": "1.0.10"
|
||||
}
|
25
node_modules/array-find-index/index.js
generated
vendored
Normal file
25
node_modules/array-find-index/index.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
module.exports = function (arr, predicate, ctx) {
|
||||
if (typeof Array.prototype.findIndex === 'function') {
|
||||
return arr.findIndex(predicate, ctx);
|
||||
}
|
||||
|
||||
if (typeof predicate !== 'function') {
|
||||
throw new TypeError('predicate must be a function');
|
||||
}
|
||||
|
||||
var list = Object(arr);
|
||||
var len = list.length;
|
||||
|
||||
if (len === 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (var i = 0; i < len; i++) {
|
||||
if (predicate.call(ctx, list[i], i, list)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
};
|
21
node_modules/array-find-index/license
generated
vendored
Normal file
21
node_modules/array-find-index/license
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
67
node_modules/array-find-index/package.json
generated
vendored
Normal file
67
node_modules/array-find-index/package.json
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
{
|
||||
"_from": "array-find-index@^1.0.1",
|
||||
"_id": "array-find-index@1.0.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=",
|
||||
"_location": "/array-find-index",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "array-find-index@^1.0.1",
|
||||
"name": "array-find-index",
|
||||
"escapedName": "array-find-index",
|
||||
"rawSpec": "^1.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/currently-unhandled"
|
||||
],
|
||||
"_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": "/home/lrullo/httpdocs/anorgatarrak.eus/wp-content/themes/anorgatarrak/node_modules/currently-unhandled",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/array-find-index/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "ES2015 `Array#findIndex()` ponyfill",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/array-find-index#readme",
|
||||
"keywords": [
|
||||
"es2015",
|
||||
"ponyfill",
|
||||
"polyfill",
|
||||
"shim",
|
||||
"find",
|
||||
"index",
|
||||
"findindex",
|
||||
"array"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "array-find-index",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/array-find-index.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "1.0.2"
|
||||
}
|
30
node_modules/array-find-index/readme.md
generated
vendored
Normal file
30
node_modules/array-find-index/readme.md
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
# array-find-index [![Build Status](https://travis-ci.org/sindresorhus/array-find-index.svg?branch=master)](https://travis-ci.org/sindresorhus/array-find-index)
|
||||
|
||||
> ES2015 [`Array#findIndex()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) [ponyfill](https://ponyfill.com)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save array-find-index
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const arrayFindIndex = require('array-find-index');
|
||||
|
||||
arrayFindIndex(['rainbow', 'unicorn', 'pony'], x => x === 'unicorn');
|
||||
//=> 1
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
Same as `Array#findIndex()`, but with the input array as the first argument.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
125
node_modules/async/CHANGELOG.md
generated
vendored
Normal file
125
node_modules/async/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,125 @@
|
||||
# v1.5.2
|
||||
- Allow using `"consructor"` as an argument in `memoize` (#998)
|
||||
- Give a better error messsage when `auto` dependency checking fails (#994)
|
||||
- Various doc updates (#936, #956, #979, #1002)
|
||||
|
||||
# v1.5.1
|
||||
- Fix issue with `pause` in `queue` with concurrency enabled (#946)
|
||||
- `while` and `until` now pass the final result to callback (#963)
|
||||
- `auto` will properly handle concurrency when there is no callback (#966)
|
||||
- `auto` will now properly stop execution when an error occurs (#988, #993)
|
||||
- Various doc fixes (#971, #980)
|
||||
|
||||
# v1.5.0
|
||||
|
||||
- Added `transform`, analogous to [`_.transform`](http://lodash.com/docs#transform) (#892)
|
||||
- `map` now returns an object when an object is passed in, rather than array with non-numeric keys. `map` will begin always returning an array with numeric indexes in the next major release. (#873)
|
||||
- `auto` now accepts an optional `concurrency` argument to limit the number of running tasks (#637)
|
||||
- Added `queue#workersList()`, to retrieve the list of currently running tasks. (#891)
|
||||
- Various code simplifications (#896, #904)
|
||||
- Various doc fixes :scroll: (#890, #894, #903, #905, #912)
|
||||
|
||||
# v1.4.2
|
||||
|
||||
- Ensure coverage files don't get published on npm (#879)
|
||||
|
||||
# v1.4.1
|
||||
|
||||
- Add in overlooked `detectLimit` method (#866)
|
||||
- Removed unnecessary files from npm releases (#861)
|
||||
- Removed usage of a reserved word to prevent :boom: in older environments (#870)
|
||||
|
||||
# v1.4.0
|
||||
|
||||
- `asyncify` now supports promises (#840)
|
||||
- Added `Limit` versions of `filter` and `reject` (#836)
|
||||
- Add `Limit` versions of `detect`, `some` and `every` (#828, #829)
|
||||
- `some`, `every` and `detect` now short circuit early (#828, #829)
|
||||
- Improve detection of the global object (#804), enabling use in WebWorkers
|
||||
- `whilst` now called with arguments from iterator (#823)
|
||||
- `during` now gets called with arguments from iterator (#824)
|
||||
- Code simplifications and optimizations aplenty ([diff](https://github.com/caolan/async/compare/v1.3.0...v1.4.0))
|
||||
|
||||
|
||||
# v1.3.0
|
||||
|
||||
New Features:
|
||||
- Added `constant`
|
||||
- Added `asyncify`/`wrapSync` for making sync functions work with callbacks. (#671, #806)
|
||||
- Added `during` and `doDuring`, which are like `whilst` with an async truth test. (#800)
|
||||
- `retry` now accepts an `interval` parameter to specify a delay between retries. (#793)
|
||||
- `async` should work better in Web Workers due to better `root` detection (#804)
|
||||
- Callbacks are now optional in `whilst`, `doWhilst`, `until`, and `doUntil` (#642)
|
||||
- Various internal updates (#786, #801, #802, #803)
|
||||
- Various doc fixes (#790, #794)
|
||||
|
||||
Bug Fixes:
|
||||
- `cargo` now exposes the `payload` size, and `cargo.payload` can be changed on the fly after the `cargo` is created. (#740, #744, #783)
|
||||
|
||||
|
||||
# v1.2.1
|
||||
|
||||
Bug Fix:
|
||||
|
||||
- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782)
|
||||
|
||||
|
||||
# v1.2.0
|
||||
|
||||
New Features:
|
||||
|
||||
- Added `timesLimit` (#743)
|
||||
- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`. The new concurrency will be reflected the next time a task is processed. (#747, #772)
|
||||
|
||||
Bug Fixes:
|
||||
|
||||
- Fixed a regression in `each` and family with empty arrays that have additional properties. (#775, #777)
|
||||
|
||||
|
||||
# v1.1.1
|
||||
|
||||
Bug Fix:
|
||||
|
||||
- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782)
|
||||
|
||||
|
||||
# v1.1.0
|
||||
|
||||
New Features:
|
||||
|
||||
- `cargo` now supports all of the same methods and event callbacks as `queue`.
|
||||
- Added `ensureAsync` - A wrapper that ensures an async function calls its callback on a later tick. (#769)
|
||||
- Optimized `map`, `eachOf`, and `waterfall` families of functions
|
||||
- Passing a `null` or `undefined` array to `map`, `each`, `parallel` and families will be treated as an empty array (#667).
|
||||
- The callback is now optional for the composed results of `compose` and `seq`. (#618)
|
||||
- Reduced file size by 4kb, (minified version by 1kb)
|
||||
- Added code coverage through `nyc` and `coveralls` (#768)
|
||||
|
||||
Bug Fixes:
|
||||
|
||||
- `forever` will no longer stack overflow with a synchronous iterator (#622)
|
||||
- `eachLimit` and other limit functions will stop iterating once an error occurs (#754)
|
||||
- Always pass `null` in callbacks when there is no error (#439)
|
||||
- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue (#668)
|
||||
- `each` and family will properly handle an empty array (#578)
|
||||
- `eachSeries` and family will finish if the underlying array is modified during execution (#557)
|
||||
- `queue` will throw if a non-function is passed to `q.push()` (#593)
|
||||
- Doc fixes (#629, #766)
|
||||
|
||||
|
||||
# v1.0.0
|
||||
|
||||
No known breaking changes, we are simply complying with semver from here on out.
|
||||
|
||||
Changes:
|
||||
|
||||
- Start using a changelog!
|
||||
- Add `forEachOf` for iterating over Objects (or to iterate Arrays with indexes available) (#168 #704 #321)
|
||||
- Detect deadlocks in `auto` (#663)
|
||||
- Better support for require.js (#527)
|
||||
- Throw if queue created with concurrency `0` (#714)
|
||||
- Fix unneeded iteration in `queue.resume()` (#758)
|
||||
- Guard against timer mocking overriding `setImmediate` (#609 #611)
|
||||
- Miscellaneous doc fixes (#542 #596 #615 #628 #631 #690 #729)
|
||||
- Use single noop function internally (#546)
|
||||
- Optimize internal `_each`, `_map` and `_keys` functions.
|
19
node_modules/async/LICENSE
generated
vendored
Normal file
19
node_modules/async/LICENSE
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright (c) 2010-2014 Caolan McMahon
|
||||
|
||||
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.
|
1877
node_modules/async/README.md
generated
vendored
Normal file
1877
node_modules/async/README.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1265
node_modules/async/dist/async.js
generated
vendored
Normal file
1265
node_modules/async/dist/async.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2
node_modules/async/dist/async.min.js
generated
vendored
Normal file
2
node_modules/async/dist/async.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1265
node_modules/async/lib/async.js
generated
vendored
Normal file
1265
node_modules/async/lib/async.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
113
node_modules/async/package.json
generated
vendored
Normal file
113
node_modules/async/package.json
generated
vendored
Normal file
@ -0,0 +1,113 @@
|
||||
{
|
||||
"_from": "async@~1.5.2",
|
||||
"_id": "async@1.5.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=",
|
||||
"_location": "/async",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "async@~1.5.2",
|
||||
"name": "async",
|
||||
"escapedName": "async",
|
||||
"rawSpec": "~1.5.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~1.5.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/grunt-legacy-util"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
|
||||
"_shasum": "ec6a61ae56480c0c3cb241c95618e20892f9672a",
|
||||
"_spec": "async@~1.5.2",
|
||||
"_where": "/home/lrullo/httpdocs/anorgatarrak.eus/wp-content/themes/anorgatarrak/node_modules/grunt-legacy-util",
|
||||
"author": {
|
||||
"name": "Caolan McMahon"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/caolan/async/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Higher-order functions and common patterns for asynchronous code",
|
||||
"devDependencies": {
|
||||
"benchmark": "github:bestiejs/benchmark.js",
|
||||
"bluebird": "^2.9.32",
|
||||
"chai": "^3.1.0",
|
||||
"coveralls": "^2.11.2",
|
||||
"es6-promise": "^2.3.0",
|
||||
"jscs": "^1.13.1",
|
||||
"jshint": "~2.8.0",
|
||||
"karma": "^0.13.2",
|
||||
"karma-browserify": "^4.2.1",
|
||||
"karma-firefox-launcher": "^0.1.6",
|
||||
"karma-mocha": "^0.2.0",
|
||||
"karma-mocha-reporter": "^1.0.2",
|
||||
"lodash": "^3.9.0",
|
||||
"mkdirp": "~0.5.1",
|
||||
"mocha": "^2.2.5",
|
||||
"native-promise-only": "^0.8.0-a",
|
||||
"nodeunit": ">0.0.0",
|
||||
"nyc": "^2.1.0",
|
||||
"rsvp": "^3.0.18",
|
||||
"semver": "^4.3.6",
|
||||
"uglify-js": "~2.4.0",
|
||||
"xyz": "^0.5.0",
|
||||
"yargs": "~3.9.1"
|
||||
},
|
||||
"files": [
|
||||
"lib",
|
||||
"dist/async.js",
|
||||
"dist/async.min.js"
|
||||
],
|
||||
"homepage": "https://github.com/caolan/async#readme",
|
||||
"jam": {
|
||||
"main": "lib/async.js",
|
||||
"include": [
|
||||
"lib/async.js",
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"categories": [
|
||||
"Utilities"
|
||||
]
|
||||
},
|
||||
"keywords": [
|
||||
"async",
|
||||
"callback",
|
||||
"utility",
|
||||
"module"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/async.js",
|
||||
"name": "async",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/caolan/async.git"
|
||||
},
|
||||
"scripts": {
|
||||
"coverage": "nyc npm test && nyc report",
|
||||
"coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls",
|
||||
"lint": "jshint lib/*.js test/*.js perf/*.js && jscs lib/*.js test/*.js perf/*.js",
|
||||
"mocha-browser-test": "karma start",
|
||||
"mocha-node-test": "mocha mocha_test/",
|
||||
"mocha-test": "npm run mocha-node-test && npm run mocha-browser-test",
|
||||
"nodeunit-test": "nodeunit test/test-async.js",
|
||||
"test": "npm run-script lint && npm run nodeunit-test && npm run mocha-test"
|
||||
},
|
||||
"spm": {
|
||||
"main": "lib/async.js"
|
||||
},
|
||||
"version": "1.5.2",
|
||||
"volo": {
|
||||
"main": "lib/async.js",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
]
|
||||
}
|
||||
}
|
979
node_modules/babylon/CHANGELOG.md
generated
vendored
Normal file
979
node_modules/babylon/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,979 @@
|
||||
# Changelog
|
||||
|
||||
> **Tags:**
|
||||
> - :boom: [Breaking Change]
|
||||
> - :eyeglasses: [Spec Compliancy]
|
||||
> - :rocket: [New Feature]
|
||||
> - :bug: [Bug Fix]
|
||||
> - :memo: [Documentation]
|
||||
> - :house: [Internal]
|
||||
> - :nail_care: [Polish]
|
||||
|
||||
> Semver Policy: https://github.com/babel/babylon#semver
|
||||
|
||||
_Note: Gaps between patch versions are faulty, broken or test releases._
|
||||
|
||||
See the [Babel Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md) for the pre-6.8.0 version Changelog.
|
||||
|
||||
## 6.17.4 (2017-06-18)
|
||||
|
||||
* Fix comment attachment for call expressions (#575) (aardito2)
|
||||
* Correctly put typeParameters on FunctionExpression (#585) (Daniel Tschinder)
|
||||
|
||||
## 6.17.3 (2017-06-09)
|
||||
|
||||
* Fix location info on FunctionTypeParam nodes (#565) (#571) (Michal Srb)
|
||||
* Fix stmt value being the raw value (#557) (#558) (Daniel Tschinder)
|
||||
|
||||
## 6.17.2 (2017-05-31)
|
||||
|
||||
* Fixed disappearing comments following a trailing comma on the last property of an object literal or the last argument of a call expression (#478) (aardito2)
|
||||
* Fix #437: only prohibit 'export type from "module" ' when flow is enabled (#438) (Kevin Gibbons)
|
||||
* Fix handling of anonymous parameters in `flowParseObjectTypeMethodish`. (#526) (Max Schaefer)
|
||||
* Convert argument of SpreadElement correctly to assignable (#518) (Daniel Tschinder)
|
||||
|
||||
## 6.17.1 (2017-05-10)
|
||||
|
||||
* Fix typo in flow spread operator error (Brian Ng)
|
||||
* Fixed invalid number literal parsing ([#473](https://github.com/babel/babylon/pull/473)) (Alex Kuzmenko)
|
||||
* Fix number parser ([#433](https://github.com/babel/babylon/pull/433)) (Alex Kuzmenko)
|
||||
* Ensure non pattern shorthand props are checked for reserved words ([#479](https://github.com/babel/babylon/pull/479)) (Brian Ng)
|
||||
* Remove jsx context when parsing arrow functions ([#475](https://github.com/babel/babylon/pull/475)) (Brian Ng)
|
||||
* Allow super in class properties ([#499](https://github.com/babel/babylon/pull/499)) (Brian Ng)
|
||||
* Allow flow class field to be named constructor ([#510](https://github.com/babel/babylon/pull/510)) (Brian Ng)
|
||||
|
||||
## 6.17.0 (2017-04-20)
|
||||
|
||||
* Cherry-pick #418 to 6.x ([#476](https://github.com/babel/babylon/pull/476)) (Sebastian McKenzie)
|
||||
* Add support for invalid escapes in tagged templates ([#274](https://github.com/babel/babylon/pull/274)) (Kevin Gibbons)
|
||||
* Throw error if new.target is used outside of a function ([#402](https://github.com/babel/babylon/pull/402)) (Brian Ng)
|
||||
* Fix parsing of class properties ([#351](https://github.com/babel/babylon/pull/351)) (Kevin Gibbons)
|
||||
* Fix parsing yield with dynamicImport ([#383](https://github.com/babel/babylon/pull/383)) (Brian Ng)
|
||||
* Ensure consistent start args for parseParenItem ([#386](https://github.com/babel/babylon/pull/386)) (Brian Ng)
|
||||
|
||||
## 6.16.0 (2017-02-23)
|
||||
|
||||
### :rocket: New Feature
|
||||
|
||||
***ESTree*** compatibility as plugin ([#277](https://github.com/babel/babylon/pull/277)) (Daniel Tschinder)
|
||||
|
||||
We finally introduce a new compatibility layer for ESTree. To put babylon into ESTree-compatible mode the new plugin `estree` can be enabled. In this mode the parser will output an AST that is compliant to the specs of [ESTree](https://github.com/estree/estree/)
|
||||
|
||||
We highly recommend everyone who uses babylon outside of babel to use this plugin. This will make it much easier for users to switch between different ESTree-compatible parsers. We so far tested several projects with different parsers and exchanged their parser to babylon and in nearly all cases it worked out of the box. Some other estree-compatible parsers include `acorn`, `esprima`, `espree`, `flow-parser`, etc.
|
||||
|
||||
To enable `estree` mode simply add the plugin in the config:
|
||||
```json
|
||||
{
|
||||
"plugins": [ "estree" ]
|
||||
}
|
||||
```
|
||||
|
||||
If you want to migrate your project from non-ESTree mode to ESTree, have a look at our [Readme](https://github.com/babel/babylon/#output), where all deviations are mentioned.
|
||||
|
||||
Add a parseExpression public method ([#213](https://github.com/babel/babylon/pull/213)) (jeromew)
|
||||
|
||||
Babylon exports a new function to parse a single expression
|
||||
|
||||
```js
|
||||
import { parseExpression } from 'babylon';
|
||||
|
||||
const ast = parseExpression('x || y && z', options);
|
||||
```
|
||||
|
||||
The returned AST will only consist of the expression. The options are the same as for `parse()`
|
||||
|
||||
Add startLine option ([#346](https://github.com/babel/babylon/pull/346)) (Raphael Mu)
|
||||
|
||||
A new option was added to babylon allowing to change the intial linenumber for the first line which is usually `1`.
|
||||
Changing this for example to `100` will make line `1` of the input source to be marked as line `100`, line `2` as `101`, line `3` as `102`, ...
|
||||
|
||||
Function predicate declaration ([#103](https://github.com/babel/babylon/pull/103)) (Panagiotis Vekris)
|
||||
|
||||
Added support for function predicates which flow introduced in version 0.33.0
|
||||
|
||||
```js
|
||||
declare function is_number(x: mixed): boolean %checks(typeof x === "number");
|
||||
```
|
||||
|
||||
Allow imports in declare module ([#315](https://github.com/babel/babylon/pull/315)) (Daniel Tschinder)
|
||||
|
||||
Added support for imports within module declarations which flow introduced in version 0.37.0
|
||||
|
||||
```js
|
||||
declare module "C" {
|
||||
import type { DT } from "D";
|
||||
declare export type CT = { D: DT };
|
||||
}
|
||||
```
|
||||
|
||||
### :eyeglasses: Spec Compliancy
|
||||
|
||||
Forbid semicolons after decorators in classes ([#352](https://github.com/babel/babylon/pull/352)) (Kevin Gibbons)
|
||||
|
||||
This example now correctly throws an error when there is a semicolon after the decorator:
|
||||
|
||||
```js
|
||||
class A {
|
||||
@a;
|
||||
foo(){}
|
||||
}
|
||||
```
|
||||
|
||||
Keywords are not allowed as local specifier ([#307](https://github.com/babel/babylon/pull/307)) (Daniel Tschinder)
|
||||
|
||||
Using keywords in imports is not allowed anymore:
|
||||
|
||||
```js
|
||||
import { default } from "foo";
|
||||
import { a as debugger } from "foo";
|
||||
```
|
||||
|
||||
Do not allow overwritting of primitive types ([#314](https://github.com/babel/babylon/pull/314)) (Daniel Tschinder)
|
||||
|
||||
In flow it is now forbidden to overwrite the primitve types `"any"`, `"mixed"`, `"empty"`, `"bool"`, `"boolean"`, `"number"`, `"string"`, `"void"` and `"null"` with your own type declaration.
|
||||
|
||||
Disallow import type { type a } from … ([#305](https://github.com/babel/babylon/pull/305)) (Daniel Tschinder)
|
||||
|
||||
The following code now correctly throws an error
|
||||
|
||||
```js
|
||||
import type { type a } from "foo";
|
||||
```
|
||||
|
||||
Don't parse class properties without initializers when classProperties is disabled and Flow is enabled ([#300](https://github.com/babel/babylon/pull/300)) (Andrew Levine)
|
||||
|
||||
Ensure that you enable the `classProperties` plugin in order to enable correct parsing of class properties. Prior to this version it was possible to parse them by enabling the `flow` plugin but this was not intended the behaviour.
|
||||
|
||||
If you enable the flow plugin you can only define the type of the class properties, but not initialize them.
|
||||
|
||||
Fix export default async function to be FunctionDeclaration ([#324](https://github.com/babel/babylon/pull/324)) (Daniel Tschinder)
|
||||
|
||||
Parsing the following code now returns a `FunctionDeclaration` AST node instead of `FunctionExpression`.
|
||||
|
||||
```js
|
||||
export default async function bar() {};
|
||||
```
|
||||
|
||||
### :nail_care: Polish
|
||||
|
||||
Improve error message on attempt to destructure named import ([#288](https://github.com/babel/babylon/pull/288)) (Brian Ng)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
Fix negative number literal typeannotations ([#366](https://github.com/babel/babylon/pull/366)) (Daniel Tschinder)
|
||||
|
||||
Ensure takeDecorators is called on exported class ([#358](https://github.com/babel/babylon/pull/358)) (Brian Ng)
|
||||
|
||||
ESTree: correctly change literals in all cases ([#368](https://github.com/babel/babylon/pull/368)) (Daniel Tschinder)
|
||||
|
||||
Correctly convert RestProperty to Assignable ([#339](https://github.com/babel/babylon/pull/339)) (Daniel Tschinder)
|
||||
|
||||
Fix #321 by allowing question marks in type params ([#338](https://github.com/babel/babylon/pull/338)) (Daniel Tschinder)
|
||||
|
||||
Fix #336 by correctly setting arrow-param ([#337](https://github.com/babel/babylon/pull/337)) (Daniel Tschinder)
|
||||
|
||||
Fix parse error when destructuring `set` with default value ([#317](https://github.com/babel/babylon/pull/317)) (Brian Ng)
|
||||
|
||||
Fix ObjectTypeCallProperty static ([#298](https://github.com/babel/babylon/pull/298)) (Dan Harper)
|
||||
|
||||
|
||||
### :house: Internal
|
||||
|
||||
Fix generator-method-with-computed-name spec ([#360](https://github.com/babel/babylon/pull/360)) (Alex Rattray)
|
||||
|
||||
Fix flow type-parameter-declaration test with unintended semantic ([#361](https://github.com/babel/babylon/pull/361)) (Alex Rattray)
|
||||
|
||||
Cleanup and splitup parser functions ([#295](https://github.com/babel/babylon/pull/295)) (Daniel Tschinder)
|
||||
|
||||
chore(package): update flow-bin to version 0.38.0 ([#313](https://github.com/babel/babylon/pull/313)) (greenkeeper[bot])
|
||||
|
||||
Call inner function instead of 1:1 copy to plugin ([#294](https://github.com/babel/babylon/pull/294)) (Daniel Tschinder)
|
||||
|
||||
Update eslint-config-babel to the latest version 🚀 ([#299](https://github.com/babel/babylon/pull/299)) (greenkeeper[bot])
|
||||
|
||||
Update eslint-config-babel to the latest version 🚀 ([#293](https://github.com/babel/babylon/pull/293)) (greenkeeper[bot])
|
||||
|
||||
devDeps: remove eslint-plugin-babel ([#292](https://github.com/babel/babylon/pull/292)) (Kai Cataldo)
|
||||
|
||||
Correct indent eslint rule config ([#276](https://github.com/babel/babylon/pull/276)) (Daniel Tschinder)
|
||||
|
||||
Fail tests that have expected.json and throws-option ([#285](https://github.com/babel/babylon/pull/285)) (Daniel Tschinder)
|
||||
|
||||
### :memo: Documentation
|
||||
|
||||
Update contributing with more test info [skip ci] ([#355](https://github.com/babel/babylon/pull/355)) (Brian Ng)
|
||||
|
||||
Update API documentation ([#330](https://github.com/babel/babylon/pull/330)) (Timothy Gu)
|
||||
|
||||
Added keywords to package.json ([#323](https://github.com/babel/babylon/pull/323)) (Dmytro)
|
||||
|
||||
AST spec: fix casing of `RegExpLiteral` ([#318](https://github.com/babel/babylon/pull/318)) (Mathias Bynens)
|
||||
|
||||
## 6.15.0 (2017-01-10)
|
||||
|
||||
### :eyeglasses: Spec Compliancy
|
||||
|
||||
Add support for Flow shorthand import type ([#267](https://github.com/babel/babylon/pull/267)) (Jeff Morrison)
|
||||
|
||||
This change implements flows new shorthand import syntax
|
||||
and where previously you had to write this code:
|
||||
|
||||
```js
|
||||
import {someValue} from "blah";
|
||||
import type {someType} from "blah";
|
||||
import typeof {someOtherValue} from "blah";
|
||||
```
|
||||
|
||||
you can now write it like this:
|
||||
|
||||
```js
|
||||
import {
|
||||
someValue,
|
||||
type someType,
|
||||
typeof someOtherValue,
|
||||
} from "blah";
|
||||
```
|
||||
|
||||
For more information look at [this](https://github.com/facebook/flow/pull/2890) pull request.
|
||||
|
||||
flow: allow leading pipes in all positions ([#256](https://github.com/babel/babylon/pull/256)) (Vladimir Kurchatkin)
|
||||
|
||||
This change now allows a leading pipe everywhere types can be used:
|
||||
```js
|
||||
var f = (x): | 1 | 2 => 1;
|
||||
```
|
||||
|
||||
Throw error when exporting non-declaration ([#241](https://github.com/babel/babylon/pull/241)) (Kai Cataldo)
|
||||
|
||||
Previously babylon parsed the following exports, although they are not valid:
|
||||
```js
|
||||
export typeof foo;
|
||||
export new Foo();
|
||||
export function() {};
|
||||
export for (;;);
|
||||
export while(foo);
|
||||
```
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
Don't set inType flag when parsing property names ([#266](https://github.com/babel/babylon/pull/266)) (Vladimir Kurchatkin)
|
||||
|
||||
This fixes parsing of this case:
|
||||
|
||||
```js
|
||||
const map = {
|
||||
[age <= 17] : 'Too young'
|
||||
};
|
||||
```
|
||||
|
||||
Fix source location for JSXEmptyExpression nodes (fixes #248) ([#249](https://github.com/babel/babylon/pull/249)) (James Long)
|
||||
|
||||
The following case produced an invalid AST
|
||||
```js
|
||||
<div>{/* foo */}</div>
|
||||
```
|
||||
|
||||
Use fromCodePoint to convert high value unicode entities ([#243](https://github.com/babel/babylon/pull/243)) (Ryan Duffy)
|
||||
|
||||
When high value unicode entities (e.g. 💩) were used in the input source code they are now correctly encoded in the resulting AST.
|
||||
|
||||
Rename folder to avoid Windows-illegal characters ([#281](https://github.com/babel/babylon/pull/281)) (Ryan Plant)
|
||||
|
||||
Allow this.state.clone() when parsing decorators ([#262](https://github.com/babel/babylon/pull/262)) (Alex Rattray)
|
||||
|
||||
### :house: Internal
|
||||
|
||||
User external-helpers ([#254](https://github.com/babel/babylon/pull/254)) (Daniel Tschinder)
|
||||
|
||||
Add watch script for dev ([#234](https://github.com/babel/babylon/pull/234)) (Kai Cataldo)
|
||||
|
||||
Freeze current plugins list for "*" option, and remove from README.md ([#245](https://github.com/babel/babylon/pull/245)) (Andrew Levine)
|
||||
|
||||
Prepare tests for multiple fixture runners. ([#240](https://github.com/babel/babylon/pull/240)) (Daniel Tschinder)
|
||||
|
||||
Add some test coverage for decorators stage-0 plugin ([#250](https://github.com/babel/babylon/pull/250)) (Andrew Levine)
|
||||
|
||||
Refactor tokenizer types file ([#263](https://github.com/babel/babylon/pull/263)) (Sven SAULEAU)
|
||||
|
||||
Update eslint-config-babel to the latest version 🚀 ([#273](https://github.com/babel/babylon/pull/273)) (greenkeeper[bot])
|
||||
|
||||
chore(package): update rollup to version 0.41.0 ([#272](https://github.com/babel/babylon/pull/272)) (greenkeeper[bot])
|
||||
|
||||
chore(package): update flow-bin to version 0.37.0 ([#255](https://github.com/babel/babylon/pull/255)) (greenkeeper[bot])
|
||||
|
||||
## 6.14.1 (2016-11-17)
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
Allow `"plugins": ["*"]` ([#229](https://github.com/babel/babylon/pull/229)) (Daniel Tschinder)
|
||||
|
||||
```js
|
||||
{
|
||||
"plugins": ["*"]
|
||||
}
|
||||
```
|
||||
|
||||
Will include all parser plugins instead of specifying each one individually. Useful for tools like babel-eslint, jscodeshift, and ast-explorer.
|
||||
|
||||
## 6.14.0 (2016-11-16)
|
||||
|
||||
### :eyeglasses: Spec Compliancy
|
||||
|
||||
Throw error for reserved words `enum` and `await` ([#195](https://github.com/babel/babylon/pull/195)) (Kai Cataldo)
|
||||
|
||||
[11.6.2.2 Future Reserved Words](http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words)
|
||||
|
||||
Babylon will throw for more reserved words such as `enum` or `await` (in strict mode).
|
||||
|
||||
```
|
||||
class enum {} // throws
|
||||
class await {} // throws in strict mode (module)
|
||||
```
|
||||
|
||||
Optional names for function types and object type indexers ([#197](https://github.com/babel/babylon/pull/197)) (Gabe Levi)
|
||||
|
||||
So where you used to have to write
|
||||
|
||||
```js
|
||||
type A = (x: string, y: boolean) => number;
|
||||
type B = (z: string) => number;
|
||||
type C = { [key: string]: number };
|
||||
```
|
||||
|
||||
you can now write (with flow 0.34.0)
|
||||
|
||||
```js
|
||||
type A = (string, boolean) => number;
|
||||
type B = string => number;
|
||||
type C = { [string]: number };
|
||||
```
|
||||
|
||||
Parse flow nested array type annotations like `number[][]` ([#219](https://github.com/babel/babylon/pull/219)) (Bernhard Häussner)
|
||||
|
||||
Supports these form now of specifying array types:
|
||||
|
||||
```js
|
||||
var a: number[][][][];
|
||||
var b: string[][];
|
||||
```
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
Correctly eat semicolon at the end of `DelcareModuleExports` ([#223](https://github.com/babel/babylon/pull/223)) (Daniel Tschinder)
|
||||
|
||||
```
|
||||
declare module "foo" { declare module.exports: number }
|
||||
declare module "foo" { declare module.exports: number; } // also allowed now
|
||||
```
|
||||
|
||||
### :house: Internal
|
||||
|
||||
* Count Babel tests towards Babylon code coverage ([#182](https://github.com/babel/babylon/pull/182)) (Moti Zilberman)
|
||||
* Fix strange line endings ([#214](https://github.com/babel/babylon/pull/214)) (Thomas Grainger)
|
||||
* Add node 7 (Daniel Tschinder)
|
||||
* chore(package): update flow-bin to version 0.34.0 ([#204](https://github.com/babel/babylon/pull/204)) (Greenkeeper)
|
||||
|
||||
## v6.13.1 (2016-10-26)
|
||||
|
||||
### :nail_care: Polish
|
||||
|
||||
- Use rollup for bundling to speed up startup time ([#190](https://github.com/babel/babylon/pull/190)) ([@drewml](https://github.com/DrewML))
|
||||
|
||||
```js
|
||||
const babylon = require('babylon');
|
||||
const ast = babylon.parse('var foo = "lol";');
|
||||
```
|
||||
|
||||
With that test case, there was a ~95ms savings by removing the need for node to build/traverse the dependency graph.
|
||||
|
||||
**Without bundling**
|
||||
![image](https://cloud.githubusercontent.com/assets/5233399/19420264/3133497e-93ad-11e6-9a6a-2da59c4f5c13.png)
|
||||
|
||||
**With bundling**
|
||||
![image](https://cloud.githubusercontent.com/assets/5233399/19420267/388f556e-93ad-11e6-813e-7c5c396be322.png)
|
||||
|
||||
- add clean command [skip ci] ([#201](https://github.com/babel/babylon/pull/201)) (Henry Zhu)
|
||||
- add ForAwaitStatement (async generator already added) [skip ci] ([#196](https://github.com/babel/babylon/pull/196)) (Henry Zhu)
|
||||
|
||||
## v6.13.0 (2016-10-21)
|
||||
|
||||
### :eyeglasses: Spec Compliancy
|
||||
|
||||
Property variance type annotations for Flow plugin ([#161](https://github.com/babel/babylon/pull/161)) (Sam Goldman)
|
||||
|
||||
> See https://flowtype.org/docs/variance.html for more information
|
||||
|
||||
```js
|
||||
type T = { +p: T };
|
||||
interface T { -p: T };
|
||||
declare class T { +[k:K]: V };
|
||||
class T { -[k:K]: V };
|
||||
class C2 { +p: T = e };
|
||||
```
|
||||
|
||||
Raise error on duplicate definition of __proto__ ([#183](https://github.com/babel/babylon/pull/183)) (Moti Zilberman)
|
||||
|
||||
```js
|
||||
({ __proto__: 1, __proto__: 2 }) // Throws an error now
|
||||
```
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
Flow: Allow class properties to be named `static` ([#184](https://github.com/babel/babylon/pull/184)) (Moti Zilberman)
|
||||
|
||||
```js
|
||||
declare class A {
|
||||
static: T;
|
||||
}
|
||||
```
|
||||
|
||||
Allow "async" as identifier for object literal property shorthand ([#187](https://github.com/babel/babylon/pull/187)) (Andrew Levine)
|
||||
|
||||
```js
|
||||
var foo = { async, bar };
|
||||
```
|
||||
|
||||
### :nail_care: Polish
|
||||
|
||||
Fix flowtype and add inType to state ([#189](https://github.com/babel/babylon/pull/189)) (Daniel Tschinder)
|
||||
|
||||
> This improves the performance slightly (because of hidden classes)
|
||||
|
||||
### :house: Internal
|
||||
|
||||
Fix .gitattributes line ending setting ([#191](https://github.com/babel/babylon/pull/191)) (Moti Zilberman)
|
||||
|
||||
Increase test coverage ([#175](https://github.com/babel/babylon/pull/175) (Moti Zilberman)
|
||||
|
||||
Readd missin .eslinignore for IDEs (Daniel Tschinder)
|
||||
|
||||
Error on missing expected.json fixture in CI ([#188](https://github.com/babel/babylon/pull/188)) (Moti Zilberman)
|
||||
|
||||
Add .gitattributes and .editorconfig for LF line endings ([#179](https://github.com/babel/babylon/pull/179)) (Moti Zilberman)
|
||||
|
||||
Fixes two tests that are failing after the merge of #172 ([#177](https://github.com/babel/babylon/pull/177)) (Moti Zilberman)
|
||||
|
||||
## v6.12.0 (2016-10-14)
|
||||
|
||||
### :eyeglasses: Spec Compliancy
|
||||
|
||||
Implement import() syntax ([#163](https://github.com/babel/babylon/pull/163)) (Jordan Gensler)
|
||||
|
||||
#### Dynamic Import
|
||||
|
||||
- Proposal Repo: https://github.com/domenic/proposal-dynamic-import
|
||||
- Championed by [@domenic](https://github.com/domenic)
|
||||
- stage-2
|
||||
- [sept-28 tc39 notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-09/sept-28.md#113a-import)
|
||||
|
||||
> This repository contains a proposal for adding a "function-like" import() module loading syntactic form to JavaScript
|
||||
|
||||
```js
|
||||
import(`./section-modules/${link.dataset.entryModule}.js`)
|
||||
.then(module => {
|
||||
module.loadPageInto(main);
|
||||
})
|
||||
```
|
||||
|
||||
Add EmptyTypeAnnotation ([#171](https://github.com/babel/babylon/pull/171)) (Sam Goldman)
|
||||
|
||||
#### EmptyTypeAnnotation
|
||||
|
||||
Just wasn't covered before.
|
||||
|
||||
```js
|
||||
type T = empty;
|
||||
```
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels)
|
||||
|
||||
```js
|
||||
// was failing due to sparse array
|
||||
export const { foo: [ ,, qux7 ] } = bar;
|
||||
```
|
||||
|
||||
Allow keyword in Flow object declaration property names with type parameters ([#146](https://github.com/babel/babylon/pull/146)) (Dan Harper)
|
||||
|
||||
```js
|
||||
declare class X {
|
||||
foobar<T>(): void;
|
||||
static foobar<T>(): void;
|
||||
}
|
||||
```
|
||||
|
||||
Allow keyword in object/class property names with Flow type parameters ([#145](https://github.com/babel/babylon/pull/145)) (Dan Harper)
|
||||
|
||||
```js
|
||||
class Foo {
|
||||
delete<T>(item: T): T {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Allow typeAnnotations for yield expressions ([#174](https://github.com/babel/babylon/pull/174))) (Daniel Tschinder)
|
||||
|
||||
```js
|
||||
function *foo() {
|
||||
const x = (yield 5: any);
|
||||
}
|
||||
```
|
||||
|
||||
### :nail_care: Polish
|
||||
|
||||
Annotate more errors with expected token ([#172](https://github.com/babel/babylon/pull/172))) (Moti Zilberman)
|
||||
|
||||
```js
|
||||
// Unexpected token, expected ; (1:6)
|
||||
{ set 1 }
|
||||
```
|
||||
|
||||
### :house: Internal
|
||||
|
||||
Remove kcheck ([#173](https://github.com/babel/babylon/pull/173))) (Daniel Tschinder)
|
||||
|
||||
Also run flow, linting, babel tests on seperate instances (add back node 0.10)
|
||||
|
||||
## v6.11.6 (2016-10-12)
|
||||
|
||||
### :bug: Bug Fix/Regression
|
||||
|
||||
Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels)
|
||||
|
||||
```js
|
||||
// was failing with `Cannot read property 'type' of null` because of null identifiers
|
||||
export const { foo: [ ,, qux7 ] } = bar;
|
||||
```
|
||||
|
||||
## v6.11.5 (2016-10-12)
|
||||
|
||||
### :eyeglasses: Spec Compliancy
|
||||
|
||||
Fix: Check for duplicate named exports in exported destructuring assignments ([#144](https://github.com/babel/babylon/pull/144)) (Kai Cataldo)
|
||||
|
||||
```js
|
||||
// `foo` has already been exported. Exported identifiers must be unique. (2:20)
|
||||
export function foo() {};
|
||||
export const { a: [{foo}] } = bar;
|
||||
```
|
||||
|
||||
Fix: Check for duplicate named exports in exported rest elements/properties ([#164](https://github.com/babel/babylon/pull/164)) (Kai Cataldo)
|
||||
|
||||
```js
|
||||
// `foo` has already been exported. Exported identifiers must be unique. (2:22)
|
||||
export const foo = 1;
|
||||
export const [bar, ...foo] = baz;
|
||||
```
|
||||
|
||||
### :bug: Bug Fix
|
||||
|
||||
Fix: Allow identifier `async` for default param in arrow expression ([#165](https://github.com/babel/babylon/pull/165)) (Kai Cataldo)
|
||||
|
||||
```js
|
||||
// this is ok now
|
||||
const test = ({async = true}) => {};
|
||||
```
|
||||
|
||||
### :nail_care: Polish
|
||||
|
||||
Babylon will now print out the token it's expecting if there's a `SyntaxError` ([#150](https://github.com/babel/babylon/pull/150)) (Daniel Tschinder)
|
||||
|
||||
```bash
|
||||
# So in the case of a missing ending curly (`}`)
|
||||
Module build failed: SyntaxError: Unexpected token, expected } (30:0)
|
||||
28 | }
|
||||
29 |
|
||||
> 30 |
|
||||
| ^
|
||||
```
|
||||
|
||||
## v6.11.4 (2016-10-03)
|
||||
|
||||
Temporary rollback for erroring on trailing comma with spread (#154) (Henry Zhu)
|
||||
|
||||
## v6.11.3 (2016-10-01)
|
||||
|
||||
### :eyeglasses: Spec Compliancy
|
||||
|
||||
Add static errors for object rest (#149) ([@danez](https://github.com/danez))
|
||||
|
||||
> https://github.com/sebmarkbage/ecmascript-rest-spread
|
||||
|
||||
Object rest copies the *rest* of properties from the right hand side `obj` starting from the left to right.
|
||||
|
||||
```js
|
||||
let { x, y, ...z } = { x: 1, y: 2, z: 3 };
|
||||
// x = 1
|
||||
// y = 2
|
||||
// z = { z: 3 }
|
||||
```
|
||||
|
||||
#### New Syntax Errors:
|
||||
|
||||
**SyntaxError**: The rest element has to be the last element when destructuring (1:10)
|
||||
```bash
|
||||
> 1 | let { ...x, y, z } = { x: 1, y: 2, z: 3};
|
||||
| ^
|
||||
# Previous behavior:
|
||||
# x = { x: 1, y: 2, z: 3 }
|
||||
# y = 2
|
||||
# z = 3
|
||||
```
|
||||
|
||||
Before, this was just a more verbose way of shallow copying `obj` since it doesn't actually do what you think.
|
||||
|
||||
**SyntaxError**: Cannot have multiple rest elements when destructuring (1:13)
|
||||
|
||||
```bash
|
||||
> 1 | let { x, ...y, ...z } = { x: 1, y: 2, z: 3};
|
||||
| ^
|
||||
# Previous behavior:
|
||||
# x = 1
|
||||
# y = { y: 2, z: 3 }
|
||||
# z = { y: 2, z: 3 }
|
||||
```
|
||||
|
||||
Before y and z would just be the same value anyway so there is no reason to need to have both.
|
||||
|
||||
**SyntaxError**: A trailing comma is not permitted after the rest element (1:16)
|
||||
|
||||
```js
|
||||
let { x, y, ...z, } = obj;
|
||||
```
|
||||
|
||||
The rationale for this is that the use case for trailing comma is that you can add something at the end without affecting the line above. Since a RestProperty always has to be the last property it doesn't make sense.
|
||||
|
||||
---
|
||||
|
||||
get / set are valid property names in default assignment (#142) ([@jezell](https://github.com/jezell))
|
||||
|
||||
```js
|
||||
// valid
|
||||
function something({ set = null, get = null }) {}
|
||||
```
|
||||
|
||||
## v6.11.2 (2016-09-23)
|
||||
|
||||
### Bug Fix
|
||||
|
||||
- [#139](https://github.com/babel/babylon/issues/139) Don't do the duplicate check if not an identifier (#140) @hzoo
|
||||
|
||||
```js
|
||||
// regression with duplicate export check
|
||||
SyntaxError: ./typography.js: `undefined` has already been exported. Exported identifiers must be unique. (22:13)
|
||||
20 |
|
||||
21 | export const { rhythm } = typography;
|
||||
> 22 | export const { TypographyStyle } = typography
|
||||
```
|
||||
|
||||
Bail out for now, and make a change to account for destructuring in the next release.
|
||||
|
||||
## 6.11.1 (2016-09-22)
|
||||
|
||||
### Bug Fix
|
||||
- [#137](https://github.com/babel/babylon/pull/137) - Fix a regression with duplicate exports - it was erroring on all keys in `Object.prototype`. @danez
|
||||
|
||||
```javascript
|
||||
export toString from './toString';
|
||||
```
|
||||
|
||||
```bash
|
||||
`toString` has already been exported. Exported identifiers must be unique. (1:7)
|
||||
> 1 | export toString from './toString';
|
||||
| ^
|
||||
2 |
|
||||
```
|
||||
|
||||
## 6.11.0 (2016-09-22)
|
||||
|
||||
### Spec Compliancy (will break CI)
|
||||
|
||||
- Disallow duplicate named exports ([#107](https://github.com/babel/babylon/pull/107)) @kaicataldo
|
||||
|
||||
```js
|
||||
// Only one default export allowed per module. (2:9)
|
||||
export default function() {};
|
||||
export { foo as default };
|
||||
|
||||
// Only one default export allowed per module. (2:0)
|
||||
export default {};
|
||||
export default function() {};
|
||||
|
||||
// `Foo` has already been exported. Exported identifiers must be unique. (2:0)
|
||||
export { Foo };
|
||||
export class Foo {};
|
||||
```
|
||||
|
||||
### New Feature (Syntax)
|
||||
|
||||
- Add support for computed class property names ([#121](https://github.com/babel/babylon/pull/121)) @motiz88
|
||||
|
||||
```js
|
||||
// AST
|
||||
interface ClassProperty <: Node {
|
||||
type: "ClassProperty";
|
||||
key: Identifier;
|
||||
value: Expression;
|
||||
computed: boolean; // added
|
||||
}
|
||||
```
|
||||
|
||||
```js
|
||||
// with "plugins": ["classProperties"]
|
||||
class Foo {
|
||||
[x]
|
||||
['y']
|
||||
}
|
||||
|
||||
class Bar {
|
||||
[p]
|
||||
[m] () {}
|
||||
}
|
||||
```
|
||||
|
||||
### Bug Fix
|
||||
|
||||
- Fix `static` property falling through in the declare class Flow AST ([#135](https://github.com/babel/babylon/pull/135)) @danharper
|
||||
|
||||
```js
|
||||
declare class X {
|
||||
a: number;
|
||||
static b: number; // static
|
||||
c: number; // this was being marked as static in the AST as well
|
||||
}
|
||||
```
|
||||
|
||||
### Polish
|
||||
|
||||
- Rephrase "assigning/binding to rvalue" errors to include context ([#119](https://github.com/babel/babylon/pull/119)) @motiz88
|
||||
|
||||
```js
|
||||
// Used to error with:
|
||||
// SyntaxError: Assigning to rvalue (1:0)
|
||||
|
||||
// Now:
|
||||
// Invalid left-hand side in assignment expression (1:0)
|
||||
3 = 4
|
||||
|
||||
// Invalid left-hand side in for-in statement (1:5)
|
||||
for (+i in {});
|
||||
```
|
||||
|
||||
### Internal
|
||||
|
||||
- Fix call to `this.parseMaybeAssign` with correct arguments ([#133](https://github.com/babel/babylon/pull/133)) @danez
|
||||
- Add semver note to changelog ([#131](https://github.com/babel/babylon/pull/131)) @hzoo
|
||||
|
||||
## 6.10.0 (2016-09-19)
|
||||
|
||||
> We plan to include some spec compliancy bugs in patch versions. An example was the multiple default exports issue.
|
||||
|
||||
### Spec Compliancy
|
||||
|
||||
* Implement ES2016 check for simple parameter list in strict mode ([#106](https://github.com/babel/babylon/pull/106)) (Timothy Gu)
|
||||
|
||||
> It is a Syntax Error if ContainsUseStrict of FunctionBody is true and IsSimpleParameterList of FormalParameters is false. https://tc39.github.io/ecma262/2016/#sec-function-definitions-static-semantics-early-errors
|
||||
|
||||
More Context: [tc39-notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2015-07/july-29.md#611-the-scope-of-use-strict-with-respect-to-destructuring-in-parameter-lists)
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
// this errors because it uses destructuring and default parameters
|
||||
// in a function with a "use strict" directive
|
||||
function a([ option1, option2 ] = []) {
|
||||
"use strict";
|
||||
}
|
||||
```
|
||||
|
||||
The solution would be to use a top level "use strict" or to remove the destructuring or default parameters when using a function + "use strict" or to.
|
||||
|
||||
### New Feature
|
||||
|
||||
* Exact object type annotations for Flow plugin ([#104](https://github.com/babel/babylon/pull/104)) (Basil Hosmer)
|
||||
|
||||
Added to flow in https://github.com/facebook/flow/commit/c710c40aa2a115435098d6c0dfeaadb023cd39b8
|
||||
|
||||
Looks like:
|
||||
|
||||
```js
|
||||
var a : {| x: number, y: string |} = { x: 0, y: 'foo' };
|
||||
```
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Include `typeParameter` location in `ArrowFunctionExpression` ([#126](https://github.com/babel/babylon/pull/126)) (Daniel Tschinder)
|
||||
* Error on invalid flow type annotation with default assignment ([#122](https://github.com/babel/babylon/pull/122)) (Dan Harper)
|
||||
* Fix Flow return types on arrow functions ([#124](https://github.com/babel/babylon/pull/124)) (Dan Harper)
|
||||
|
||||
### Misc
|
||||
|
||||
* Add tests for export extensions ([#127](https://github.com/babel/babylon/pull/127)) (Daniel Tschinder)
|
||||
* Fix Contributing guidelines [skip ci] (Daniel Tschinder)
|
||||
|
||||
## 6.9.2 (2016-09-09)
|
||||
|
||||
The only change is to remove the `babel-runtime` dependency by compiling with Babel's ES2015 loose mode. So using babylon standalone should be smaller.
|
||||
|
||||
## 6.9.1 (2016-08-23)
|
||||
|
||||
This release contains mainly small bugfixes but also updates babylons default mode to es2017. The features for `exponentiationOperator`, `asyncFunctions` and `trailingFunctionCommas` which previously needed to be activated via plugin are now enabled by default and the plugins are now no-ops.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix issues with default object params in async functions ([#96](https://github.com/babel/babylon/pull/96)) @danez
|
||||
- Fix issues with flow-types and async function ([#95](https://github.com/babel/babylon/pull/95)) @danez
|
||||
- Fix arrow functions with destructuring, types & default value ([#94](https://github.com/babel/babylon/pull/94)) @danharper
|
||||
- Fix declare class with qualified type identifier ([#97](https://github.com/babel/babylon/pull/97)) @danez
|
||||
- Remove exponentiationOperator, asyncFunctions, trailingFunctionCommas plugins and enable them by default ([#98](https://github.com/babel/babylon/pull/98)) @danez
|
||||
|
||||
## 6.9.0 (2016-08-16)
|
||||
|
||||
### New syntax support
|
||||
|
||||
- Add JSX spread children ([#42](https://github.com/babel/babylon/pull/42)) @calebmer
|
||||
|
||||
(Be aware that React is not going to support this syntax)
|
||||
|
||||
```js
|
||||
<div>
|
||||
{...todos.map(todo => <Todo key={todo.id} todo={todo}/>)}
|
||||
</div>
|
||||
```
|
||||
|
||||
- Add support for declare module.exports ([#72](https://github.com/babel/babylon/pull/72)) @danez
|
||||
|
||||
```js
|
||||
declare module "foo" {
|
||||
declare module.exports: {}
|
||||
}
|
||||
```
|
||||
|
||||
### New Features
|
||||
|
||||
- If supplied, attach filename property to comment node loc. ([#80](https://github.com/babel/babylon/pull/80)) @divmain
|
||||
- Add identifier name to node loc field ([#90](https://github.com/babel/babylon/pull/90)) @kittens
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix exponential operator to behave according to spec ([#75](https://github.com/babel/babylon/pull/75)) @danez
|
||||
- Fix lookahead to not add comments to arrays which are not cloned ([#76](https://github.com/babel/babylon/pull/76)) @danez
|
||||
- Fix accidental fall-through in Flow type parsing. ([#82](https://github.com/babel/babylon/pull/82)) @xiemaisi
|
||||
- Only allow declares inside declare module ([#73](https://github.com/babel/babylon/pull/73)) @danez
|
||||
- Small fix for parsing type parameter declarations ([#83](https://github.com/babel/babylon/pull/83)) @gabelevi
|
||||
- Fix arrow param locations with flow types ([#57](https://github.com/babel/babylon/pull/57)) @danez
|
||||
- Fixes SyntaxError position with flow optional type ([#65](https://github.com/babel/babylon/pull/65)) @danez
|
||||
|
||||
### Internal
|
||||
|
||||
- Add codecoverage to tests @danez
|
||||
- Fix tests to not save expected output if we expect the test to fail @danez
|
||||
- Make a shallow clone of babel for testing @danez
|
||||
- chore(package): update cross-env to version 2.0.0 ([#77](https://github.com/babel/babylon/pull/77)) @greenkeeperio-bot
|
||||
- chore(package): update ava to version 0.16.0 ([#86](https://github.com/babel/babylon/pull/86)) @greenkeeperio-bot
|
||||
- chore(package): update babel-plugin-istanbul to version 2.0.0 ([#89](https://github.com/babel/babylon/pull/89)) @greenkeeperio-bot
|
||||
- chore(package): update nyc to version 8.0.0 ([#88](https://github.com/babel/babylon/pull/88)) @greenkeeperio-bot
|
||||
|
||||
## 6.8.4 (2016-07-06)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix the location of params, when flow and default value used ([#68](https://github.com/babel/babylon/pull/68)) @danez
|
||||
|
||||
## 6.8.3 (2016-07-02)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix performance regression introduced in 6.8.2 with conditionals ([#63](https://github.com/babel/babylon/pull/63)) @danez
|
||||
|
||||
## 6.8.2 (2016-06-24)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix parse error with yielding jsx elements in generators `function* it() { yield <a></a>; }` ([#31](https://github.com/babel/babylon/pull/31)) @eldereal
|
||||
- When cloning nodes do not clone its comments ([#24](https://github.com/babel/babylon/pull/24)) @danez
|
||||
- Fix parse errors when using arrow functions with an spread element and return type `(...props): void => {}` ([#10](https://github.com/babel/babylon/pull/10)) @danez
|
||||
- Fix leading comments added from previous node ([#23](https://github.com/babel/babylon/pull/23)) @danez
|
||||
- Fix parse errors with flow's optional arguments `(arg?) => {}` ([#19](https://github.com/babel/babylon/pull/19)) @danez
|
||||
- Support negative numeric type literals @kittens
|
||||
- Remove line terminator restriction after await keyword @kittens
|
||||
- Remove grouped type arrow restriction as it seems flow no longer has it @kittens
|
||||
- Fix parse error with generic methods that have the name `get` or `set` `class foo { get() {} }` ([#55](https://github.com/babel/babylon/pull/55)) @vkurchatkin
|
||||
- Fix parse error with arrow functions that have flow type parameter declarations `<T>(x: T): T => x;` ([#54](https://github.com/babel/babylon/pull/54)) @gabelevi
|
||||
|
||||
### Documentation
|
||||
|
||||
- Document AST differences from ESTree ([#41](https://github.com/babel/babylon/pull/41)) @nene
|
||||
- Move ast spec from babel/babel ([#46](https://github.com/babel/babylon/pull/46)) @hzoo
|
||||
|
||||
### Internal
|
||||
|
||||
- Enable skipped tests ([#16](https://github.com/babel/babylon/pull/16)) @danez
|
||||
- Add script to test latest version of babylon with babel ([#21](https://github.com/babel/babylon/pull/21)) @danez
|
||||
- Upgrade test runner ava @kittens
|
||||
- Add missing generate-identifier-regex script @kittens
|
||||
- Rename parser context types @kittens
|
||||
- Add node v6 to travis testing @hzoo
|
||||
- Update to Unicode v9 ([#45](https://github.com/babel/babylon/pull/45)) @mathiasbynens
|
||||
|
||||
## 6.8.1 (2016-06-06)
|
||||
|
||||
### New Feature
|
||||
|
||||
- Parse type parameter declarations with defaults like `type Foo<T = string> = T`
|
||||
|
||||
### Bug Fixes
|
||||
- Type parameter declarations need 1 or more type parameters.
|
||||
- The existential type `*` is not a valid type parameter.
|
||||
- The existential type `*` is a primary type
|
||||
|
||||
### Spec Compliancy
|
||||
- The param list for type parameter declarations now consists of `TypeParameter` nodes
|
||||
- New `TypeParameter` AST Node (replaces using the `Identifier` node before)
|
||||
|
||||
```
|
||||
interface TypeParameter <: Node {
|
||||
bound: TypeAnnotation;
|
||||
default: TypeAnnotation;
|
||||
name: string;
|
||||
variance: "plus" | "minus";
|
||||
}
|
||||
```
|
||||
|
||||
## 6.8.0 (2016-05-02)
|
||||
|
||||
#### New Feature
|
||||
|
||||
##### Parse Method Parameter Decorators ([#12](https://github.com/babel/babylon/pull/12))
|
||||
|
||||
> [Method Parameter Decorators](https://goo.gl/8MmCMG) is now a TC39 [stage 0 proposal](https://github.com/tc39/ecma262/blob/master/stage0.md).
|
||||
|
||||
Examples:
|
||||
|
||||
```js
|
||||
class Foo {
|
||||
constructor(@foo() x, @bar({ a: 123 }) @baz() y) {}
|
||||
}
|
||||
|
||||
export default function func(@foo() x, @bar({ a: 123 }) @baz() y) {}
|
||||
|
||||
var obj = {
|
||||
method(@foo() x, @bar({ a: 123 }) @baz() y) {}
|
||||
};
|
||||
```
|
||||
|
||||
##### Parse for-await statements (w/ `asyncGenerators` plugin) ([#17](https://github.com/babel/babylon/pull/17))
|
||||
|
||||
There is also a new node type, `ForAwaitStatement`.
|
||||
|
||||
> [Async generators and for-await](https://github.com/tc39/proposal-async-iteration) are now a [stage 2 proposal](https://github.com/tc39/ecma262#current-proposals).
|
||||
|
||||
Example:
|
||||
|
||||
```js
|
||||
async function f() {
|
||||
for await (let x of y);
|
||||
}
|
||||
```
|
19
node_modules/babylon/LICENSE
generated
vendored
Normal file
19
node_modules/babylon/LICENSE
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright (C) 2012-2014 by various contributors (see AUTHORS)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
134
node_modules/babylon/README.md
generated
vendored
Normal file
134
node_modules/babylon/README.md
generated
vendored
Normal file
@ -0,0 +1,134 @@
|
||||
<p align="center">
|
||||
<img alt="babylon" src="https://raw.githubusercontent.com/babel/logo/master/babylon.png" width="700">
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
Babylon is a JavaScript parser used in <a href="https://github.com/babel/babel">Babel</a>.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://travis-ci.org/babel/babylon"><img alt="Travis Status" src="https://img.shields.io/travis/babel/babylon/master.svg?style=flat&label=travis"></a>
|
||||
<a href="https://codecov.io/gh/babel/babylon"><img alt="Codecov Status" src="https://img.shields.io/codecov/c/github/babel/babylon/master.svg?style=flat"></a>
|
||||
</p>
|
||||
|
||||
- The latest ECMAScript version enabled by default (ES2017).
|
||||
- Comment attachment.
|
||||
- Support for JSX and Flow.
|
||||
- Support for experimental language proposals (accepting PRs for anything at least [stage-0](https://github.com/tc39/proposals/blob/master/stage-0-proposals.md)).
|
||||
|
||||
## Credits
|
||||
|
||||
Heavily based on [acorn](https://github.com/marijnh/acorn) and [acorn-jsx](https://github.com/RReverser/acorn-jsx),
|
||||
thanks to the awesome work of [@RReverser](https://github.com/RReverser) and [@marijnh](https://github.com/marijnh).
|
||||
|
||||
Significant diversions are expected to occur in the future such as streaming, EBNF definitions, sweet.js integration, interspatial parsing and more.
|
||||
|
||||
## API
|
||||
|
||||
### `babylon.parse(code, [options])`
|
||||
|
||||
### `babylon.parseExpression(code, [options])`
|
||||
|
||||
`parse()` parses the provided `code` as an entire ECMAScript program, while
|
||||
`parseExpression()` tries to parse a single Expression with performance in
|
||||
mind. When in doubt, use `.parse()`.
|
||||
|
||||
### Options
|
||||
|
||||
- **allowImportExportEverywhere**: By default, `import` and `export`
|
||||
declarations can only appear at a program's top level. Setting this
|
||||
option to `true` allows them anywhere where a statement is allowed.
|
||||
|
||||
- **allowReturnOutsideFunction**: By default, a return statement at
|
||||
the top level raises an error. Set this to `true` to accept such
|
||||
code.
|
||||
|
||||
- **allowSuperOutsideMethod**: TODO
|
||||
|
||||
- **sourceType**: Indicate the mode the code should be parsed in. Can be
|
||||
either `"script"` or `"module"`.
|
||||
|
||||
- **sourceFilename**: Correlate output AST nodes with their source filename. Useful when generating code and source maps from the ASTs of multiple input files.
|
||||
|
||||
- **startLine**: By default, the first line of code parsed is treated as line 1. You can provide a line number to alternatively start with. Useful for integration with other source tools.
|
||||
|
||||
- **plugins**: Array containing the plugins that you want to enable.
|
||||
|
||||
- **strictMode**: TODO
|
||||
|
||||
### Output
|
||||
|
||||
Babylon generates AST according to [Babel AST format][].
|
||||
It is based on [ESTree spec][] with the following deviations:
|
||||
|
||||
> There is now an `estree` plugin which reverts these deviations
|
||||
|
||||
- [Literal][] token is replaced with [StringLiteral][], [NumericLiteral][], [BooleanLiteral][], [NullLiteral][], [RegExpLiteral][]
|
||||
- [Property][] token is replaced with [ObjectProperty][] and [ObjectMethod][]
|
||||
- [MethodDefinition][] is replaced with [ClassMethod][]
|
||||
- [Program][] and [BlockStatement][] contain additional `directives` field with [Directive][] and [DirectiveLiteral][]
|
||||
- [ClassMethod][], [ObjectProperty][], and [ObjectMethod][] value property's properties in [FunctionExpression][] is coerced/brought into the main method node.
|
||||
|
||||
AST for JSX code is based on [Facebook JSX AST][] with the addition of one node type:
|
||||
|
||||
- `JSXText`
|
||||
|
||||
[Babel AST format]: https://github.com/babel/babylon/blob/master/ast/spec.md
|
||||
[ESTree spec]: https://github.com/estree/estree
|
||||
|
||||
[Literal]: https://github.com/estree/estree/blob/master/es5.md#literal
|
||||
[Property]: https://github.com/estree/estree/blob/master/es5.md#property
|
||||
[MethodDefinition]: https://github.com/estree/estree/blob/master/es2015.md#methoddefinition
|
||||
|
||||
[StringLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#stringliteral
|
||||
[NumericLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#numericliteral
|
||||
[BooleanLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#booleanliteral
|
||||
[NullLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#nullliteral
|
||||
[RegExpLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#regexpliteral
|
||||
[ObjectProperty]: https://github.com/babel/babylon/blob/master/ast/spec.md#objectproperty
|
||||
[ObjectMethod]: https://github.com/babel/babylon/blob/master/ast/spec.md#objectmethod
|
||||
[ClassMethod]: https://github.com/babel/babylon/blob/master/ast/spec.md#classmethod
|
||||
[Program]: https://github.com/babel/babylon/blob/master/ast/spec.md#programs
|
||||
[BlockStatement]: https://github.com/babel/babylon/blob/master/ast/spec.md#blockstatement
|
||||
[Directive]: https://github.com/babel/babylon/blob/master/ast/spec.md#directive
|
||||
[DirectiveLiteral]: https://github.com/babel/babylon/blob/master/ast/spec.md#directiveliteral
|
||||
[FunctionExpression]: https://github.com/babel/babylon/blob/master/ast/spec.md#functionexpression
|
||||
|
||||
[Facebook JSX AST]: https://github.com/facebook/jsx/blob/master/AST.md
|
||||
|
||||
### Semver
|
||||
|
||||
Babylon follows semver in most situations. The only thing to note is that some spec-compliancy bug fixes may be released under patch versions.
|
||||
|
||||
For example: We push a fix to early error on something like [#107](https://github.com/babel/babylon/pull/107) - multiple default exports per file. That would be considered a bug fix even though it would cause a build to fail.
|
||||
|
||||
### Example
|
||||
|
||||
```javascript
|
||||
require("babylon").parse("code", {
|
||||
// parse in strict mode and allow module declarations
|
||||
sourceType: "module",
|
||||
|
||||
plugins: [
|
||||
// enable jsx and flow syntax
|
||||
"jsx",
|
||||
"flow"
|
||||
]
|
||||
});
|
||||
```
|
||||
|
||||
### Plugins
|
||||
|
||||
- `estree`
|
||||
- `jsx`
|
||||
- `flow`
|
||||
- `doExpressions`
|
||||
- `objectRestSpread`
|
||||
- `decorators` (Based on an outdated version of the Decorators proposal. Will be removed in a future version of `Babylon`)
|
||||
- `classProperties`
|
||||
- `exportExtensions`
|
||||
- `asyncGenerators`
|
||||
- `functionBind`
|
||||
- `functionSent`
|
||||
- `dynamicImport`
|
||||
- `templateInvalidEscapes`
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user